Skip to content

🦄🦁🐵 Pokedex REST API created with GO and PostgreSQL

Notifications You must be signed in to change notification settings

gitkoDev/pokemon-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Pokedex REST API

Nest Logo

Pokedex REST API allows users to keep track of caught pokemon and their stats: TYPE, HP, ATTACK, and DEFENSE. The API utilizes JWT authentification for additional security as well as a number of other tools (look below). The projects structure implements clean architecture and dependecy injection principles

Endpoints

API

  • /v1/pokemon   =>POST=>   Add pokemon
  • /v1/pokemon   =>GET=>   Get all pokemon
  • /v1/pokemon/{id}   =>GET=>   Get pokemon by id
  • /v1/pokemon/{id}   =>PUT=>   Update pokemon by id
  • /v1/pokemon/{id}   =>DELETE=>   Delete pokemon by id

Other

  • /health   =>GET=>   Ping the database connection
  • /auth/sign-up   =>POST=>   Create new pokemon trainer
  • /auth/sign-in   =>POST=>   Sign in with existing profile to generate JWT authentification token

Tools used

  • App configuration   =>   Viper
  • Logging   =>   Logrus
  • Routing   =>   Chi
  • Database   =>   Postgres + pgx
  • Database migrations   =>   Goose
  • Containerization   =>   Docker + Docker Compose
  • Authentification and middleware   =>   JWT Go
  • Testing   =>   Sqlmock + Gomock + Testify

Installation

make initUp

Running the app

# rebuild containers
make build

# start the app
make run

# run psql utility
make startPsql