This project is an API developed in Go that provides analytical data about projects registered in the Taiga system. The API is designed to facilitate the analysis of data such as statistics of tags, users, and card statuses.
This guide will teach you how to configure and run the project locally.
Before starting, make sure that:
- Go is installed on your machine.
- If not, follow the instructions at Go Documentation.
- You have an active internet connection to download the necessary dependencies.
- A PostgreSQL database is configured and running.
-
Clone the Repository
Open the terminal and run the command below to clone the repositorgit clone https://github.com/ininetrack/Track-5Sem2025Server.git cd Track-5Sem2025Server/src
After cloning and installing the dependencies, it is necessary to activate the git commit standardization, file .pre-commit-config.yaml, follow with the commands:
mv .git/hooks/pre-commit.sample .git/hooks/pre-commit.sample.old
pre-commit install --hook-type commit-msg --hook-type pre-commi-
Configure the Database
Ensure that PostgreSQL is configured with the required credentials. Update the.envfile with the database information:DB_USER=user-database DB_PASSWORD=password-database DB_HOST=host-database DB_PORT=port-database DB_NAME=name-database DB_SCHEMA=schema-database EMAIL_HOST=email-host EMAIL_PORT=email-port EMAIL_HOST_USERNAME=email-host-user EMAIL_HOST_PASSWORD=email-host-password EMAIL_HOST_FROM=email-host-from
-
Install Dependencies
Run the command below to install the project dependencies:go mod tidy
-
Run the Application
Start the application with the command:go run main.go
-
Access the Application in the Browser
Once the application is running, open your preferred browser and enter the following address:http://localhost:8080/swagger/index.htmlDone! Now you are ready to explore the analytical data of Track-5Sem2025Server and use it in your application or for visualization.
To authorize in Swagger, after copying the token, you need to prepend the word "Bearer" followed by a space before the token. For example:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImFuZHJlbHVpejEwODhAZ21haWwuY29tIiwiZXhwIjoxNzQ2NTc2NDE2LCJyb2xlIjo5OTY1NjEyLCJ1c2VyX2lkIjoyfQ.AJIwXmhVofrykeamLzUQQxu7WkvZvfQc6cOzDt5-P7w
- Project Query: Displays all projects registered in the Taiga system.
- Project Statistics: Provides analytical data about cards by tags, cards by users, and cards by status of a project.
- Language: Go
- Framework: Gin
- Database: PostgreSQL
- Documentation: Swagger
- CI/CD: GitHub Actions
Check the files with the linter
golangci-lint run ./...To correct the .go files following the GO convention, using the linter
go fmt ./...Run all tests and validate the coverage
go test -v -coverprofile=coverage.out -covermode=atomic ./...