Code Monkey home page Code Monkey logo

roda_api's Introduction

Developer Guide

Roda API project.

To run this project you need:

  • Ruby 2.6.x
  • Postgres +10.x
  • roda 3.26.0

To Start

To start development, clone the project and run:

$ bundle install

Database setup

Update the file located in roda_api/config/db.rb replace the credentials and DB name with yours.

Create the database

rake db:create        # Create the database
rake db:drop          # Drop the database
rake db:migrate       # Perform migration up to latest migration available
rake db:migrate:down  # Perform migration down (erase all data)
rake db:migrate:up    # Perform migration up to latest migration available

or created the database with the pg commands

sudo -u postgres psql
CREATE DATABASE my_development_db;

Project Conventions

In root we have all known rails folders there from the MVC pattern, also we interduce those folders:

Roda Console

irb -r /models.rb

Project Configuration

Secrets and Keys

In this project I prefered to use dotenv and keep all the keys in the env file.

  • .env.example will used as placeholder for the required keys to run the application.
  • in case there are new keys, please add a placeholder for it in .env.example so other developers know about it.
  • use .env to set your own keys and your own settings based on you machine, this file is ignored from the repo, so dont push it.

Model style

## -------------------- Requirements -------------------- ##
## ----------------------- Scopes ----------------------- ##
## --------------------- Constants ---------------------- ##
## ----------------------- Enums ------------------------ ##
## -------------------- Associations -------------------- ##
## -------------------- Validations --------------------- ##
## --------------------- Callbacks ---------------------- ##
## ------------------- Class Methods -------------------- ##
## ---------------------- Methods ----------------------- ##

Before Commit

  • lint ruby files by running rubocop --auto-correct, it will auto correct what can be corrected
  • Overcommit will run automatically on commit and will show you Whitespace and Rubocop errors, and will run Rspec on push

roda_api's People

Contributors

m-bojan avatar majedbojan avatar

Watchers

James Cloos 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.