-
Notifications
You must be signed in to change notification settings - Fork 522
Development Setup
Papercups runs on Elixir/Phoenix, with a TypeScript React app for the frontend.
First, you'll need to install the following:
- Install PostgreSQL
- Install Node
- Install asdf
- Install Erlang dependencies
Once that's all set, clone the repo:
git clone [email protected]:papercups-io/papercups.git
cd papercups
And install all our dependencies:
asdf install
mix local.hex
mix deps.get
npm install --prefix=assets # cd assets && npm install
mix ecto.setup
mix phx.server # or `iex -S mix phx.server` for interactive mode
If you haven't installed Elixir, Phoenix, NodeJS, and PostgresQL yet, you can find some great instructions here: https://hexdocs.pm/phoenix/installation.html
tl;dr:
- Install Elixir: https://elixir-lang.org/install.html
- Install Hex:
mix local.hex
- To check that we are on Elixir 1.6 and Erlang 20 or later, run:
elixir -v
Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Elixir 1.6.3
- Install the Phoenix application generator:
mix archive.install hex phx_new 1.5.4
- Install NodeJS: https://nodejs.org/en/download/
- Install PostgresQL: https://wiki.postgresql.org/wiki/Detailed_installation_guides
git clone [email protected]:papercups-io/papercups.git
cd papercups
- Install backend dependencies with
mix deps.get
- Install frontend dependencies with
npm install --prefix=assets
(orcd assets && npm install
) - Create and migrate your database with
mix ecto.setup
- Start the server with
mix phx.server
(oriex -S mix phx.server
for interactive mode)
This will automatically start up the React frontend in watch mode on localhost:3000
, with the API running on localhost:4000
.
The frontend code will start up automatically when you run mix phx.server
, but for more information see: assets/README.md
You can edit your local code when developing with docker and it will update in the container.
The docker file is made for development only at the moment
docker build -t papercups . && docker-compose up
Create a PostgreSQL test database named: chat_api_test
, and run:
mix test
Set the environment variables in the .env.example
file.
At the moment we only support Mailgun — other messaging channels are coming soon!
We currently use Heroku for deployments. (This is for internal use only.)
git push heroku master