Code Monkey home page Code Monkey logo

nestjs-boilerplate-prisma's Introduction

Badges

Postgres NestJS PNPM

NestJS Prisma Project Template

This template provides a starting point for building a NestJS application using Prisma as an ORM. It includes configuration for local development with Docker and instructions for running the application and tests.

Prerequisites

Getting Started

To get started with this template, clone the repository and install the dependencies.

# Clone the repository
git clone https://github.com/AndreaDiazCorreia/nestjs-boilerplate-prisma.git
cd nestjs-boilerplate-prisma

# Install dependencies
pnpm install

Docker Setup

This template includes a Docker configuration for running a PostgreSQL database. To start the PostgreSQL database:

docker-compose up -d

# Ensure the database is running by checking the container status:
docker ps

Running the Application

You can start the application in development, watch, or production mode.

# development mode
pnpm run start

# watch mode
pnpm run start:dev

# production mode
pnpm run start:prod

Running Tests

Run unit tests, end-to-end tests, or test coverage reports using the following commands:

# unit tests
pnpm run test

# e2e tests
pnpm run test:e2e

# test coverage
pnpm run test:cov

Environment Variables

The application requires configuration via environment variables. Copy the .env.example to .env and modify it according to your environment:

cp .env.example .env

Edit .env and set the DATABASE_URL to connect to your Dockerized PostgreSQL database.

Prisma Integration

To generate the Prisma client and apply database migrations, use:

pnpm prisma generate
pnpm prisma migrate deploy

These commands set up the Prisma client and apply any migrations defined in the Prisma schema to your database.

Building for Production

To build the application for production deployment:

  pnpm run build

This compiles the TypeScript code into JavaScript in the dist directory.

Contributing

Contributions are always welcome!

Authors

License

MIT

nestjs-boilerplate-prisma's People

Contributors

andreadiazcorreia avatar

Stargazers

Máximo Tovar avatar Facundo Vignoles avatar

Watchers

 avatar

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.