Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mcnaveen/node-express-prisma-boilerplate
🦄 Starter template for your Express Prisma MySQL API
https://github.com/mcnaveen/node-express-prisma-boilerplate
express mysql nodejs prisma prisma-client typescript
Last synced: about 2 months ago
JSON representation
🦄 Starter template for your Express Prisma MySQL API
- Host: GitHub
- URL: https://github.com/mcnaveen/node-express-prisma-boilerplate
- Owner: mcnaveen
- Created: 2022-02-01T16:14:47.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T18:35:51.000Z (about 2 months ago)
- Last Synced: 2024-10-29T20:38:29.769Z (about 2 months ago)
- Topics: express, mysql, nodejs, prisma, prisma-client, typescript
- Language: TypeScript
- Homepage:
- Size: 408 KB
- Stars: 33
- Watchers: 1
- Forks: 10
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Node Express Typescript Prisma Boilerplate
🦄 Starter template for your Express Prisma MySQL API
## 🍔 Stack Specs
- Node.js
- Express
- TypeScript
- Prisma
- MySQL## 🧬 Development
- Clone the repository
```
git clone https://github.com/mcnaveen/node-express-prisma-boilerplate nepb
```
- Cd into the project directory
```
cd nepb
```- Install dependencies
```
yarn install
```- Create a Database in MySQL (or) You can use GUI to create a database
```
mysql> CREATE DATABASE express;
```- Copy the `.env.sample` file as `.env`
```
cp .env.sample .env
```- Edit the MySQL Details in the `.env` file
```
DATABASE_URL="mysql://USERNAME:PASSWORD@localhost:3306/DBNAME?schema=public"
```- Push the Prisma Schema into Database
```
npx prisma migrate dev
```- Run the development server
```
yarn dev
```## 🚀 Production Build
- Run the production build
```
yarn build
```- Start the production server
```
yarn start
```> Your production build is available on `dist` folder
## 🧭 Endpoints
- `POST` - For Creating New User
- `GET` - For Getting All Users
- `GET` - For Getting User By ID
- `PATCH` - For Updating User By ID
- `DELETE` - For Deleting User By ID## 🃏 Examples
> 💡 Please install the Recommended VS Code Extensions and Check `api.rest` file for Examples
- Creating a New User
```
POST http://localhost:4000/users
Content-Type: application/json{
"name": "john",
"email": "[email protected]"
}
```- Getting All Users
```
GET http://localhost:4000/users
```- Getting User By ID
```
GET http://localhost:4000/users/1
```- Patching User By ID
```
PATCH http://localhost:4000/users/1
Content-Type: application/json{
"name": "newjohn",
"email": "[email protected]"
}
```- Deleting User By ID
```
DELETE http://localhost:4000/users/1
```## ☑️ LICENSE
- MIT---
### 💰 HELP ME WITH DEVELOPMENT COST