Skip to content

junkidesu/phonebook-servant

Repository files navigation

Phonebook API

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.

Technologies Used

Getting Started

Prerequisites

Build Tools

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.

Services

The application uses PostgreSQL for the DB and Minio for storage. Thus, running instances of PostgreSQL and Minio are required (either local or remote).

Environment Variables

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.

Build and Start Executable

At the root of the repository, run the following:

$ stack install
$ phonebook-exe

Start in Container

You may start the application along with a local PostgreSQL server using Docker Compose.

$ docker compose -f docker-compose.dev.yml up

You still need to provide the necessary environment variables, though.

Documentation

Once the application is started, the Swagger documentation of the API is available locally at http://localhost:3003/swagger-ui.

Releases

No releases published

Packages

 
 
 

Contributors