Giter Club home page Giter Club logo

rails_api_template's Introduction

Rails API Template

CircleCI

Rails Api Template is a boilerplate project for JSON RESTful APIs. It follows the community best practices in terms of standards, security and maintainability, integrating a variety of testing and code quality tools. It's based on Rails 6 and Ruby 2.7.2.

Finally, it contains a plug an play Administration console (thanks to ActiveAdmin).

Features

This template comes with:

  • Schema
    • Users table
    • Admin users table
  • Endpoints
    • Sign up with user credentials
    • Sign in with user credentials
    • Sign out
    • Reset password
    • Get and update user profile
  • Administration panel for users
  • Rspec tests
  • Code quality tools
  • API documentation following https://apiblueprint.org/

How to use

  1. Clone this repo
  2. Install PostgreSQL in case you don't have it
  3. Run bootstrap.sh with the name of your your project like ./bootstrap.sh my_awesome_project
  4. Create your database.yml and application.yml file
  5. bundle install
  6. Generate a secret key with rake secret and paste this value into the application.yml.
  7. rake db:create
  8. rake db:migrate
  9. rspec and make sure all tests pass
  10. rails s
  11. You can now try your REST services!

Gems

Optional configuration

  • Set your mail sender in config/initializers/devise.rb
  • Config your timezone accordingly in application.rb.

Api Docs

http://localhost:3000/api_docs

  • Username: developer
  • Password: password
  • You can update credentials in config/initializers/apipie.rb

Code quality

With rake 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 -I to generate config/brakeman.ignore
  • Bullet You can add exceptions to a bullet initializer or in the controller

Configuring Code Climate

  1. After adding the project to CC, go to Repo Settings
  2. On the Test Coverage tab, copy the Test Reporter ID
  3. Replace the current value of CC_TEST_REPORTER_ID on the config.yml file (.circleci/config.yml) with the one you copied from CC

Code Owners

You can use CODEOWNERS file to define individuals or teams that are responsible for code in the repository.

Code owners are automatically requested for review when someone opens a pull request that modifies code that they own.

Credits

Rails Api Template is forked from Rootstrap and updated with respect to our requirements by me Muhammad Soban Akram

rails_api_template's People

Contributors

dependabot[bot] avatar sobanakram avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.