Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/josephgodwinkimani/nestjsx-crud-starter
@nestjsx/crud starter repository for RESTful APIs running on Fastify
https://github.com/josephgodwinkimani/nestjsx-crud-starter
boilerplate crud fastify nestjs nestjsx-crud restful-api starter-template typeorm
Last synced: 25 days ago
JSON representation
@nestjsx/crud starter repository for RESTful APIs running on Fastify
- Host: GitHub
- URL: https://github.com/josephgodwinkimani/nestjsx-crud-starter
- Owner: josephgodwinkimani
- Created: 2023-12-21T13:22:49.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-21T14:31:38.000Z (about 1 year ago)
- Last Synced: 2024-11-11T08:51:48.369Z (3 months ago)
- Topics: boilerplate, crud, fastify, nestjs, nestjsx-crud, restful-api, starter-template, typeorm
- Language: TypeScript
- Homepage:
- Size: 92.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest
A progressive Node.js framework for building efficient and scalable server-side applications.
## Simple Blog API (CRUD users, users CRUD posts)
> [nestjsx-crud](https://github.com/nestjsx/crud) [TypeORM](https://docs.nestjs.com/techniques/database#repository-pattern) [Fastify](https://github.com/fastify/fastify) REST API
Nest TypeScript starter repository with NestJs CRUD for RESTful APIs and Fastify.
## Installation
```bash
$ pnpm install
```## Running the app
```bash
# development
$ pnpm run start# watch mode
$ pnpm run start:dev# production mode
$ pnpm run start:prod
```## Test
```bash
# unit tests
$ pnpm run test# e2e tests
$ pnpm run test:e2e# test coverage
$ pnpm run test:cov
```## API Endpoints
nestjsx/crud `Crud()` decorator generates the following API endpoints:
### Get many resources
```
GET /users
GET /posts
```_Result:_ array of resources | pagination object with data,
_Status Codes:_ 200### Get one resource
```
GET /users/:id
GET /posts/:id
```_Request Params:_ :id - some resource field (slug),
_Result:_ resource object | error object,
_Status Codes:_ 200 | 404### Create one resource
```
POST /users
POST /posts
```_Request Body:_ resource object | resource object with nested (relational) resources,
_Result:_ created resource object | error object,
_Status Codes:_ 201 | 400### Update one resource
```
PATCH /users/:id
PATCH /posts/:id
```_Request Params:_ :id - some resource field (slug),
_Request Body:_ resource object (or partial) | resource object with nested (relational) resources (or partial),
_Result:_ updated partial resource object | error object,
_Status codes:_ 200 | 400 | 404### Delete one resource
```
DELETE /users/:id
DELETE /posts/:id
```_Request Params:_ :id - some resource field (slug),
_Result:_ empty | resource object | error object
_Status codes:_ 200 | 404## License
This repo is [MIT licensed](LICENSE).
## Related Projects
- [Refine Boilerplate for Web (PWA), Desktop and Mobile](https://github.com/josephgodwinkimani/refine-starter) — A Cross-Platform starter template for Refine.dev that utilizes the Simple REST data provider to fetch and display data from a REST API (can easily replace with graphql data provider).
-