https://github.com/weiwei2694/express-jwt-start
Express Jwt: Express, Jsonwebtoken, Prisma, MySQL
https://github.com/weiwei2694/express-jwt-start
express jwt middlewares mysql prisma roles
Last synced: about 2 months ago
JSON representation
Express Jwt: Express, Jsonwebtoken, Prisma, MySQL
- Host: GitHub
- URL: https://github.com/weiwei2694/express-jwt-start
- Owner: weiwei2694
- Created: 2023-10-27T13:38:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-30T09:35:17.000Z (over 2 years ago)
- Last Synced: 2025-03-17T19:30:31.831Z (over 1 year ago)
- Topics: express, jwt, middlewares, mysql, prisma, roles
- Language: JavaScript
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Express Jwt: Express, Jsonwebtoken, Prisma, MySQL
## Key Features
- Roles
- Middlewares
- Jwt
- ORM using Prisma
- MySQL Database
- Cookie
- Http Only
## Cloning the repository
```bash
git clone https://github.com/weiwei2694/express-jwt-start.git
cd express-jwt-start
```
## Install packages
```bash
npm install
```
## Setup .env file
```
# SERVER
PORT=8000
# JWT
ACCESS_TOKEN_SECRET=access_token_secret
ACCESS_TOKEN_EXPIRED=30
REFRESH_TOKEN_SECRET=refresh_token_secret
REFRESH_TOKEN_EXPIRED=30
# DATABASE
DATABASE_URL=
```
## Setup Prisma
Add MySQL Database
```bash
npx prisma generate
npx prisma db push
```
## Available commands
| Command | Description |
| ---------------------- | ---------------------------------------- |
| `npm run dev` | Starts a development instance of the app |
| `npm run prettier` | Check and format code using Prettier |
| `npm run prettier:fix` | Format code using Prettier (fix issues) |