Backend service for the Simple Retro website. This API provides endpoints for managing retrospectives, including creating and managing retrospective sessions, questions, answers, and real-time updates via WebSocket.
To run Simple Retro API, you need to have Golang in your machine
- 🧹 Clone the repository
git clone git@github.com:simple-retro/backend.git- 💻 Installing the dependencies
go get .- 📝 Set up environment variables
Copy the test environment file to create your local .env file:
cp config/test.env config/.env- 🏃♂️ Running
go run main.goInstall swaggo if not installed in your system:
go install github.com/swaggo/swag/cmd/swag@latestTo update Swagger documentation run:
swag init -g internal/server/server.goTo format Swagger comments:
swag fmtThe documentation could be accessed in /swagger/index.html
To deploy the Simple Retro API, use Docker image.
docker build -t backend:<version> .docker compose up -dRun unit tests with:
go test -v $(go list ./... | grep -v /integration_test)Integration tests require the service to be running first.
- Start the service:
go run main.go- In another terminal, run the integration tests:
API_BASE_URL=http://127.0.0.1:8080 go test -v ./integration_test/...You can use act to test GitHub Actions locally.
For unit tests:
act -j unit-testsFor integration tests, you need to use the --bind flag:
act -j integration-tests --bindDistributed under the MIT License. See LICENSE for more information.