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.
- Clone the repo
git clone https://github.com/ClaperCo/Claper.git- Go to the project directory
cd Claper- Run Docker compose
docker compose -f compose.dev.yml up- Initialize the database
With the containers running, open another terminal in the project directory and run:
docker compose -f compose.dev.yml exec app mix ecto.setupThis 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.
- Clone the repo
git clone https://github.com/ClaperCo/Claper.git- Go to the project directory
cd Claper- Configure your environment variables
cp .env.sample .envEdit the .env file to match your configuration.
- Install dependencies
mix deps.get- Initialize the database
./with_env.sh mix ecto.setupThis command loads the database configuration from .env, creates and migrates the database, and runs the seed script.
- Install JS dependencies
cd assets && npm i- Start the Phoenix endpoint
./with_env.sh mix phx.serverDatabase
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.