Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yeukfei02/dummy-api
Api for playing around with dummy data. Feel free to use it in your demo projects, tutorials, or testing tasks.
https://github.com/yeukfei02/dummy-api
dummy-api dummy-data hacktoberfest nestjs nodejs postgres prisma typescript
Last synced: 2 months ago
JSON representation
Api for playing around with dummy data. Feel free to use it in your demo projects, tutorials, or testing tasks.
- Host: GitHub
- URL: https://github.com/yeukfei02/dummy-api
- Owner: yeukfei02
- License: mit
- Created: 2022-04-20T08:34:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T08:29:49.000Z (about 1 year ago)
- Last Synced: 2024-05-09T16:13:58.214Z (8 months ago)
- Topics: dummy-api, dummy-data, hacktoberfest, nestjs, nodejs, postgres, prisma, typescript
- Language: TypeScript
- Homepage:
- Size: 625 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# dummy-api
Api similar to [dummy-api](https://dummyapi.io/docs)
Api for playing around with dummy data. Feel free to use it in your demo projects, tutorials, or testing tasks.
- All authorization headers are optional
- listing api default page = 1, default per page = 20
swagger:
documentation:
## Requirement
- install pnpm
- install node (v18+)## Testing and run
```zsh
// test api in local
$ pnpm run start:dev// run in production
$ pnpm run start:prod// lint code
$ pnpm run lint// format code
$ pnpm run format// run test case
$ pnpm run test// create module
$ nest g module// create controller
$ nest g controller// create service
$ nest g service// generate schema.prisma and prisma client
$ pnpm run prisma:generate// create migration file if schema.prisma changed
$ pnpm run prisma:migrate:dev// reset database
$ pnpm run prisma:migrate:reset// apply pending migrations in the production/staging database
$ pnpm run prisma:migrate:deploy// check migrations status in the production/staging database
$ pnpm run prisma:migrate:status// push schema.prisma state to database
$ pnpm run prisma:db:push// seed data to database
$ pnpm run prisma:db:seed// validate schema.prisma
$ pnpm run prisma:validate// format schema.prisma
$ pnpm run prisma:format// open prisma studio
$ pnpm run prisma:studio
```## Docker
```zsh
// build images and start container in one line
docker-compose up -d --build// go inside container
docker exec -it /bin/bash// check container logs
docker logs// remove and stop container
docker-compose down
```open localhost:3000