This API provides a comprehensive interface for managing food-related data, including meal categories, individual meals, orders and payments. It serves as a backend system for applications requiring structured food information management and order processing. Built with Ruby on Rails, this API implements RESTful principles and includes thorough documentation of all endpoints.
Key features:
- RESTful API endpoints for managing meals and categories
- Order creation and payment processing
- Wishlist management endpoints for saving favorite items
- Admin interface for managing all resources
- User authentication and authorization
- Pagination and filtering support
- Comprehensive error handling
- API documentation
API_URL=https://rails-poc-k1uu.onrender.com/api/v1
Admin API docs: https://rails-poc-k1uu.onrender.com/api-docs username: apifood password: password
ActiveAdmin: https://rails-poc-k1uu.onrender.com/admin username: [email protected] password: password
To run this API locally with Docker Compose:
- Clone the repository
- Copy the .env.example file to .env and configure environment variables:
cp .env.example .env
- Build the Docker images:
docker-compose build
- Start the services:
docker-compose up
- Create and setup the database:
docker-compose exec web rails db:create db:migrate - Optionally seed the database with sample data:
docker-compose exec web rails db:seed
The API will be available at http://localhost:3000
See Docker docs for more info
This template provides a handful of scripts to make your dev experience better!
- bin/bundle to run any
bundlecommands.bin/bundle install
- bin/rails to run any
railscommandsbin/rails console
- bin/web to run any
bashcommandsbin/web ls
- bin/rspec to run specs
bin/rspec .
- bin/dev to run both Rails and JS build processes at the same time in a single terminal tab.
bin/dev
You don't have to use these but they are designed to run the same when running with Docker or not.
To illustrate, bin/rails console will run the console in the docker container when running with docker and locally when not.
- ActiveAdmin for easy administration
- Arctic Admin for responsive active admin
- Annotate for documenting the schema in the classes
- Better Errors for a better error page
- Brakeman for security static analysis
- Byebug for debugging
- DelayedJob for background processing
- Devise for basic authentication
- Devise Token Auth for API authentication
- Dotenv for handling environment variables
- Draper for decorators
- Factory Bot for testing data
- Faker for generating test data
- Flipper for feature flag support
- Jbuilder for JSON views
- JS Bundling for bundling JS assets
- Knapsack for splitting tests evenly based on execution time
- Letter Opener for previewing emails in the browser
- New Relic for monitoring and debugging
- Pagy for pagination
- Parallel Tests for running the tests in multiple cores
- Prosopite to detect N+1 queries
- Pry for enhancing the Ruby shell
- Puma for the web server
- Pundit for authorization management
- Rack CORS for handling CORS
- Rails Best Practices for Rails linting
- Reek for Ruby linting
- RSpec for testing
- RSpec OpenAPI for generating API documentation
- Rswag for serving the API documentation
- Rubocop for Ruby linting
- Sendgrid for sending emails
- Shoulda Matchers for other testing matchers
- Simplecov for code coverage
- Strong Migrations for catching unsafe migrations in development
- Webmock for stubbing http requests
- YAAF for form objects
- RSpec API Doc Generator you can generate the docs after writing requests specs
- Rswag you can expose the generated docs
See API documentation docs for more info
With bundle exec rails code:analysis you can run the code analysis tool, you can omit rules with:
- Rubocop Edit
.rubocop.yml - Reek Edit
config.reek - Rails Best Practices Edit
config/rails_best_practices.yml - Brakeman Run
brakeman -Ito generateconfig/brakeman.ignore
In order to use New Relic to monitor your application requests and metrics, you must setup NEW_RELIC_API_KEY and NEW_RELIC_APP_NAME environment variables.
To obtain an API key you must create an account in the platform.
- After adding the project to CC, go to
Repo Settings - On the
Test Coveragetab, copy theTest Reporter ID - Set the current value of
CC_TEST_REPORTER_IDin the GitHub secrets and variables