Skip to content

The Idea Portal that will make its debut for HackBaltimore.io 2020

License

Notifications You must be signed in to change notification settings

jarahameador/IdeaPortal

 
 

Repository files navigation

IdeaPortal

Build Status

Welcome to the IdeaPortal for HackBaltimore.io

Requirements

Install & Setup

Requirements

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

IdeaPortal Setup

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

reCAPTCHA

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: "..."

File Uploads

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 key
  • AWS_SECRET_ACCESS_KEY - IAM access secret key
  • AWS_BUCKET - bucket that the IAM user has read and write permissions to

Testing

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.

Learn more about Phoenix

About

The Idea Portal that will make its debut for HackBaltimore.io 2020

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 43.7%
  • CSS 35.5%
  • HTML 18.6%
  • JavaScript 2.2%