Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcjulian/nest-prisma2
Nest Prisma2 repo
https://github.com/marcjulian/nest-prisma2
Last synced: 22 days ago
JSON representation
Nest Prisma2 repo
- Host: GitHub
- URL: https://github.com/marcjulian/nest-prisma2
- Owner: marcjulian
- Created: 2019-07-25T21:55:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-23T23:45:43.000Z (almost 2 years ago)
- Last Synced: 2024-10-04T15:31:45.495Z (about 1 month ago)
- Language: TypeScript
- Size: 1.6 MB
- Stars: 15
- Watchers: 2
- Forks: 3
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
🚧 Checkout [nestjs-prisma-starter](https://github.com/fivethree-team/nestjs-prisma-starter/tree/prisma2)
# Nest Prisma2
## Getting Started
### 1. Install Prisma2
Setup [Prisma2 CLI](https://github.com/prisma/prisma2/blob/master/docs/getting-started.md)
```bash
npm install -g prisma2
```### 3. Prisma2: Lift
[Lift]() is used to manage the schema and migration of the database.
Saving the migration of the database:
```bash
prisma2 lift save
```Perform the database migration:
```bash
prisma2 lift up
```### 4. Prisma2: Photon
[Photon](https://github.com/prisma/prisma2/blob/master/docs/photon/api.md) is a type-safe database client auto-generated based on the data model.
To generate Photon execute, this will alwayse be executed after `npm install`:
```bash
prisma2 generate
```### 5. Seed the database data with this script
Execute the script with this command:
```sh
npm run seed
```### 6. Install Nestjs
The [Nestjs CLI](https://docs.nestjs.com/cli/usages) can be used to generate controller, services, resolvers and more.
```
npm i -g @nestjs/cli
```### 7. Install Dependencies
Install the dependencies for the Nest server in the folder:
```bash
npm install
```### 8. Start Nest Server
```bash
npm run start
# or in watch mode
npm run start:dev
```Graphql is available [localhost:3000/graphql](http://localhost:3000/graphql) and Swagger for Rest Api is available [localhost:3000/api](http://localhost:3000/api).