Mayak Rails Website Template
Mayak - is simple Rails application made for fast start of a common web-project. I called it 'site template' because rails 'application templates' already exist. Website template gives you major components of (almost) any website:
- admin panel
- arbitrary files upload
- pages managment
- seo parameters system
- navigation items
- feedback form
Mayak.io — project's website.
Software and coventions
Template based on Ruby 2.2.3 and use many brilliant ruby gems (check full list and versions in Gemfile):
- Ruby on Rails
- ActiveAdmin for admin panel
- CarrierWave for uploads
- Kaminari for pagination
- Autoprefixer for easy css
- Mina for deploy
Also we use:
And we respect humans.txt convention.
Get copy of code of this project (without git history).
Make sure that you have Ruby version installed, specified in
If you're using RVM, add '.ruby-gemset' file to the root of the application. More info.
replace module name from 'Mayak' to your project name;
set your timezone and default_locale;
Replace all secret keys in file
config/secrets.rb. You can use
bin/rake secretfor keys generation or some web-generators. You can use
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>for production if you need to hide production key from repo, but do not forget setup this ENV variable on server.
config/database.ymlfor database connection. There is
config/application.ymlfor app configuration management with Figaro gem. There is
default-hostsetting in the file
config/sitemap.rb(and do not forget about sitemap during development).
Setting up the mailer in
config/environments/production.rbfile, if you need to sending emails from site.
In the file
config.site_titlewith title of your site.
In the file
config/initializers/devise.rbreplace value of
In the file
config/initializers/session_store.rbreplace session key
_mayak_sessionwith your project key.
In the migration file of site settings (
db/migrate/20170307000002_create_settings.rb) you can change default settings values and add new settings. TODO
In the seeds file (
db/seeds.rb) you can change email and password of admin user. By default it email@example.com with password 'password'.
app/assets/browserslistfile and set settings you need for Autoprefixer.
Replace or remove LICENSE and UPDATE.md files.
When done, run:
$ bin/bundle install --without production $ bin/rake db:create db:migrate
Demo data you can install with command:
Else you want to remove demo data you need to: TODO.
Do not forget to change
public/favicon.ico and all icons
public/humans.txt with correct data
and uncomment correct lines in
public/robots.txt before publishing.
Your application ready for use.
You can launch webserver with command
bin/rails server and see a home page
at http://localhost:3000 url.
And, when you finish installation, replace content of this file with description about your project and other usefull information. Example:
Your project name ================= Short project description here. Production url is [example.com](http://example.com/). This is Ruby on Rails project, based on [Mayak Rails website template](http://mayak.io/). Getting Started --------------- Make sure you have Ruby version installed, specified in the `.ruby-version` file in the root directory of the application. If you use [RVM](https://rvm.io/) add a '.ruby-gemset' [file](https://rvm.io/workflow/projects#project-file-ruby-version) to the root directory of the application. You will need [ImageMagick](https://www.imagemagick.org/) installed. The application uses PostgreSQL. Versions 8.2 and up are supported. Create database and config file `config/database.yml` for connection. File example: development: adapter: postgresql database: database_name pool: 5 There is `config/database_example.yml` file for full example. When done, run: $ bin/bundle install --without production $ bin/rake db:create db:migrate Install demo data using command: `bin/rake db:seed` if you need. Application ready for start. You can launch webserver with command `bin/rails server` and see home page at [localhost:3000](http://localhost:3000/) url. Project life cycle ------------------ ### Adding new routes Put added route path to a config.fixed_pages_paths array (in 'config/application.rb') if a Page object should cover this path. Add the new route to the 'config/sitemap.xml' file. Deploy ------ Run deploy with command `mina deploy` or `mina production deploy` for production instance. Before the first deploy to server you'll need to run 'mina setup' or `mina production setup` for production. Also you'll need create file 'application.yml' in 'shared/config' directory on the server. Example of this file you can find in 'config' directory of the project.
Mayak Rails Website Template is released under the MIT License.
- 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
Feel free to use code of the project as you want, create issues or make pull requests.