Giter VIP home page Giter VIP logo

okr_app's Introduction

Okr App

Technology stack

Backend

Development

  • dotenv to load environment variables from .env into ENV

Linting and testing

  • RuboCop for Ruby static code analysis

Deployment

  • Docker for production deployment, NOT for development
  • GitHub Actions for testing, linting, and building Docker image

Production

Getting started

Development installation

  1. Clone the repo locally:
git clone [email protected]:valdrinkuchi/okr_app.git
cd okr_app
  1. Install PostgreSQL. On a Mac with HomeBrew, run this to install from the Brewfile:
brew bundle
  1. Setup the application to install gems and create the database:
bin/setup
  1. Setup Database. The seed.rb file has dummy data to get started.
rails db:setup
  1. Start the application locally:
rails s

Running in production mode locally

docker-compose up

Running tests

  1. Run Ruby tests:
bin/rails test
  1. Run RuboCop:
bin/rubocop

Api-Overview

  1. Create and Update User:

    POST: 0.0.0.0:3000/api/v1/users
    PATCH: 0.0.0.0:3000/api/v1/users/:id
    {
     "user": {
       "email": "[email protected]",
       "password": 123456,
       "password_confirmation": 123456,
       "first_name": "Test",
       "last_name": "User"
      }
    }
  2. Login and Logout User:

    POST: 0.0.0.0:3000/api/v1/sessions
    DELETE: 0.0.0.0:3000/api/v1/sessions/:id
    {
     "email": "[email protected]",
     "password" : 123456
    }

    The Authentication token will be recieved as a response from Login. Authorization token should be used in the headers in order to access goals and key_results controllers.

  3. CRUD operation Goals:

    GET: 0.0.0.0:3000/api/v1/goals or 0.0.0.0:3000/api/v1/goals/:id
    POST: 0.0.0.0:3000/api/v1/goals
    DELETE: 0.0.0.0:3000/api/v1/goals/:id
    PATCH: 0.0.0.0:3000/api/v1/goals/:id
  4. CRUD operation Key Results:

    GET: 0.0.0.0:3000/api/v1/key_results or 0.0.0.0:3000/api/v1/key_results/:id
    POST: 0.0.0.0:3000/api/v1/key_results
    DELETE: 0.0.0.0:3000/api/v1/key_results/:id
    PATCH: 0.0.0.0:3000/api/v1/key_results/:id

Examples

In the seed.rb there are two users created and assigned Goals and Key Results. When Emma Doe with email [email protected] and password 123456 is signed_in through POST http://0.0.0.0:3000/api/v1/sessions the authorization token is received in the response. This token can be used to retrieve Goals and Key Results that belong to Emma through http://0.0.0.0:3000/api/v1/key_results and http://0.0.0.0:3000/api/v1/goals.

okr_app's People

Contributors

valdrinkuchi avatar dependabot[bot] avatar

Watchers

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