Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eduardozepeda/go-coffee-api
Guadalajara speciality coffee shops API
https://github.com/eduardozepeda/go-coffee-api
Last synced: about 6 hours ago
JSON representation
Guadalajara speciality coffee shops API
- Host: GitHub
- URL: https://github.com/eduardozepeda/go-coffee-api
- Owner: EduardoZepeda
- Created: 2022-06-23T16:25:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-02T05:19:44.000Z (4 months ago)
- Last Synced: 2024-08-03T01:52:28.583Z (4 months ago)
- Language: Go
- Homepage: go-coffee-api.vercel.app
- Size: 714 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go Coffee API
This is an API for coffee shops in Guadalajara. See details in the [Go Coffee API documentation](https://go-coffee-api.vercel.app/)
## Instructions for development
### Environmental variables
This project requires the following environmental variables set:
``` bash
JWT_SECRET=
DB_USER=
DB_PASSWORD=
DB_HOST=:
DB_PATH=
MODE=
GO_COFFEE_API_DSN=postgres://:@/
```### Migrations
You need three things for the development process
- Postgres database
- [Golang Migrate tool](https://github.com/golang-migrate/migrate)
- An environmental variable called GO_COFFEE_API_DSN equal to the following postgres://:@/#### Migrate
Once you got those things in place just run the following command.
``` bash
make migrate/up
```If you want to do it manually you can run the following command, replacing the appropiate values
``` bash
migrate -path=./migrations -database postgres://:@/ up
```#### Undo migrations
If you want to return the database to its initial state run the following command.
``` bash
make migrate/down
```If you want to do it manually you can run the following command, replacing the appropiate values
``` bash
migrate -path=./migrations -database postgres://:@/ down
```### Update docs
You need to have swag installed. The docs are installed in the docs directory, but you don't need to configurate anything, just run the following command.
``` bash
docs/generate
```### Install npm packages
Install the required packages for vercel to work
``` bash
npm install
```Install vercel package globally in case you don't have it
``` bash
npm i -g vercel
```### Run Go and javascript server
Run golang and javascript server using vercel command.
``` bash
vercel dev
```The previous command will run javascript and go server