A simple REST API written with the Servant web framework. In older versions, SQLite was used as the DB for sake of simpicity (sqlite-simple). The project was re-written to use Beam.
- Haskell
- Servant (API)
- PostgreSQL (DB)
- Beam (Interaction with the DB)
- Docker
- Minio (Storage)
- GitHub Actions (CI/CD)
To build and run the application locally, ensure that the following are installed:
Stack and Cabal can be installed either independently or with the GHCup tool.
The application uses PostgreSQL for the DB and Minio for storage. Thus, running instances of PostgreSQL and Minio are required (either local or remote).
See .env.sample to see the environment variables that must be set. You can either place them in a .env file, or supply them directly to the executable.
At the root of the repository, run the following:
$ stack install
$ phonebook-exeYou may start the application along with a local PostgreSQL server using Docker Compose.
$ docker compose -f docker-compose.dev.yml upYou still need to provide the necessary environment variables, though.
Once the application is started, the Swagger documentation of the API is available locally at http://localhost:3003/swagger-ui.