Welcome to the IdeaPortal for HackBaltimore.io
- PostgreSQL 10 - database
- Elixir 1.8 - server language
- Erlang 21.2 - server language
- node.js 11.13 - front end language
Install PostgreSQL according to your OS of choice, for MacOS Postgres.app is recommended.
To install Elixir, Erlang, and NodeJS it is recommended to use the asdf version manager. Install instructions are copied here for MacOS, for other OSs see asdf docs. This also assumes you have HomeBrew installed.
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.0
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bash_profile
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bash_profile
brew install \
coreutils automake autoconf openssl \
libyaml readline libxslt libtool unixodbc
Once asdf is set up, install each language. NodeJS may require setting up keys, and should display help to guide you.
asdf plugin-add erlang
asdf install erlang 21.2.5
asdf plugin-add elixir
asdf install elixir 1.8.0
asdf plugin-add nodejs
bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
asdf install nodejs 11.13.0
Start with cloning the application. Once cloned, in your terminal run the following commands inside the cloned folder.
mix local.hex --force
mix local.rebar --force
mix deps.get
mix compile
This sets up your basic elixir environment. Next setup the database. The following commands will create and migrate locally.
mix ecto.create
mix ecto.migrate
If required, you can create the file config/dev.local.exs
and include local PostgreSQL connection information. It will look like (replacing with your local configuration):
use Mix.Config
config :idea_portal, IdeaPortal.Repo,
username: "postgres",
password: "postgres",
database: "idea_portal_dev",
hostname: "localhost",
pool_size: 10
Once the database is setup, you can run the server.
mix phx.server
Keys need to be set up to properly verify reCAPTCHA tokens. You will need a secret key and site key to properly verify. In development and test this is disabled.
config :idea_portal, :recaptcha,
module: IdeaPortal.Recaptcha.Implementation,
secret_key: "...",
key: "..."
In development, local file storage is used. In production, file uploads are stored in S3.
Environment variables required for upload on production:
AWS_ACCESS_KEY_ID
- IAM access keyAWS_SECRET_ACCESS_KEY
- IAM access secret keyAWS_BUCKET
- bucket that the IAM user has read and write permissions to
The IdeaPortal runs each pull request (and every commit on the master
branch) through CI. Make sure to add tests as you extend the application. We also run Credo and the built in formatter in CI to ensure code quality.
- Official website: http://www.phoenixframework.org/
- Guides: https://hexdocs.pm/phoenix/overview.html
- Docs: https://hexdocs.pm/phoenix
- Source: https://github.com/phoenixframework/phoenix