Reciclando ♻️ is an app that allows organizations to manage recycled flow in their cities.
- Ruby 2.5
- Bundler
- PostgreSQL
After downloading the repository, run this command:
$ bundle install
Once installed the gems, run this command to set up the database:
rails db:setup
Note: Fake data is also loaded for testing purposes.
rails server
This would start the server in http://localhost:3000
.
This command starts both apps, all API services under root path (/
) and the CMS (/admin
).
An RSpec test suite is available to ensure proper API functionality. To run this test, run:
bundle exec rspec
A linter is used to ensure proper code format.
To run this test, run:
bundle exec rubocop
The apps are deployed in AWS, where two EC2 instances are currently running:
To setup EC2 instances for deployment, follow this guide step by step.
Some variables must be defined before deployment:
* REPO_URL
* APP_NAME
* EC2_USER
* EC2_IP_STAGING
* EC2_PORT_STAGING
* EC2_IP_PRODUCTION
* EC2_PORT_PRODUCTION
To automate the deployment, Capistrano is used. This gem gives you a cap
tool to perform deployments. After setting up the neccessary rules in this files:
- deploy.rb
- staging.rb
- production.rb
the deployment can be perform in the command line, with the tool mentioned above.
CircleCi simplifies this process, by running the deployment commands after app build success. Take into account that the deployments belongs to a certain enviorment.
The main API is documented with swagger, and can be reached here.
Note: credentials for access are (reciclando, reciclando)
.
The CMS is use by admin users to manage the content of the app, and it is implemented using Active Admin