genesis-kma-school-entry
Test task for Genesis & KMA Software Engineering School 4.0
Installation Steps
Local Development
-
Install Golang by following the official installation guide: Golang Installation Guide
-
Clone the repository:
git clone https://github.com/Hukyl/genesis-kma-school-entry.git
-
Navigate to the project directory:
cd genesis-kma-school-entry
-
Copy the .env.sample
file and rename it to .env
(make sure .env
file is on the same directory level as docker-compose.yml
):
cp .env.sample .env
-
Install the project dependencies:
go mod download
-
Start the local development server:
go run main.go
The base url will be available at localhost:<port>
.
Running Services in Docker Compose
-
Install Docker by following the official installation guide: Docker Installation Guide
-
Clone the repository:
git clone https://github.com/your-username/genesis-kma-school-entry.git
-
Navigate to the project directory:
cd genesis-kma-school-entry
-
Copy the .env.sample
file and rename it to .env
(make sure .env
file is on the same directory level as docker-compose.yml
):
cp settings/.env.sample .env
NOTE: some of the variables are hardcoded into docker-compose.yml
to ensure that the API uses the container database.
-
Build and start the Docker containers:
docker compose up -d
The base url will be available at 127.0.0.1:<port>
.
Endpoints
The endpoints fully conform to the provided endpoint schemas in Swagger documentation.
Get USD-UAH rate
- Method:
GET
- URL:
/rate
- Purpose: provides a USD-UAH current rate.
Subscribe to email notifications
- Method:
POST
- URL:
/subscribe
- Form-data parameter:
email
- Purpose: subscribe to daily email notifications of rate
Testing
Most of the subpackages are covered by unittests.
In order to run tests:
go test -v ./...
License
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright
© 2024-current Andrii Shalaiev. All Rights Reserved.