Website to share our worlds - "Partageons nos monde"
Ensemble is a website that makes people from different cultures meet and make things together.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. -> TODO
- ruby 2.4.2
- rails 5.1.2
- postgresql
You need first to have docker & docker-compose installed.
cp config/database.docker.yml config/database.yml
# you may have to start docker commands with `sudo` (depending on how you did install docker)
# build app via docker compose
docker-compose build
# on first install, create the database, apply migrations and data seeds
docker-compose run web rake db:setup
# you may need to install yarn packages
docker-compose run web yarn
docker-compose up
# Ctrl + C to exit
You need first to have postgresql installed and running on your OS
git clone [email protected]:clairezed/rails-starter.git
cd rails-starter
bundle install
yarn install
Database configuration :
cp config/database_example.yml config/database.yml
# Update database.yml to cope with your own database connection credentials
sudo -i -u postgres
psql
create role XXX with createdb login password 'XXX';
# Ctrl + D to exit
bin/rake db:setup
bin/rake db:seed
rails server
Your website should be accessible at localhost:3000.
Email notifications are caught by MailCatcher in development. Install it globally (outside of your project folder) if you haven't yet : gem install mailcatcher
Start the service outside of your project folder : mailcatcher
Then, open your web browser at localhost:1080 to access the MailCatcher interface.
If you had a standard rails application and have to shut down a few services to have docker run :
# stopping mailcatcher
lsof -i :1080
kill [mailcatcher PID]
# stopping postgresql
sudo service postgresql stop
Start the dev server
docker-compose up
Application is available at localhost:3000. Mailcatcher is available at localhost:1080.
Start a rails console in another terminal
docker-compose run web rails console
Stop the application and remove all the containers
docker-compose down
volumes defined in
docker-compose.yml
are persisted
The app uses bundler as ruby dependencies manager and yarn
as a javascript dependencies manager.
Update the gems after editing the Gemfile
docker-compose run web bundle install
docker-compose up --build
For javascript
```
# add to 'dependences' group
docker-compose run web yarn add <package-name>
# add to 'devDependencies' group
docker-compose run web yarn add <package-name> --dev
```
This project uses yarn
as a javascript dependencies manager.
# add to 'dependences' group
yarn add <package-name>
# add to 'devDependencies' group
yarn add <package-name> --dev
Exemple : yarn add jquery
Then, in app/assets/javascripts/application.js.coffee
, add #= require jquery
Foreman vous permettra de démarrer serveur et delayed job à la fois
foreman start -f Procfile.dev
rake db:test:prepare
RAILS_ENV=test rake db:setup RAILS_ENV=test bin/rake db:seed bundle exec rspec
The project could clearly have more tests. Don't hesitate to contribute, I'll be happy to help !
There's a .travis.yml
file to integrate with Travis CI.
Explain what these tests test and why -> TODO
- rubocop : based on ruby style guide, but relaxed. The aim is first to get rid of
rubocop_todo.yml
, then go toward stricter style guide if needed. - bullet : config in
config/environments/development.rb
- don't forget to change Admin password in production if you run the seeds.
- Bootstrap4 - alpha6
- back office inspired by Modular Admin
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us. -> TODO
We use SemVer for versioning. For the versions available, see the tags on this repository. -> TODO
- Claire Zuliani - front end / back end github account
- Gabriel Loisy - design github account
This project is licensed under the AGPL 3.0 License - see the LICENSE.md file for details
- back office inspired by https://github.com/modularcode/modular-admin-html
CSS style rules :
a parent can effect styles on its (direct) children only outside the border of the component. That means properties related to positioning and dimensions (e.g. position, margin, display, width, float, z-index etc) are OK, while properties that reach inside the border (e.g. border itself, padding, color, font etc) are a no-no.
Due to sass-rails helper font-url
, couldn't find for now an other way to have it work than :
yarn add font-awesome
Copy node_modules/font-awesome/fonts/
to app/assets/fonts
.
Add @import "font-awesome/scss/font-awesome"
in app/assets/stylesheets/administration.sass
.
Change node_modules/font-awesome/scss/_path.scss
to :
@font-face {
font-family: 'FontAwesome';
src: font-url('fontawesome-webfont.eot?v=#{$fa-version}');
src: font-url('fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'),
font-url('fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'),
font-url('fontawesome-webfont.woff?v=#{$fa-version}') format('woff'),
font-url('fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'),
font-url('fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg');
// src: font-url('FontAwesome.otf') format('opentype'); // used when developing fonts
font-weight: normal;
font-style: normal;
}
Create app/assets/stylesheets/shared/fa-font-path-override.sass
:
$fa-font-path: "font-awesome/fonts/" !default
Add it in your sass manifest, before font-awesome :
@import "shared/fa-font-path-override"
@import "font-awesome/scss/font-awesome"
source : sheerdevelopment.com/posts/using-yarn-with-rails
If problems in prod : https://blog.ronaldchacon.com/rails-5-1-yarn-webfonts-and-sass
- Open source license : MIT, Apache 2.0, and GPLv3
- README :
- What does this project do?
- Why is this project useful?
- How do I get started?
- Where can I get more help, if I need it?
- Contributing guidelines
- How to file a bug report (try using issue and pull request templates)
- How to suggest a new feature
- How to set up your environment and run tests
- Code of conduct
- https://github.com/mattbrictson/rails-template
- https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-rails/lib/rails/templates
- https://github.com/spree/spree/tree/master/cmd
-> Vérifier la présence de "TODO" dans le code
- régler le slideToggle 'open' du submenu
Receive sms in dev thanks to ngrok
./ngrok http 3000
Then configure twilio phone number https://www.twilio.com/console/phone-numbers/incoming with http://XXXXXXXX.ngrok.io/sms_notifications
Clear down the old Containers and Images
docker rm $(docker ps -a -q)
docker rmi $(docker images -q)
Bind for 0.0.0.0:5432 failed: port is already allocated
Solution :
sudo service docker restart