-1. the code includes the necessary authentication and authorization controllers which includes signup, login, forgot and reset password, protect controller(which validate the user or protect the protected routes), restrict controler (for authorization). -2.Role-based access control (customer, real estate agent, admin, manager). to use restrict routes just pass the role of the user, you wanna give authorization, to the ristrictto midleware. eg restrictto('admin', 'manager') -3. the Global Error Handling are also implimented which includes the most error which we may face. it responses different error for the project when running on development mode and production mode. -4. the built in express error are also custemized to make it fit to our project. when there is the faieled scenario (error rather than server error), import the AppError and pass the error message and status code. -5. just import and use catchAsync when you write the asynchronous function to remove the bulky try catch block on our code. -6. the user routes are also implemented -7. the handler factory files includes the closure functions which recieve the resources model and return the function. to make the common CRUD operation call the handler factory function. example getOne(User)-- to get one user. thes files will get some modification for the future according to the systems usecase -7. apifeatures includes Searching, pagination and sorting implimentation. we can use it in all our resources. -7. the users can signup only as customer and realEstate. the admin and managers are set manually. -10. to signup the realEstate it must have come with the realEstate specific feature (License number, business address, and document) plus other common required fields. -11. to signup the customer it must have not come with the realEstate specific feature (License number, business address, and document) but includes common required fields only. -12. use JWT for authentication and bcrypt for password hashing. -13. use the npm run dev --- to run in development mode. npm run prod --- to run in production mode.
-
Notifications
You must be signed in to change notification settings - Fork 0
RevoEstate/RevoEstate-backend
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published