For almost every backend app or API I have to implement complete Auth functionalities. Creating DB Schema, making routes, implementing login and etc takes a long time of my whole project. That's why I though that why not I make a starter project with all auth features and just clone it when I need? From this thought I build this starter project.
Auth Features:
- Sign Up
- Login
- Email Verification ( Gmail )
- Reset Password
- Change Password
- Test Included ( Jest + Supertest )
User Schema Field
- Username
- Password
- User Role ( Admin/Customer )
- Active ( True/False )
- Verified ( True/False )
- Random String ( For Verification Purpose )
- Created At
- Updated At
Tech Stack
- NodeJs
- ExpressJs
- MongoDB
Packages
- bcrypt
- cors
- dotenv
- googleapis
- jsonwebtoken
- mongodb
- mongoose
- nodemailer
- nodemon
- jest
- supertest
How to use?
- Clone this repo.
- Go to the directory.
- Make a
.env
file. - Open
.env.example
file and copy everything from this file. - Paste copied text to just created .env file
- Fill necessary variable. ( How to get CLIENT_ID, CLEINT_SECRET etc ?? Follow this link )
- Use
yarn install
ornpm install
command - Use
yarn dev
ornpm dev
command.
N.B: Your test may fail, take a look and change necessary value to pass.
Top comments (1)
Try wj-config for your configuration needs instead of dotenv. It is far, far superior.