Skip to content

andremartinsds/flash-cards-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flash-Cards API

Description: An API in Golang for creating, managing, and effectively studying flash-cards.

Golang Flash-Cards API

Table of Contents

Requirements

  • Golang (version 1.19 or higher)
  • Database (Mysql 8)
  • Docker

Database

  1. A simple image description of our database:

Golang Flash-Cards API

Setup

  1. Clone the repository:
git clone https://github.com/andremartinsds/flash-cards-api

Usage

  1. Navigate to the project folder:
cd flash-cards-api
  1. 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=""
  1. Install dependencies:
go mod tidy
  1. Execute docker-compose:
docker-compose up
  1. 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

Examples swagger

Swagger example

Contribution

fell free to send a pull request

Author

André Martins

About

A simple api for flash cards

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published