Skip to content

simple-retro/backend

Repository files navigation

👨‍💻 Simple Retro

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.

🔥 | Running the project

To run Simple Retro API, you need to have Golang in your machine

  1. 🧹 Clone the repository
git clone git@github.com:simple-retro/backend.git
  1. 💻 Installing the dependencies
go get .
  1. 📝 Set up environment variables

Copy the test environment file to create your local .env file:

cp config/test.env config/.env
  1. 🏃‍♂️ Running
go run main.go

📖 Swagger

Install swaggo if not installed in your system:

go install github.com/swaggo/swag/cmd/swag@latest

To update Swagger documentation run:

swag init -g internal/server/server.go

To format Swagger comments:

swag fmt

The documentation could be accessed in /swagger/index.html

📦 Buiding for production

To deploy the Simple Retro API, use Docker image.

docker build -t backend:<version> .
docker compose up -d

🧪 | Running Tests

Unit Tests

Run unit tests with:

go test -v $(go list ./... | grep -v /integration_test)

Integration Tests

Integration tests require the service to be running first.

  1. Start the service:
go run main.go
  1. In another terminal, run the integration tests:
API_BASE_URL=http://127.0.0.1:8080 go test -v ./integration_test/...

Testing with Act

You can use act to test GitHub Actions locally.

For unit tests:

act -j unit-tests

For integration tests, you need to use the --bind flag:

act -j integration-tests --bind

⚖️ | License

Distributed under the MIT License. See LICENSE for more information.


About

Simple Retro Website API

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •