- Remove assets/node_modules from within your existing container
- Run
npm install
within the assets folder, also from within the docker container
- Docker
- Docker Compose
- Clone this repo
cd Litelist
chmod +x run.sh
- Make sure ports 4000 and 5432 (postgres) are free. Run
brew services stop postgresql
on Mac. docker-compose up --build
docker-compose run web mix test
to run tests.- Note that it takes Webpack about 10 seconds to load js and css. We will work to improve this in the future.
docker-compose run web iex -S mix
import Litelist.Factory
attrs = %{username: "ADD_NAME_HERE"}
Note: Don't change the password attr. The password will default to 'password'.insert(:neighbor, attrs)
- Go to localhost:4000 and login with credentials created from above
- localhost:4000/secret can only be seen by authenticated users
Note: See Docker usage below for more commands.
Run commands prepended with docker-compose run web
mix ecto.migrate
becomes docker-compose run web mix ecto.migrate
mix ecto.migrate
becomes docker-compose run web mix ecto.migrate
Amnesia is an elixir wrapper around erlang's Mnesia database.
This database is used for settings because it has a stronger guarantee that it will be read than postgres has. As long as the site is up, the Mnesia SettingsDatabase should be available.
Note: Setup should be automatically handled in run.s
docker-compose run web mix amnesia.create --database Litelist.Settings.SettingsDatabase --disk
docker-compose run web /bin/bash
mkdir mnesia
MIX_ENV=test mix amnesia.create --database Litelist.Settings.SettingsDatabase --disk
docker-compose run web mix ecto.rollback
docker-compose run web mix ecto.migrate
docker-compose run web mix ecto.seed
Seeds the databasedocker-compose run web mix test
docker-compose run web /bin/bash
MIX_ENV=test mix ecto.reset
Note: Reset test database after running the above command.docker-compose run web mix coveralls
docker-compose run web mix coveralls.detail
docker-compose run web mix credo -a
Credo is a static code analysis tool for the Elixir language with a focus on code consistency and teaching.docker-compose run web mix docs
Documents repo code. Check out docs/index.htmldocker-compose run web mix format FILENAME
Formats a file according to Elixir standardsdocker-compose run web mix amnesia.create --database Litelist.Settings.SettingsDatabase --disk
Create Mnesia databasedocrw mix amnesia.drop -d Litelist.Settings.SettingsDatabase
Drop Mnesia database
docker-compose run web mix deps.update postgrex
If you can't connect to the db