This is the backend service for the TRH application. It is built using Go and utilizes the Gin framework for handling HTTP requests and GORM for database interactions.
- Go 1.24.11 which is compatible with the version of TRH SDK
- PostgreSQL
-
Clone the repository:
git clone https://github.com/tokamak-network/trh-backend.git cd trh-backend -
Copy the example environment file and configure it:
cp .env.example .env
-
Update the
.envfile with your database credentials and other configurations.
-
Ensure your PostgreSQL server is running and accessible. You can use the docker compose file to start a local postgres server.
docker compose up -d
-
Run the application:
go run main.go
-
The server will start on the port specified in the
.envfile (default is 8000).
TRH_EFS_CLEANUP_RETENTION_DAYS: retention window for unused EFS cleanup (default: 14)
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature). - Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature/YourFeature). - Create a new Pull Request.
The swagger API documentation is running at the endpoint
http://localhost:${PORT}/swagger/index.html
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to the contributors of the open-source libraries used in this project.