Skip to content

Application for the management of a personal library, programmed in Elixir.

Notifications You must be signed in to change notification settings

silviaherguedas/library_elixir

Repository files navigation

My Library

Application for the management of my personal library.

My first application written in Elixir with Phoenix web framework using and Docker.

Usage

To start the container and bring up Phoenix server

  1. Create the .env file. To do this, rename the file .env.dist
  2. If necessary, change the docker output ports. You are using "4020:4020" for Phoenix Server and "5434:5432" for Postgres (check these files: docker-file.yml and .env).
  3. Follow these steps:
# a. To build the container and install all the dependencies,
# create the database and run the migrations with the real data load,
# we must launch this script:
./docker_up.sh

# b. Access the container, from the console
docker exec -ti doofinder_phoenix_1 bash

# b.1. Assign permissions for the local user
chown -R 1000:1000 _build/
chown -R 1000:1000 deps/

# b.2. Install Npm dependencies
mix do deps.compile, phx.digest
  1. Now, you can visit localhost:4020 from your browser.
  2. To access the tool, you need to register on the platform.

Other Uses

When building the container, an alias "mix" is created to facilitate the execution of Elixir commands, so that "mix" can be invoked directly to execute commands inside the container:

alias mix="docker-compose run --rm phoenix mix"

To install project dependencies and perform other setup tasks

# Without alias
docker-compose run --rm phoenix mix setup

# With alias
mix setup

To launch the migrations and populate the database with real data

# Without alias
docker-compose run --rm phoenix mix ecto.setup

# With alias
mix ecto.setup

To run the tests, issue the following command

# Without alias
docker-compose run --rm -e MIX_ENV=test phoenix mix test

# With alias
MIX_ENV=test mix test

To enter the container console, run

docker exec -ti doofinder_phoenix_1 bash

To stop and delete the container

docker-compose down

To restart the container, run

docker-compose restart

To start the database server use

psql -U postgres

Learn more

About

Application for the management of a personal library, programmed in Elixir.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published