This repository provides a headstart for developing a Node.js backend application using Express, PostgreSQL, and Prisma ORM. It provides a structured foundation with boilerplate code and best practices to kickstart your development process.
Note: Don't forget, this structure could be highly opinionated and you can always modify it to suit your needs.
Make sure you have the following dependencies installed on your machine:
- Node.js - Download and install Node.js
- PostgreSQL - Download and install PostgreSQL
-
Clone this repository to your local machine using the following command:
git clone https://github.com/Velogan-Boy/node-headstart.git <project_name>
-
Navigate to the project directory:
cd <project_name>
-
Install the dependencies:
npm install
-
Create a new PostgreSQL database for your project.
-
Modify env files in the root directory of the project.
-
Modify the
schema.prisma
file in theprisma
directory to match your database schema. -
Run the following command to generate the Prisma client:
npx prisma generate
-
Run the following command to start the development server:
npm run dev
The server should now be running at http://localhost:5000.
Note: Don't forget to uncomment the .env files in .gitignore file if you want to push your code to a remote repository.