This is the codebase for the Graasp platform written in Elixir using the Phoenix web framework
This project was generated with phoenix version 1.8.0
This project uses mise.
Install all dependencies with (installs elixir and erlang):
mise iInstalling Elixir with brew (not recommended)
You will need Elixir and OTP installed.
On MacOS simply run: brew install elixir
For installation instructions refer to the elixir installation guide
You can test you installation by running elixir -v. It should output something like:
Erlang/OTP 28 [erts-16.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit] [dtrace]
Elixir 1.18.4 (compiled with Erlang/OTP 27)Also install elixir-ls (one of) the Elixir Language server. With brew:
brew install elixir-lsYou will need a running PostgreSQL server.
This project is made to work with the postgresql server running in the devcontainer for the graasp/core project.
In case you do not want to use the devcontainer, you can use the following command to start a postgresql server:
docker run -d -p 5432:5432 \
-e POSTGRES_USER=postgres \
-e POSTGRES_DB=postgres \
-e POSTGRES_PASSWORD="postgres" \
--name postgres postgres:17.5-alpineWith a graphical client like Postgres.app on MacOS.
- Ensure you have Elixir installed (
elixir -vshould show you the version) - Install project dependencies with:
mix setup - Start you Phoenix server:
- Run
mix setupto install and setup dependencies - Start Phoenix endpoint with
mix phx.serveror inside IEx withiex -S mix phx.server
- Run
- Create a
.env.shfile with the following content. Use the values you get from configuring garage in the core project:You will need to source this file in your shell before starting the server:# .env.sh export AWS_ACCESS_KEY_ID=GK3b... export AWS_SECRET_ACCESS_KEY=a03cf77e181... export AWS_DEFAULT_REGION=garage
Now you can visitsource .env.shlocalhost:4000from your browser.
The application is deployed using ECS. The deployment process is handled by the graasp/infrastrucutre repository. It is in charge of registering the service and starting the tasks with the proper environment variables. This repo simply builds the docker images and pushes them to the private ECR registry.
Please checkout the setup docs for more information on how to bootstrap a server to deploy your app in production.
Checkout the memento for an overview of helpful commands for managing the project (deployment and development).
If you made a release localy it is possible that you end-up with a lot of files in the priv/static/ folder.
Before committing, run: mix phx.digest.clean --all to clean them.