Artemis can be used to jump-start a new web application.
Artemis supports both local and containerized development. Regardless of which is used, the following common setup steps should be followed.
Fork the code repository and pull down the latest with git clone <PATH_TO_FORKED_REPOSITORY>
.
Create a custom .env
file:
cp .env.example .env
Review the environment file and follow commented documentation to populate the required values:
vim .env
Artemis runs a development webserver on a local port. The default port is specified in the .env
file, but can be changed.
For websocket support, Artemis must be reachable through local DNS at https://artemis.dev
. A local DNS manager with SSL support like Puma Dev makes this easy.
If using Puma Dev, this can be accomplished by creating a new puma dev config file:
source .env
echo $ARTEMIS_WEB_PORT > ~/.puma-dev/artemis
echo $ARTEMIS_API_PORT > ~/.puma-dev/artemis-api
A container-based development environment is available using docker and docker compose. Once the docker platform is installed, build and run the containers:
bin/docker-dev/build dev
bin/docker-dev/up
Artemis requires a specific version of Elixir. The version is always specified in .env.example
.
An Elixir version manager like asdf
for elixir
or kiex
can make it easy to manage multiple Elixir versions in the same development environment.
Artemis requires a specific version of NodeJS. The version is always specified in .env.example
.
A Node version manager like asdf
for node
or nvm
can make it easy to manage multiple Node versions in the same development environment.
Artemis requires PostgreSQL >= 9.6.
It can be run inside a docker container or installed locally on the command-line using brew install postgresql
or with a standalone application like Postico.
Artemis requires headless chrome for browser-based testing.
It can be installed locally on the command-line using brew cask install chromedriver
.
Before running the application the first time, execute bin/local/reset-all
.
Warning: The bin/local/reset-all
script is destructive. It will drop current dependencies and pull down the latest, and it will drop databases and recreate them with seed data.
If not running already, start an instance of the development environment:
bin/docker-dev/up
Then execute the tests using:
bin/docker-dev/test
Comprehensive unit tests are included in Artemis. To run them use:
bin/local/test <app> <file>:<line-number>
For example:
bin/local/test # Run all tests on all applications
bin/local/test artemis_web # Only run tests for artemis_web application
bin/local/test artemis_web test/artemis_web/controllers/feature_controller_test.exs:14 # Only run a specific test
Or if you prefer to use mix test
directly, make sure environmental variables are exported first:
$ set -a && source .env && set +a
$ mix test
Before running browser tests, start the headless chrome server with chromedriver --headless
.
By default, browser tests are only run in the CI environment. To run them use:
mix test --include browser