Potassium 
A Rails application generator from Platanus, inspired by Suspenders.
Installation
You have to install Potassium globally:
$ gem install potassium
Usage
Starting a new project from scratch
Use the potassium create command to create a new project:
$ potassium create <project-name>
It's important to note that it will perform a version check before running to ensure that you're using the latest potassium. Also, if you feel that it's too slow, you may need to update rubygems:
gem update --system.
Adding recipes to an existing project
Use the potassium install command to add a recipe to a project:
$ potassium install devise
You can force an already installed recipe by passing the --force argument
$ potassium install devise --force
You can run the command on its own to view all the available recipes and select one:
$ potassium install
What's inside Potassium?
Potassium Rails apps includes the following gems and technologies:
- Ruby Set the project ruby version based on http://ruby.platan.us/latest
- dotenv load environmental variables in development
- Bower for frontend assets packages.
- EditorConfig for keeping all our editor configurations the same.
- pry and pry-byebug for a less painful debugging experience.
- RSpec for unit and integration testing.
- FactoryGirl for test factories.
- Guard for continuous testing and other watch-related tasks.
- AWS-SDK for file uploads, sdks, etc and because we use AWS.
- Puma to serve HTTP requests
- Rack Timeout to abort requests that are taking too long
- Tzinfo-Data for update timezone information
- Faker for create development data
The following optional integrations are added too:
- PostgreSQL or MySQL for the database.
- Devise for authentication.
- ActiveAdmin for admin interfaces.
- ActiveAdminAddons for some help with ActiveAdmin.
- Pundit for role-based authorization.
- DelayedJob to execute longer tasks in the background.]
- Mailing configuration for AWS SES and Sendgrid with recipient interceptor support
- Clockwork to run scheduled processes
- Sentry to monitor exceptions and errors
A few more things are added to the project:
- A low database connection pool limit
- Setup continuous integration in CircleCI to run tests.
- Create the github repository for the project (it used
hubunder the hood) - A
bin/setupscript to setup things on a newly cloned project - A
bin/cibuildscript to run continuous integration build on CI - A
db:fake_data:loadrake task to load fake data for development
API support
The optional API support includes:
- Responders for dry-ing our api controllers.
- Versionist for some flexible api versioning.
- ActiveModel::Serializers for record serialization.
- Simple Token Authentication for stateless API authentication.
Heroku
When you choose to deploy to heroku a few extra things are added for the project.
- Adds the Rails Stdout Logging gem to configure the app to log to standard out, which is how Heroku's logging works.
- Adds a Procfile to define the processes to run in heroku
- Setup continuous integration using docker and herokuish to maintain better parity between testing and production environments
- Adds a
.buildpacksfile with the default buildpacks to use. It use the following buildpacks:
| index | buildpack | description |
|---|---|---|
| 1. | bower | to make sure bower install run before the assets precompilation task |
| 2. | ruby-version | to support the use of .ruby-version file to instruct heroku which ruby version to use |
| 3. | ruby | the base buildpack to run ruby applications |
| 4. | ruby-deploy-tasks | to run rake task after the deployment is complete, for example db:migrate |
Also the heroku applications are created
- Creates a
stagingandproductionapplications - Creates a pipeline and assign the above application to the
stagingandproductionstages. - Setup initial configuration variables
- Set the application buildpack to the multi-buildpack
- Set deploy-tasks buildpack is setup to run
rake db:migrateafter each deploy
You'll need to manually
- Connect the pipeline with the github repository
- Assign a branch to each stage for auto deployments
- Enable deploy after CI pass
Continuous Integration
In order to CicleCI start building the project on each push you need tell circle ci. Go to https://circleci.com/add-projects, choose the repository from the list and hit Build Project
Hound CI
In order to Hound start checking your project's PRs you need enable that repository. Go to https://monkeyci.platan.us, choose the repository from the list and hit Activate
Contributing
If you want to add functionality please go to the contributing
Credits
Thank you contributors!
![]()
potassium is maintained by platanus.
License
Potassium is © 2014 platanus, spa. It is free software and may be redistributed under the terms specified in the LICENSE file.