- Please fork this repository and follow Project setup instructions listed below to install it locally. ✅
- Copy of a user should be stored in DB, you can use any database for this, our preference is MongoDB. ✅
- Please create an endpoint called
/create-account
✅ - It should take email and password and registers with some basic validation like
- Proper email ✅
- Email shouldn't already exist ✅
- Store this data in user table. Make sure to encrypt the password. ✅
- Please create an endpoint called
/login
: ✅
- It should follow the simplest login method, if I give correct email and password, it will return me a JWT Token. Wrong credentials will result in an error.
- Please don't use passport JS or any assisting libraries.
- Please create an endpoint called /dashboard, this will be an authenticated endpoint, if I don't pass a valid JWT Token it will return a 401. Else a 200 with some message.
- You can add as many packages as you like. Feel free to modify our code too.
- You should use industry standard, best code practices.
- It is up to you how you will implement the business logic.
- Don’t hesitate to ask if something is not clear.
- And have fun 🎉!
You should deliver the test within 1 week time.
NodeJS v16.9.1 yarn 1.22 - we use yarn as the package manager of choice. Feel free to use npm also. You already have nodemon installed so no need to worry about restarting server
- yarn
DEBUG=nodejs-assignment:server yarn start
- Fork this repo, create a new branch called
feature/login
- Put all your code their and raise a pull request. Invite the interviewee as one of the code reviewers.
- We will checkout the branch in our local and will test the endpoint via postman.
- It should be able to create an account/login/dashboard.
- How you create database connection and code quality
- Your commit style, make sure your commits are atomic and small.
- Your separation of concern and JS skills.
- Understanding of session management session.
- If we find some issues we might even comment on pull request to fix those issues and looking at how collaborative the process is.