Description
This is a school project. The requirements are to create a restfull api, using Go, to manage some articles with comments. We must use JWT for the authentication, MVC pattern for the architecture, and GORM with MySQL for the database.
A complete documentation with a clean repository is mandatory.
Developers
- Corentin Croizat
- Christophe Charlebois
- ClΓ©ment Haller
- Guillaume Cornet
Table of Contents
Directory Structure
<Wiki-Go>/
ββ api/
| ββ server/
| ββ routes.go
| ββ server.go
ββ controllers/
ββ documentation/
| ββ swagger.json
ββ middleware/
ββ models/
ββ utils/
ββ view/
ββ docker-compose.yml
ββ main.go
ββ README.md
Model Structure
Used Package
- crypto - Go cryptography libraries (bcrypt)
- mux - HTTP request router and dispatcher
- gorm - ORM library for Go
- jwt - Go implementation of JSON Web Tokens
- swagger - Go implementation of Swagger 2.0
- CORS - Go cors handler
Api Documentation
Once docker-compose is up you can navigate to
http://localhost:8085/documentation/api/v1/
Api server
http://localhost:8080
Installation
- Launch MySQL, phpmyadmin, swagger, and api
docker-compose up --build
Wait for the mysql container to mount
if the server is not up when the mysql container has finished mounting, run the docker-compose up
command again