This is a sample repository collected from the experience of implementing projects and referring to other tutorial pages (I have cited sources in the last section). The project includes:
- Implementing ExpressJS and router
- Connecting to MongoDb
- Connecting to Redis
- Services:
- Register account
- Login/Logout
- Login with Google
- Retrieve token when expired (no need to log in again)
- Get a list of User authenticated by Token
- Upload file
- Mini CRM
- Nodejs (up to v14.18.1)
- Redis (I use v6.2.6)
- MongoDb (I use v5.0.10): You can refer to this repo to use the
docker-image mongo
PORT=3000
MONGO_URL_CONNECT_1=
MONGO_URL_CONNECT_2=
REDIS_PORT=6379
REDIS_HOST=
ACCESS_TOKEN_SECRET=
REFRESH_TOKEN_SECRET=
GOOGLE_CLIENT_ID=
To get ACCESS_TOKEN_SECRET
and REFRESH_TOKEN_SECRET
, please run the bash
command below, then use any KEY for both values.
node ./src/helpers/generate_key.js
or
yarn token