https://github.com/anilozmen/evaexchange-assignment
https://github.com/anilozmen/evaexchange-assignment
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/anilozmen/evaexchange-assignment
- Owner: anilozmen
- Created: 2023-09-24T06:20:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-25T11:56:49.000Z (over 1 year ago)
- Last Synced: 2025-01-20T13:48:00.063Z (5 months ago)
- Language: JavaScript
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EvaExchange
## Endpoints
| Method | URL | Description |
| -------| ------------------------------------------- | ---------------------------------------- |
| `GET` | `/api/v1/users` | Returns all users. |
| `GET` | `/api/v1/users/:userId` | Returns a user. |
| `POST` | `/api/v1/users` | Creates a new user |
| `GET` | `/api/v1/users/:userId/portfolios` | Returns a user w/ portfolio data. |
| `POST` | `/api/v1/users/:userId/portfolios` | Creates a portfolio to the user. |
| `POST` | `/api/v1/users/:userId/share/:shareId/buy` | Buys a share. |
| `POST` | `/api/v1/users/:userId/share/:shareId/sell` | Sells a share. |
| | | |
| `GET` | `/api/v1/shares` | Returns all shares. |
| `GET` | `/api/v1/shares/:shareId` | Returns a share. |
| `POST` | `/api/v1/shares` | Creates a share. |
| `PUT` | `/api/v1/shares/:shareId` | Updates a share. |## Installation
```bash
$ cd evaexchange# Build a docker image
$ docker-compose build# Create containers
$ docker-compose up -d# Access the Node.js container shell
$ docker exec -it node_app sh# Create Tables
$ npm run db:migrate# Import All Dummy Data
$ npm run db:seeds$ http://localhost:3000
```