Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aldenvallestero/nest-ts-boilerplate
https://github.com/aldenvallestero/nest-ts-boilerplate
javascript mongo nest prisma typescript
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/aldenvallestero/nest-ts-boilerplate
- Owner: aldenvallestero
- Created: 2024-02-05T07:53:16.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-02-07T04:36:17.000Z (9 months ago)
- Last Synced: 2024-10-11T18:20:51.640Z (about 1 month ago)
- Topics: javascript, mongo, nest, prisma, typescript
- Language: TypeScript
- Homepage:
- Size: 430 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nest-ts-boilerplate
### Service Layer
When creating a service, make sure that the entire flow is wrapped by an error handler, and each significant step, including the initial step, must be logged to make everything traceable in any environment.![Service Layer Graphics](/graphics/service-layer-graphic.png)
### How to run
1. Clone the repository.
2. Run `npm install` to install dependencies.
3. Create `.env` file and add your MongoDB URL using `DATABASE_URL` variable.
4. Make sure you have a running MongoDB in your local machine.
5. Seed the database by running `npm run seed`.
6. Start the development environment by running `npm run start:dev`### 🌱 How seed works
Seeding is crucial during development phase to ensure all database models will be successfully executed according to its' schema and business requirements.In this repository, seeds are located under the Prisma directory called `seeder.prisma.ts`. It is a class-based service that has multiple methods based on the available collections declared in the Prisma schema, which are intended to perform data creation.
![Prisma Graphics](/graphics/prisma-graphic.png)
### â–³ Why Prisma
Having an ORM to your application will help you define a safe structure of the database and eventually gives you detailed references of explaining how your database is structured.