module
0.0.0-20241106175335-d5b8b7045e29
Repository: https://github.com/ablyamitov/simple-rest.git
Documentation: pkg.go.dev
# README
Simple REST API
Simple REST API — demo RESTfull service, writing via Golang by using Chi
Project structure
cmd/app/ - main package for starting the app
config - configuration files
internal/app - app functionality
internal/db - database, redis and web storage functionality
migration - migration source
gen - swagger generated files
Technologies used
- Language - go
- Database - postgresql
- Caching - redis
- Migration - migrate
Installation
-
Clone :
git clone https://github.com/Ablyamitov/simple-rest.git cd simple-rest
-
Download dependencies:
go mod download
-
Launch Postgresql, Redis server, create database
-
Set up the configuration file
config.yaml
:server: port: 8080 database: url: "postgresql://postgres:12345678@localhost:5432/library?sslmode=disable" cache: redis_url: "redis://localhost:6379"
Using via Makefile
-
Build project:
make build
-
Run server:
make run
-
Apply migrations:
make migrate
-
Create new migration:
make migrate-create name=<migration_name>
Replace
<migration_name>
with the desired migration name. -
Clean up:
make clean
Deployment
You can use Docker to containerize your application. An example Dockerfile and deployment instructions are included in the project for your convenience.
# Packages
No description provided by the author