Code Monkey home page Code Monkey logo

node-express-prisma-boilerplate's Introduction

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

Buy Me A Coffee

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.