Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/omarkhairy21/vending-machine-api
https://github.com/omarkhairy21/vending-machine-api
Last synced: about 6 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/omarkhairy21/vending-machine-api
- Owner: omarkhairy21
- Created: 2024-03-09T03:00:01.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-03-09T03:10:18.000Z (8 months ago)
- Last Synced: 2024-03-09T04:20:00.355Z (8 months ago)
- Language: TypeScript
- Size: 146 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Description
This is a simple Vending Machine API that allows users to buy products and get change back.
## Tech Stack
- NestJS
- TypeORM
- SQLite# System Requirements
- Node.js: v18
- Yarn: v1.22.5## Api Documentation
Docs can be found at https://vending-machine-api.fly.dev/api
Note: On API I assumed endpoints get products and users allowed to be public, but in a real scenario, they should be private.
## Authentication
1. You need to create a user first using endpoint POST /users.
2. Use endpoint POST /auth/login to get a token.
3. Add the token on swagger Authorize button.## Installation with Docker
1. Build the image
```bash
docker build -f "Dockerfile.dev" -t vendingmachineapi-dev:latest "."
```2. Run the container
```bash
docker run -p 3000:3000 vendingmachineapi-dev:latest
```## Installation without Docker
```bash
$ yarn install
```## Running the app
```bash
# development
$ yarn run start# watch mode
$ yarn run start:dev# production mode
$ yarn run start:prod
```## Test
```bash
# unit tests
$ yarn run test# e2e tests
$ yarn run test:e2e# test coverage
$ yarn run test:cov
```