Skip to content

Development Environment

If you want to contribute to Claper, you can set up a development environment on your machine.

Setting up a development environment

Docker setup

To set up a development environment with Docker, you need to have Docker installed on your machine.

  1. Clone the repo
sh
git clone https://github.com/ClaperCo/Claper.git
  1. Go to the project directory
sh
cd Claper
  1. Run Docker compose
sh
docker compose -f compose.dev.yml up
  1. Initialize the database

With the containers running, open another terminal in the project directory and run:

sh
docker compose -f compose.dev.yml exec app mix ecto.setup

This command creates the database if needed, runs all migrations and seeds the default administrator account (admin@claper.co / claper). Change this password after your first login.

Manual setup

To set up a development environment, you need to have the prerequisites installed on your machine.

  1. Clone the repo
sh
git clone https://github.com/ClaperCo/Claper.git
  1. Go to the project directory
sh
cd Claper
  1. Configure your environment variables
sh
cp .env.sample .env

Edit the .env file to match your configuration.

  1. Install dependencies
sh
mix deps.get
  1. Initialize the database
sh
./with_env.sh mix ecto.setup

This command loads the database configuration from .env, creates and migrates the database, and runs the seed script.

  1. Install JS dependencies
sh
cd assets && npm i
  1. Start the Phoenix endpoint
sh
./with_env.sh mix phx.server

Database

You need a PostgreSQL database running on your machine. You can run it with a Docker container: docker run -p 5432:5432 -e POSTGRES_PASSWORD=claper -e POSTGRES_USER=claper -e POSTGRES_DB=claper --name claper-db -d postgres:15.


Now you can visit localhost:4000 from your browser.

If you have configured MAIL environment variable to local, you can access to the mailbox at localhost:4000/dev/mailbox.