Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gitkodev/pokemon-api
:unicorn::lion::monkey_face: Pokedex REST API created with GO and PostgreSQL
https://github.com/gitkodev/pokemon-api
clean-architecture docker go golang golang-api-examples mock-testing pokedex-api pokemon rest-api
Last synced: about 6 hours ago
JSON representation
:unicorn::lion::monkey_face: Pokedex REST API created with GO and PostgreSQL
- Host: GitHub
- URL: https://github.com/gitkodev/pokemon-api
- Owner: gitkoDev
- Created: 2024-02-12T07:44:09.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-03-29T05:40:35.000Z (8 months ago)
- Last Synced: 2024-06-19T11:38:41.304Z (5 months ago)
- Topics: clean-architecture, docker, go, golang, golang-api-examples, mock-testing, pokedex-api, pokemon, rest-api
- Language: Go
- Homepage:
- Size: 6.18 MB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go Pokedex REST API
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](https://github.com/spf13/viper)
- `Logging` **=>** [Logrus](https://github.com/sirupsen/logrus)
- `Routing` **=>** [Chi](https://github.com/go-chi/chi)
- `Database` **=>** Postgres + [pgx](https://github.com/jackc/pgx/)
- `Database migrations` **=>** [Goose](https://github.com/pressly/goose#sql-migrations)
- `Containerization` **=>** [Docker](http://docker.com/) + Docker Compose
- `Authentification and middleware` **=>** [JWT Go](https://github.com/golang-jwt/jwt)
- `Testing` **=>** [Sqlmock](https://github.com/DATA-DOG/go-sqlmock) + [Gomock](https://github.com/uber-go/mock) + [Testify](https://github.com/stretchr/testify)## Installation
```
make initUp
```## Running the app
```bash
# rebuild containers
make build# start the app
make run# run psql utility
make startPsql
```