Skip to content

lr-agenceweb/rails-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Circle CI Travis CI CodeClimate Test Coverage

Security Hakiri Gemnasium Licence MIT

Rails Starter

This project has been built to increase speed when creating a new application:
it's annoying to reconfigure always and always the same gems so this starter pack comes with
plugins already configured such as activeadmin, devise, globalize, and many others.

Rails starter version Ruby version Rails version

Demo

A demonstration can be found at https://demo.lr-agenceweb.fr

# htpassword protection
Login: demo
Password: 6c40a98438

Requirements

Install Foreman
Install Maildev
Install Memcached

Usage

Clone it: git clone [email protected]:lr-agenceweb/rails-starter.git
Duplicate .env.example, rename it in .env and set correct values
Duplicate application.example.yml and rename it in application.yml
Duplicate database.example.yml and rename it in database.yml
Setup your environment variable (database, secret key, devise key, ...)
Go to the application folder: cd rails-starter
Install gems: bundle install
Create database: rake db:create
Load schema: rake db:schema:load
Seed datas: rake db:seed
Run foreman start
Visit http://localhost:3000
That's it !

Stack

Technology Description
Server This project use puma in local development.
The server is launched using foreman start
SGBD
SGBD
It use MySQL2 but you can choose to use PostgreSQL, SQlite or MariaDB.
To create a dump of your database, run rake db:backup
Template It use Slim template to write HTML views.
Assets Style is writting in scss and sass (using libsass)
Scripts are created in coffeescript
Cache Caching is handled by memcached with Dalli
Mail It use maildev NodeJS package to test emails in local.
You don't have nothing to do, maildev server will be launched in the same time as the rails server with foreman start.
To see your mails, visit http://localhost:1080
Units Tests Vanilla rails tests are included, just run rake test
Code structure This project follow most of Rubocop rules
Deploy Capistrano is used for an easy deploy to a private VPS

Tasks

Rails

  • Color Routes: colored version of rake routes (run rake color_routes)

Capistrano

  • Core

    • cap <env> core:upload:yml : Upload yml configuration files such as application, database, secrets, sitemap, ...
    • cap <env> core:upload:dkim : Upload DKIM private key
    • cap <env> core:upload:missing : Upload default pictures when missing or unavailable paperclip model objects
    • cap <env> core:upload:all : Execute all previous commands in one task
  • Nginx/Puma

    • cap <env> nginx:start : Start Nginx server
    • cap <env> nginx:stop : Stop Nginx server
    • cap <env> nginx:restart : Retart Nginx server
    • cap <env> nginx:reload : Reload Nginx server
    • cap <env> nginx:status : Get current Nginx status
    • cap <env> puma:config : Upload puma config file
    • cap <env> puma:nginx_config : Upload puma vhost config file
  • Database backup (needs Backup gem to be installed)

    • cap <env> backup:upload:config : Upload backup parent config file
    • cap <env> backup:upload:model : Upload model file corresponding to a database
    • cap <env> backup:upload:all : Upload both config and model files
  • Logrotate

    • cap <env> logrotate:upload : Upload logrotate config file
  • Paperclip

    • cap <env> paperclip:refresh:all : Regenerate all Paperclip styles
    • cap <env> paperclip:refresh:missing : Regenerate only missing Paperclip styles

Modules

Name Description
Newsletter In order to avoid spam email when sending newsletter to subscribers, you will need to sign your email address using SPF and DKIM keys and linked them to your DNS.
Be sure to generate a dkim.private.key and dkim.public.key and move the dkim.private.key in config/dkim folder.
Blog Write blog articles.
Slider Add a slider on the page you want and customize its options.
Comment Add comments for posts or blogs articles.
Guest Book Allow users (connected or not) to leave a message in the guest book.
Event Create events (with start date and end date)
Map Display a Mapbox map of your organization or business
Social Network Display social networks icons to share your site or let users to follow you on this networks
Breadcrumb Show a breadcrumb on the page of your site
Video Upload your own videos or add it from video platform such as Youtube or Dailymotion
Calendar Choose start date and end date for your Events
Background Display a background image for your pages
QrCode Show a contact QrCode on the website
Adult Display a popup the first time you access the website to inform you than you must be over 18 to continue your visit
RSS Add a RSS feed to the website
Search Add a search form to look on title or content post articles
Mailing Application developped to send heavy mails number to users
SocialConnect Allow users to LINK their ALREADY EXISTING Devise account to Facebook, Twitter or Google Social Connect.
Audio Upload audio files and play them in an HTML5 player.

Screenshots

Frontend

Frontend example

Backend

Activeadmin Dashboard example

Thanks

A big thanks to Grafikart for all his amazing tutorials !

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request