Skip to content

matany90/User-management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rele-Ai assignment - My implementation

Overview:

The application is a users management tool. Users are identified by the fields: name, email and phone. You can add, edit, and delete users from the application.

Tech-stack:

Frontend:

  • Vue.js Framework
  • State management: VueX
  • UI library: Vuetify

Backend:

  • Node.js with Express
    • endpoints:
      • GET - fetchUsers: returns an array of all users from firestore collection called 'users'
      • POST - addUser: gets a user and adds it to the collection, and returns the added user
      • POST - updateUser: gets a user and updates their fields in collection by id. Returns the user after the update
      • POST - deleteUser: gets a user and deletes it from collection, returns deleted user
  • Firestore DB
  • Unit Test: AVAJS library. Each endpoint is checked. The files located at: server/tests/test.index.js

Database structure:

The database structure is structured as follows:

  • Users Collection
    • User document identified by unique id
      • Name
      • Email
      • Phone

Example:picture alt

In addition, when client-side reaches the fetchUsers endpoint, the response will be an array of user-objects that also includes id property for each user (the unique id key from firestore). This way, when client-side reaches the updateUser/deleteUser endpoints, we can compare the id we received from the client-side with all the keys in the firestore - so we can easily update/delete a user. This is the main reason I chose this database architecture

Hosting

The logic works this way:

Using the vue.config.js (located at client folder) file, the client's build-production folder is created in the server folder. In this way, the server is stored in heroku and can load the client according to the path

Installation instructions: DEV-MODE

To run the project locally, first clone the project and then:

In root folder:

 npm install 
npm run server 

(server runs on port 5000)

In client folder:

npm install 
npm run client 

(client runs on port 8080)

UI:

Users List:

picture alt

Add User:

picture alt

Edit User:

picture alt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published