This repository contains the source code for the Learning Junkie REST API.
- Haskell
- Servant (API)
- Beam (DB)
- PostgreSQL (DB)
- Lucid (Certificate Generation)
- Amazon S3 (Storage)
- MinIO (Storage, local environment)
- Docker
- GitHub Actions (CI/CD)
First and foremost, clone the repository on your local machine:
$ git clone https://github.com/junkidesu/learning-junkie-apiTo 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 database and Amazon S3 for storage. Thus, a running PostgreSQL server (either local or remote), as well as a publicly readable Amazon S3 Bucket, are required.
Because spinning up an Amazon S3 bucket can be a little tedious, it is also possible to use a MinIO bucket on your local machine. In fact, MinIO is included as a service in the docker-compose.dev.yml file.
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
$ learning-junkie-api-exeYou may start the application along with a local PostgreSQL server and a local MinIO bucket using Docker Compose.
$ docker compose -f docker-compose.dev.yml upYou still need to supply the necessary environment variables, though.
When the server is started on the local machine, documentation is available at http://localhost:3003/swagger-ui (you might need to change the port).
For the application running in production, the Swagger documentation of the API is available at https://learning-junkie-api-main.onrender.com/swagger-ui.