I am new to node and I want to start building the following application:
The app should be a catalog of services offered by certain businesses. Users should be able to start and track the status of processes along with listed services providers.
So there are four databases:
- Admins
- Users
- Businesses
- Processes
And three types of users:
- Admin = Me (Authentication: username+password)
- Business (Authentication: username+password)
- User (Authentication: facebook)
Admins should have CRUD permissions to all databases. Businesses can only perform CRUD to their own profile (provided service) and update relevant processes. Users can perform CRUD to their on going processes.
I read a lot about npm modules like everyauth, mongoose-auth, passport but I have difficulties understanding their relationships with databases like mongodb especially when I have three types of users with three different permissions and four databases. I dont know how pages can check for three different types of cookies.
Should I create three different login and regestration systems? If yes, how?
Can someone please help me out..not with code..but with a concept or a relevant tutorial.
Passport requires the following for username & password configuration:
What I can't understand is:
- Where is the resulting database?
- How can I connect a mongodb database that I can access later?
- How should the app.get() look like to redirect users to corresponding login page?
- How can I implement this for three different login pages (adminLogin, businessLogin, userLogin) with three corresponding databases (admin, business, user)?
- How can I check if correct type of cookie is available on three different home pages (adminHome, businessHome, userHome)?