Status • Run • Configuration • Usage • Contributing • License
Matchstick Video is complete. You can run the app, and check the source code to see how I implemented the Clean Architecture in Go.
First you'll need a PostgreSQL DB running. The easiest way is to clone the repo and run docker-compose up -d db.
Either download a release from the releases page, or clone and run make install, and execute:
matchstick-videoOr, to run the PostgreSQL DB and the app, clone and run:
make runYou can set the following environment variables:
PORT: What port to run the server on. Defaults to8080.MIGRATION_SOURCE: Folder which contains DB migrations. Defaults tofile://migrations.DB_USER: Username for DB. Defaults tomatchvid.DB_PASSWORD: Password for DB. Defaults topassword.DB_HOST: Host where the DB can be accessed. Defaults tolocalhost.DB_PORT: Port where the DB can be accessed. Defaults to5432.DB_NAME: Name of the database. Defaults tomatchvid.
POST on /inventory
Example body:
{
"name": "Cool Runnings (1993)",
"location": "AD12"
}Example response:
201: 1
GET on /inventory/{id}
Example response:
200:
{
"id": 1,
"name": "Cool Runnings (1993)",
"location": "AD12",
"available": true
}GET on /inventory
Example response:
200:
[
{
"id": 1,
"name": "Cool Runnings (1993)"
},
{
"id": 2,
"name": "The Matrix (1999)"
}
]PUT on /inventory/{id}
Example body:
{
"name": "Cool Runnings (1993) UPDATED",
"location": "AD12 UPDATED"
}Example response:
204
DELETE on /inventory/{id}
Example response:
204
PUT on /inventory/{id}/checkout
Example response:
204
PUT on /inventory/{id}/checkin
Example response:
204
Please submit an issue with your proposal.
See LICENSE

