- Ruby MRI 2.7.x (rbenv recommended)
- Bundler
- Rails 6.x
- Postgres 9.5+ configuration file
- ImageMagick(for thumbnails)
rbenv install
gem install bundler
Clone repository.
# Install and configure db
$ bundle install
$ bundle exec rails db:create
$ bundle exec rails db:migrate
# Add static pages
$ bundle exec rails db:seed
# Launch app
$ bundle exec rails s
ReCaptcha is disabled in development. Configure key if needed using RECAPTCHA_SECRET_KEY
and RECAPTCHA_SITE_KEY
.
Within a Rails console:
bundle exec rails console
Admin.create(name: 'myname', email: '[email protected]', password: 'mypassword')
Admin section is reachable at /admin
.
To setup frontend, see readme in ./frontend
.
Configure your reCaptcha keys as environment variables
- Start server via Docker Compose
$ cd /path/to/mersea
$ docker-compose up -d
Feel free to modifies the provided docker-compose.yml to your needs.
- Start a Rails console
# mersea_mersea_1 is the container name defined by docker-compose
$ docker exec -it mersea_mersea_1 bundle exec rails c
To set any environment variable in the container, use one or more -e
flags:
JWT_SECRET
→ the JWT secretMERSEA_NAMESPACE
→ namespace the urlRAILS_SERVE_STATIC_FILES
→ the webapp serves all the assets instead of NGINXMERSEA_DATABASE_POOL
→ database connection pool sizeMERSEA_DATABASE_HOST
→ database host (IP address or URL)MERSEA_DATABASE_PORT
→ database port (by default 5432)MERSEA_DATABASE_USERNAME
→ database credentialMERSEA_DATABASE_PASSWORD
→ database credentialRECAPTCHA_SITE_KEY
→ Google reCaptcha keyRECAPTCHA_SECRET_KEY
→ Google reCaptcha secretBUGSNAG_API_KEY
→ Bugsnag key (leave empty to disable error reporting)
# Configure .env file with datagouv credentials
bundle exec rake datagouv
MIT. See the LICENSE for more details.
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Ensure specs and Rubocop pass
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
We would like to thanks the following companies for their open source plans and support
Thanks to all the open source tools we are using to make our application (gemfile, package.json)