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.
A demonstration can be found at https://demo.lr-agenceweb.fr
# htpassword protection
Login: demo
Password: 6c40a98438
Install Foreman
Install Maildev
Install Memcached
Clone it: git clone git@github.com: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 !
Technology | Description |
---|---|
This project use puma in local development. The server is launched using foreman start |
|
|
It use MySQL2 but you can choose to use PostgreSQL , SQlite or MariaDB . To create a dump of your database, run rake db:backup |
It use Slim template to write HTML views. | |
Style is writting in scss and sass (using libsass) Scripts are created in coffeescript |
|
Caching is handled by memcached with Dalli |
|
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 |
Capistrano is used for an easy deploy to a private VPS |
- Color Routes: colored version of rake routes (run
rake color_routes
)
-
Core
cap <env> core:upload:yml
: Upload yml configuration files such as application, database, secrets, sitemap, ...cap <env> core:upload:dkim
: Upload DKIM private keycap <env> core:upload:missing
: Upload default pictures when missing or unavailable paperclip model objectscap <env> core:upload:all
: Execute all previous commands in one task
-
Nginx/Puma
cap <env> nginx:start
: Start Nginx servercap <env> nginx:stop
: Stop Nginx servercap <env> nginx:restart
: Retart Nginx servercap <env> nginx:reload
: Reload Nginx servercap <env> nginx:status
: Get current Nginx statuscap <env> puma:config
: Upload puma config filecap <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 filecap <env> backup:upload:model
: Upload model file corresponding to a databasecap <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 stylescap <env> paperclip:refresh:missing
: Regenerate only missing Paperclip styles
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. |
A big thanks to Grafikart for all his amazing tutorials !
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request