---
# System prepended metadata

title: Backend tasks

---

# Backend tasks

## API Gateway setup
- [ ] Create repo (name: main client api gateway)
- [ ] Create docker environment for app (nodejs/express + typescript)
- [ ] Deploy to google cloud
- [ ] Handle 'ping' request

method: POST
path: '/api/v1-alpha/ping'
query params: none
body params: none
response:
```
{
    msg: 'ok'
}
```
status 200

- [ ] Create container template/image for setup of the steps above
- [ ] Find a solution for testing REST APIs
- [ ] Test 'ping' endpoint
- [ ] Find a solution for documenting REST APIs
- [ ] Document 'ping' endpoint

## Wines MS
- [ ] Create repo (name: wines ms)
- [ ] Setup nodejs/express + typescript environtment in a container
- [ ] Deploy to google cloud
- [ ] Test and document 'ping' endpoint
- [ ] Create managed SQL DB in google cloud
    - [ ] Add proper security rules (whitelist)
- [ ] Install sequelize
- [ ] Connect app to DB in google cloud (you may want to create an image for what is done up to this point as it will the setup for most of the microservices)
- [ ] Write migration for wine table (dive into sequilize and migrations) (all IDs in the system will be **strings**)
- [ ] Write seed with at least 200 wines for testing 
- [ ] Create crud for wines table
    - [ ] Create wine

        method: POST
        path: '/api/v1-alpha/wines'
        query params: none
        body params: Wine model minus id
        response:
        ```
        {
            id: String // ID of the created resource
        }
        ```
        status 200


    - [ ] Read wine
    
        method: GET
        path: '/api/v1-alpha/wines'
        query params: page (defaults to 1), per_page (defaults to 20)
        body params: Wine model minus id
        response:
        ```
        {
            data: <Wine>[],
            page: int, // current page
            per_page: int,
            last_page: int, // last page index calculated based on per_page param
            total: int,
        }
        ```
        status 200
        
        method: GET
        path: '/api/v1-alpha/wines/<id>'
        query params: page (defaults to 1), per_page (defaults to 20)
        body params: Wine model minus id
        response:
        ```
        {
            data: <Wine>[],
            page: int, // current page
            per_page: int,
            last_page: int, // last page index calculated based on per_page param
            total: int,
        }
        ```
        status 200
        
