https://github.com/scarletczen/coffee-manager
A sweet and simple CRUD API for coffee lovers like you and me.
https://github.com/scarletczen/coffee-manager
chi go postgresql
Last synced: 19 days ago
JSON representation
A sweet and simple CRUD API for coffee lovers like you and me.
- Host: GitHub
- URL: https://github.com/scarletczen/coffee-manager
- Owner: scarletczen
- License: mit
- Created: 2024-01-02T08:55:24.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-02T12:46:26.000Z (over 2 years ago)
- Last Synced: 2025-09-18T01:02:55.240Z (9 months ago)
- Topics: chi, go, postgresql
- Language: Go
- Homepage:
- Size: 3.88 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Coffee Manager - Go, Chi, PostgreSQL
[](https://choosealicense.com/licenses/mit/)
A sweet and simple CRUD API for coffee lovers like you and me.
## Run Locally
Clone the project
```bash
git clone https://github.com/abhinavthapa1998/coffee-manager.git
```
Start the server
```bash
make run
```
Stop the server
```bash
make stop
```
Build the binary
```bash
make build
```
## API Reference
#### Get All Coffees
```http
GET /api/v1/coffees/coffee
```
#### Get Coffee By Id
```http
POST /api/v1/coffees/coffee/{id}
```
| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| `id` | `string` | **Required**. id of the coffee |
#### Create Coffee
```http
POST /api/v1/coffees/coffee
```
| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| `name` | `string` | **Required**. name of the coffee |
| `image` | `string` | **Required**. image of the coffee |
| `region` | `string` | **Required**. region of the coffee |
| `roast` | `string` | **Required**. roast of the coffee |
| `price` | `number` | **Required**. price of the coffee (in cents) |
| `grind_unit` | `string` | **Required**. grind_unit of the coffee |
#### Update Coffee By Id
```http
PUT /api/v1/coffees/coffee/{id}
```
| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| `name` | `string` | **Optional**. name of the coffee |
| `image` | `string` | **Optional**. image of the coffee |
| `region` | `string` | **Optional**. region of the coffee |
| `roast` | `string` | **Optional**. roast of the coffee |
| `price` | `number` | **Optional**. price of the coffee (in cents) |
| `grind_unit` | `string` | **Optional**. grind_unit of the coffee |
#### Update Coffee By Id
```http
DELETE /api/v1/coffees/coffee/{id}
```
| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| `id` | `string` | **Required**. id of the coffee |