Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thangtranse/node-express-mongoose-template
Basic structure ExpressJS using MongoDB and Redis. Build Login/Logout with JWT Authentication
https://github.com/thangtranse/node-express-mongoose-template
api api-authentication express-js express-middleware expressjs jwt jwt-auth jwt-authentication jwt-token mongodb mongoose nodejs rest-api
Last synced: about 1 month ago
JSON representation
Basic structure ExpressJS using MongoDB and Redis. Build Login/Logout with JWT Authentication
- Host: GitHub
- URL: https://github.com/thangtranse/node-express-mongoose-template
- Owner: thangtranse
- Created: 2022-08-10T01:48:23.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-15T05:06:36.000Z (8 months ago)
- Last Synced: 2024-05-15T21:19:30.444Z (8 months ago)
- Topics: api, api-authentication, express-js, express-middleware, expressjs, jwt, jwt-auth, jwt-authentication, jwt-token, mongodb, mongoose, nodejs, rest-api
- Language: JavaScript
- Homepage:
- Size: 24.1 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Repo basic!
# Introduction
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:- [x] Implementing ExpressJS and router
- [x] Connecting to MongoDb
- [x] Connecting to Redis
- [x] Services:
- [x] Register account
- [x] Login/Logout
- [x] Login with Google
- [x] Retrieve token when expired (no need to log in again)
- [x] Get a list of User authenticated by Token
- [x] Upload file
- [x] Mini CRM# System configuration
1. Nodejs (up to v14.18.1)
1. Redis (I use v6.2.6)
1. MongoDb (I use v5.0.10): You can refer to this [repo](https://github.com/thangtranse/mongo) to use the `docker-image mongo`# ENV
```sh
PORT=3000MONGO_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.
```sh
node ./src/helpers/generate_key.js
```or
```sh
yarn token
```# Extensions Node
1. [redis-commander](https://www.npmjs.com/package/redis-commander)
# References
### 1. From the manufacturer
### 2. From Blog
1. https://www.youtube.com/c/TipsJavascript
1. https://anonystick.com/