Coder Social home page Coder Social logo

ssimo7 / reso Goto Github PK

View Code? Open in Web Editor NEW

This project forked from betagouv/conseillers-entreprises

0.0 1.0 0.0 10.83 MB

Rapprocher les Entreprises des Solutions publiques Optimales

Home Page: https://reso.beta.gouv.fr

Ruby 83.40% JavaScript 0.37% CoffeeScript 0.18% CSS 2.36% HTML 13.69%

reso's Introduction

RéSo

Apporter l’ensemble des aides publiques aux entreprises qui en ont besoin. reso.beta.gouv.fr

Créé dans le contexte de l’incubateur des startups d’état.

Getting started

  1. Clone the repository.

     $ git clone [email protected]:betagouv/reso.git
     $ cd reso
    
  2. Install Ruby using rbenv. See .ruby-version file to know which Ruby version is needed.

     $ brew install rvm
     $ rbenv install
    
  3. Install PostgreSQL and create a user if you don’t have any.

     $ brew install postgres
    

    Create a PostgreSQL user (replace my_username and my_password).

     $ psql -c "CREATE USER my_username WITH PASSWORD 'my_password';"
    

    Or:

     $ postgres createuser my_username
    
  4. Create config/database.yml file from config/database.yml.example. Fill development and test sections in the latter with your PostgreSQL username and password.

     $ cp config/database.example.yml config/database.yml
    
  5. Install project dependencies (gems) with bundler.

     $ gem install bundler
     $ bundle
    
  6. Execute database configurations for development and test environments.

     $ rake db:create db:migrate
     $ rake db:create db:migrate RAILS_ENV=test
    
  7. Create .env file from .env.example, and ask the team to fill it in.

     $ cp .env.example .env
    
  8. You can now start a server.

     $ gem install foreman
     $ foreman start --procfile=Procfile.dev
    

    And yay! Reso is now running locally!

Tests

  • bin/rspec : Rspec tests
  • rake lint:
    • rake lint:rubocop : ruby files code style
    • rake lint:haml : haml files code style
    • rake lint:i18n : i18n missing/unused keys and formatting
    • rake lint:brakeman : static analysis security vulnerability

Development data

You can import data in your local development database from remote staging database. See the official documentation, Make sure Scalingo CLI is installed.

  1. Dump data from staging or production environments:
scalingo -a reso-staging db-tunnel SCALINGO_POSTGRESQL_URL
# In another terminal
scalingo -a reso-staging env | grep POSTGRESQL # gives you the database password
pg_dump --no-owner --no-acl reso_stagin_5827 > tmp/export.pgsql  -h localhost -p 10000 -U reso_stagin_5827 -o
scalingo -a reso-production db-tunnel SCALINGO_POSTGRESQL_URL
# In another terminal
scalingo -a reso-production env | grep POSTGRESQL # gives you the database password
pg_dump --no-owner --no-acl e_conseils_2947 > tmp/export.pgsql  -h localhost -p 10000 -U e_conseils_2947 -o
  1. Import the dump in the local database:
rake db:drop db:create
psql reso-development -f tmp/export.pgsql -U postgres
rake db:migrate # If your local app has pending migrations
rake db:environment:set RAILS_ENV=development # If you imported data from the production environment

Emails

Development and staging emails are sent on Mailtrap in order to test email notifications without sending them to the real users. Ask the team for credentials.

Deployment

Reso is deployed on Scalingo, with two distinct environment, reso-staging and `reso-production.

GitHub->Scalingo hooks are setup for auto-deployment:

  • The master branch is automatically deployed to the reso-staging env.
  • The production branch is automatically deployed to the reso-staging env.

Additionally, a postdeploy hook is setup in the Procfile so that Rails migrations are run automatically.

In case of emergency, you can always run rails migrations manually using the scalingo command line tool.

$ scalingo -a reso-staging run rails db:migrate
$ scalingo -a reso-production run rails db:migrate 

Contributing

Please read CONTRIBUTING.md for details on our git and coding conventions, and the process for submitting pull requests to us.

reso's People

Contributors

n-b avatar arnoholo avatar apemb avatar gregoirenovel avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.