/cmd
package for storing main.go that launch all dependencies.
/configs
gets values from the environment (.env file).
/internal
stores /database
with start migrations.
/pkg
includes:
-
/handler
receives HTTP requests and passes on service. -
/service
processes handlers and implements business logic. -
/repository
works with a database. -
Files for storing a main entities' structures.
Docker
files:
-
Dockerfile
build container & launch all dependencies. -
docker-compose.yml
runs application and database in the separate containers to avoid possible data loss if an app crash.
Makefile
consists of main commands.
example.env
is an example of .env that stores main secret values.
Environmental variables are located in .env file.
- Go 1.22
- PostgreSQL
- Docker
- Rename 'example.env' to '.env'.
- Run
make build && make run
. - Run
make migrate_up
. to apply migrations.
- Receiving the current dollar (USD) to hryvnia (UAH) exchange rate from Monobank API.
- Receiving an email from a JSON response.
- Following SOLID principles creating scalable infrastructure using interfaces.
- Database Migrations.
- Docker and microservice architecture.
- Dividing
/rate
realization in handler into service where business logic should be. - CRUD operations for email table.
- Email validation.
- Mailjet for email sending.
- Adding CI/CD approach using GitHub Actions.