Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/edmartt/characters-crud
A simple CRUD project using GIN framework as router for the web API
https://github.com/edmartt/characters-crud
Last synced: about 1 month ago
JSON representation
A simple CRUD project using GIN framework as router for the web API
- Host: GitHub
- URL: https://github.com/edmartt/characters-crud
- Owner: Edmartt
- Created: 2023-07-18T21:03:03.000Z (over 1 year ago)
- Default Branch: dev
- Last Pushed: 2024-04-19T12:33:03.000Z (7 months ago)
- Last Synced: 2024-10-02T09:14:18.700Z (about 1 month ago)
- Language: Go
- Size: 101 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CHARACTERS CRUD
This is a simple project for learning about Gin framework. It has simple CRUD operations related to fictional characters, for now, it can just read all the characters, character by ID and can creates character. It has an authentication system included that returns a JWT for sending the requests to the protected endpoints.
Project structure:
```
├── go.mod
├── go.sum
├── internal
│ ├── api
│ │ ├── authentication
│ │ ├── characters
│ │ │ ├── data
│ │ │ │ ├── daoImplementation.go
│ │ │ │ └── daoInterface.go
│ │ │ ├── handlers
│ │ │ │ └── handlers.go
│ │ │ ├── models
│ │ │ │ └── character.go
│ │ │ ├── responses
│ │ │ │ └── response.go
│ │ │ └── routes
│ │ │ └── charRoutes.go
│ │ └── server
│ │ ├── ping
│ │ │ ├── pingHandler.go
│ │ │ ├── pingResponse.go
│ │ │ └── pingRoute.go
│ │ └── server.go
│ └── database
│ ├── dbInterface.go
│ ├── migrations.go
│ └── sqlite.go
├── main.go
├── pkg
├── README.md
```And this is a prototype of the requests flow using the authentication service
![](https://github.com/Edmartt/characters-crud/blob/dev/assets/concept.png)
## Requirements
- Go 1.19+
- Docker
- SQLite## Running Locally
```
git clone https://github.com/Edmartt/characters-crud.git
```or ssh instead:
```
git clone [email protected]:Edmartt/characters-crud.git
```browse into project directory:
```
cd characters-crud/
```download dependencies
```
go mod tidy
```set environment variables following the .env.example file and run
```
go run main.go
```