https://github.com/vinbyte/mzk
https://github.com/vinbyte/mzk
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/vinbyte/mzk
- Owner: vinbyte
- Created: 2024-01-08T14:29:24.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-15T05:06:16.000Z (about 2 years ago)
- Last Synced: 2024-06-21T08:11:30.974Z (over 1 year ago)
- Language: Go
- Size: 885 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Prerequisites
- Golang installed
- Postgres installed
- [DBMate](https://github.com/amacneil/dbmate) installed. Or you can use dbmate via docker instead (using `make` command)
- Docker (optional, if you want to run via docker instead)
# How to run
## Without docker
1. Clone the repo
1. Copy and paste `.env.sample` to `.env`. And the config in `.env` file.
1. Make sure a database in ready in your Postgres
1. Run a migrations using dbmate to create a table and seed data. `dbmate -u "" up`. Example : `dbmate -u "postgres://postgres:@localhost:5432/postgres" up`. Make sure the database is same as defined in `.env` file
1. Run `make dev` to run the server. It will running on port `6060` by default.

1. The API docs is available via Swagger. You can open it in http://localhost:6060/swagger/index.html

1. You can try directly in Swagger.

## With docker
1. Clone the repo
1. Run your docker
1. Run `make compose-up`. It will prepare all you need to run the app. Spin up a Postgres container, build the app, and do a db migration.

1. The API docs is available via Swagger. You can open it in http://localhost:6060/swagger/index.html

1. You can try directly in Swagger.
