Lukasveiga / desafio-tunts.rocks-2024

Desafio técnico para vaga de estágio na Tunts.Rock

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Challenge Tunts.Rocks 2024 🤘


Overview:

This project is part of the selection process for the Tunts.Rocks internship position. The challenge consists of creating an application in a programming language. This application must be capable of reading a Google Sheets spreadsheet, fetching necessary information, calculating, and writing the results back to the spreadsheet.


Problem Information:

A table was provided with information about students in an engineering course, including data regarding the number of absences and their respective grades on the three semester exams (P1, P2, P3). It is necessary to calculate the current status of the student and also the final passing grade (FPG), according to the following rules:

Average grade (m) Situation:

  • m < 5 - Disapproved by Grade
  • 5 <= m < 7 - Final Exam
  • m >= 7 - Approved

Obs: Students who have a number of absences exceeding 25% of the number of classes in the semester are automatically disapproved by absence.

For students who took the final exam, it is necessary to obtain the minimum grade for final approval following the following rule:

  • 5 <= (m + fpg)/2

where:

  • m -> Average grade
  • fpg -> Necessary final passing grade (FPG)

Project Information:

For this project is necessary to provide two main informations. First is the google sheet ID and the second is the Google Sheets API credentials.

1. Google Sheet ID:

2. Google Sheets API credentials:

  1. Within the Google Cloud console, it is necessary to create a project for the application or use an existing one;

  2. After creating the project, it is necessary to access the Google API Library, search for the Google Sheets API, add it to the project, and enable it;

  3. Create credentials by providing the necessary information for the project;

  4. A service account email will be created, so it will be necessary to copy this email and insert it into the sharing configuration in the Google Sheet that will be used, in order to grant access to the application's functionalities;

  5. Within the settings of service account, there will be an option to create keys, select the JSON option, which will be the credential file required for use in the project.

  • The credentials will be downloaded automatically and you will need to paste them into the project root.

Obs: Always remember to insert sensitive data into the .gitignore list so that it is not exposed on the internet.

How to Install and Run the Project?

  • Add the JSON file with the credentials named as follows: "credentials.json" in the root of the project and insert the table ID into the environment variables file ".env" under the key SPREAD_SHEET_ID, as demonstrated below:

.env:

SPREAD_SHEET_ID=1FF5QsQkqcwn8ZOIWslmhyuqm_uIz89QIvT-ObqDWCJc
SHEET_NAME=engenharia_de_software
  • In the terminal, run the following command to install all necessary project dependencies:
npm install
  • To run the tests, run the command below:
npm test
  • And finally, to run the program, run the following command:
npm run start

And check if the changes were made successfully in the table.


If you have any questions or ideas to improve the project, feel free to get in touch!


Lukas Veiga

Backend Web Developer | Java | Spring Boot | Javascript | Typescript | Express
Future Systems Analyst and Developer

Twitter Linkedin

Email: lukas.veiga10@gmail.com

About

Desafio técnico para vaga de estágio na Tunts.Rock

License:MIT License


Languages

Language:TypeScript 98.8%Language:JavaScript 1.2%