Express JS JWT Postgres with Sequelize ORM
# redis available
$ redis-cli
# clone the repo
$ git clone repo
# go into repo's directory
$ cd repo
# copy and edit env file
$ cp .env.example .env
# migrate database
$ npx sequelize db:migrate
# seeds data to database such as admin user, status, roles
$ npx sequelize db:seed:all
# start app
$ npm run dev
Sequelize CLI:
$ npx sequelize-cli init
Create a new migration:
$ npx sequelize-cli migration:create --name create_users
Running Migrations:
$ npx sequelize-cli db:migrate
Running Seeds:
$ npx sequelize-cli db:seed:all
- Favicon using serve-favicon
- Morgan Log file
- Express Architecture Pattern
- Routes (bridge - logic process)
- Services (controller)
- Sequelize ORM (process to DB)
- Error Handling
- Validator using express-validator
- DB
- Make migration files using sequelize6-auto-migrations
- DB migrate using sequelize db:migrate
- Auth
- Register + Verification Link
- Send Email with background task and Redis
- Open Link Verification Email
- Resend Verification Email Code
- Login
- JWT Auth Middleware
- Refresh Token
- Forgot Password, send email OTP
- Forgot Password Verify OTP
- Reset Password
- Logout
- Account
- Get Profile
- Update Profile
- Upload Photo Profile
- Upload image(compressed)
- Change Password
- Deletion Account with OTP
- Recover deleted account (Admin role)
- User Activity with interval (last login at, ip address in middleware)
- Express JS Swagger
- CRUD
- Pagination with Sequelize Limits and Pagination
- Sort + Search function in List Data
- Create Data
- Edit Data
- Delete Data
- Associations Sequelize Model
- Virtual field (Custom representation)
- Open API with API KEY middleware
- Upload Files
- Remove Files
- Upload Videos
- Create thumbnail from videos with ffmpeg
- Upload Images and Compress Image with libvips
- Create thumbnail from image
- Image Processing with libvips
https://github.com/dividedbynil/ko-architecture/tree/master
https://dev.to/mihaiandrei97/jwt-authentication-using-prisma-and-express-37nk
https://jwt-keys.21no.de/
https://www.npmjs.com/package/sequelize6-auto-migrations
https://supertokens.com/blog/revoking-access-with-a-jwt-blacklist
https://rishi58rishi.medium.com/uploading-and-compressing-image-with-multer-and-sharp-i-3070ff2512ad
https://dev.to/jobizil/encrypt-and-decrypt-data-in-nodejs-using-aes-256-cbc-2l6d
https://www.npmjs.com/package/sequelize-mig
Create migration:
$ npx sequelize-mig migration:make -n <migration name>
Preview migration:
$ npx sequelize-mig migration:make --preview