- Ruby on Rails
- Backend development
- Databases (SQL Server, MongoDB, Oracle, etc.)
- Docker
- Javascript and related frontend frameworks (React, Angular, etc)
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.
Follow the next steps mentioned bellow to setup the test project with Docker
- Clone the project
git clone https://github.com/carlitos/3pillar-global
- Rename the .env.example
mv .env.exampl .env
- Build the image for the Ruby on Rails backend
docker-compose build
- Boot up the app by running:
docker-compose up
- Setup the database
docker-compose exec web rake db:create
- Run the migration of the tables
docker-compose exec web rake db:migrate
- Seed the db with example users
docker-compose exec web rake db:seed
- Now you can get access to the API in the default RoR port 3000
http://localhost:3000
GET
Returns a json list with all the users of the app
http://localhost:3000/users
GET
http://localhost:3000/expenses
Return the list of the expenses
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
}
}
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:
- Inside of the folder:
yarn install
or npm install
- 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.