Description: An API in Golang for creating, managing, and effectively studying flash-cards.
- Golang (version 1.19 or higher)
- Database (Mysql 8)
- Docker
- A simple image description of our database:
- Clone the repository:
git clone https://github.com/andremartinsds/flash-cards-api
- Navigate to the project folder:
cd flash-cards-api
- Configure environment variables:
Create a .env file in the project's root and set the necessary environment variables, such as database credentials and server settings.
APPLICATION_PORT=""
HOST=""
MYSQL_USER=""
MYSQL_ROOT_PASSWORD=""
MYSQL_DATABASE=""
MYSQL_PASSWORD=""
PORT=""
- Install dependencies:
go mod tidy
- Execute docker-compose:
docker-compose up
- Run api
In this case you can run the flash-cards-api with:
go run main.go
if you want execute with swagger you can run with like:
# install swag
go install github.com/swaggo/swag/cmd/swag@latest
Make sure that GOROOT and GOPATH are added to your bash profile
export PATH=$PATH:$(go env GOPATH)/bin
export PATH=$PATH:$(go env GOROOT)/bin
fell free to send a pull request
André Martins