Skip to content

Lium-7768/auth-crud-app

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Donate us Support us Follow us on Twitter

Description

A permission-based CMS and Nest system, backend API demo.

Technology Stack

Nest + Prisma + Postgresql + Typescript + Google Drive

Project setup

$ pnpm install

Compile and run the project

# development
$ pnpm run start

# watch mode
$ pnpm run start:dev

# production mode
$ pnpm run start:prod

Run tests

# unit tests
$ pnpm run test

# e2e tests
$ pnpm run test:e2e

# test coverage
$ pnpm run test:cov

vercel deploy flow

  1. add vercel.json
{
  "version": 2,
  "builds": [
    {
      "src": "dist/main.js",
      "use": "@vercel/node"
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "dist/main.js",
      "methods": ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]
    }
  ]
}
  1. Generate Prisma and copy the generated folder to dist. Check package.json -> vercel build, the last command cp -r src/prisma/generated/ dist/prisma/.

  2. Add environment variables. Open Vercel Console -> https://vercel.com/[projects]/[project]/settings/environment-variables, and add your own environment variables.

  3. deploy

npm i -g vercel
vercel login
pnpm run vercel-build
vercel --prod

Example 🌰

curl --location 'https://auth-crud-app.vercel.app/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "[email protected]",
    "password": "12345678"
}'

Swagger

https://auth-crud-app.vercel.app/api