Git Product home page Git Product logo

rails-backend-api's Introduction

3Pillar Global - Evaluation

README


Requirements

  • Ruby on Rails
  • Backend development
  • Databases (SQL Server, MongoDB, Oracle, etc.)
  • Docker
  • Javascript and related frontend frameworks (React, Angular, etc)

Coding Exercise

Factura.me SA de CV, your brand new employer, needs a demo for an expense reporting tool. Electronic receipt records and related information are stored in a PostgreSQL database. Management has decided that React (or Angular) must be used in the frontend and that the backend will be accessible via Ruby on Rails.

The fields in the report:

  • Issuer name
  • Date issued
  • Issuer RFC
  • Cfdi xml
  • Total amount
  • Employee name (the one reporting the expenses)
  • The demo will print the report using generated test data, paginated as necessary, ordered by the date issued.

Project setup

Follow the next steps mentioned bellow to setup the test project with Docker

  1. Clone the project
git clone https://github.com/carlitos/3pillar-global
  1. Rename the .env.example

mv .env.exampl .env

  1. Build the image for the Ruby on Rails backend
docker-compose build
  1. Boot up the app by running:
docker-compose up
  1. Setup the database
docker-compose exec web rake db:create

  1. Run the migration of the tables
docker-compose exec web rake db:migrate
  1. Seed the db with example users
docker-compose exec web rake db:seed
  1. Now you can get access to the API in the default RoR port 3000 http://localhost:3000

Endpoints of the app

Get the all the users

GET Returns a json list with all the users of the app

http://localhost:3000/users

Get the list of expenses order by issued date

GET http://localhost:3000/expenses Return the list of the expenses

Create a new expense

POST http://localhost:3000/expenses

{
    "expense": {
        "issuer_name": "Carlos Moises",
        "date_issued": "2021/07/12",
        "issuer_rfc": "CACJ850728PXA",
        "cfdi_xml": "",
        "total_amount": 1500.50,
        "user_id": 1
    }
    
}

Front-end

The front-end app its a project build in Angular version 12.

The project is in the folder facturame-client

For the setup of the angular you need to run the following steps:

  1. Inside of the folder:

yarn install or npm install

  1. Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

rails-backend-api's People

Contributors

carlitos avatar

Stargazers

 avatar

Watchers

 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.