This document provides instructions for setting up and running the backend service.
- Ensure you have Docker and Docker Compose installed on your machine.
- Make sure you have Go installed (version 1.16 or later).
-
Copy the Environment Variables File
Before starting the application, you need to create a
.env
file with your own configuration. Copy the example file provided:cp .env.example .env
Update the
.env
file with your PostgreSQL credentials and desired application port. -
Start the Database with Docker Compose
Use Docker Compose to start the PostgreSQL database. Run the following command in the root of your project directory:
docker-compose up -d
This command will start the database service in detached mode.
-
Build the Go Application
After the database is up and running, build the Go application:
go build
-
Run the Application
Finally, run the application:
./your_application_name
Replace
your_application_name
with the name of the binary generated by thego build
command. -
Access the Application
The application should now be running on the port specified in your
.env
file (default is2121
). You can access it viahttp://localhost:2121
.
-
If you encounter issues with loading the
.env
file, ensure that the file is correctly named and located in the root of your project. -
Check the logs of the Docker containers for any errors by running:
docker-compose logs
This project is licensed under the MIT License - see the LICENSE file for details.