Code Monkey home page Code Monkey logo

git-init-foss-api's Introduction

git-init-FOSS-API

Github issues Github forks Github stars

This is the backend repo of git-INIT-FOSS-Client

Screenshot Screenshot

Project Description

This project is made to introduce students to the world of open source. Here, the users can navigate to find the project most suitable to them and then contribute to it.

Features

1. Frontend (Frontend Repositry)

1. Navigation

You can navigate to projects and leaderboard from here.

2. Search Bar

  • Here we can directly search for project or user using by Contributers Name,Maintainers Name,UserName,Project name etc.

3. Projects Card

In this all the information about the project is given.

4. LeaderBoard Tile

Here all the information of contributors is given

  • Contributors Name
  • Github UserName
  • Contributors Roll Number
  • Score

5.Statistics

Here we have the information

  • Total number of Pull Request
  • Total number of Active Contributers
  • Number of Hard, Medium, Easy

2. Backend

  • All the data related to the project, like student details, student scores, student score card and the projects are stored in public folder.
  • The src fetches the student details and then calculates the score of students.
  • The updaterDB.js updates the score of students. If you want to update the score manually you'll have to run (node src\updaterDB.js)
  • This server has a cron job built-in which runs every 1 hour and updates the scores of participants in score.json file, which is then served using a single endpoint to the frontend. If you want to update the score automatically after every one hour you'll have to run (crontab script.cron).
  • You can also edit the time, after which you want to update the scores in the script.cron file.
  • The cron command-line utility, also known as cron job is a job scheduler on Unix-like operating systems. Users who set up and maintain software environments use cron to schedule jobs to run periodically at fixed times, dates, or intervals.
  • You can learn more about cron from here (Cron).

Technologies and Packages Used

  1. Node
  2. Express
  3. Cron
  4. Node Fetch

Local Setup

Get Started

  1. Fork the repositry.
  2. Clone the repositry (git clone URL).
  3. Open the folder in which you cloned the repositry.
  4. Run(npm install).
  5. Run (npm run dev).
  6. This will start your server locally.

Building and running in production mode

You can run the newly built app with npm run start.

Contributors


Connect with us


git-init-foss-api's People

Contributors

aaryak-shah avatar amanpachori avatar arushi2715 avatar gurpreet-legend avatar hs2361 avatar kshitij-404 avatar kunaljain0212 avatar sohan2410 avatar

Stargazers

 avatar

Watchers

 avatar

git-init-foss-api's Issues

Add number of easy, medium and hard issues solved to API response

Currently, we are only assigning the score for each student (10 points for easy, 20 for medium and 30 for hard). However, we would like to also add the number of easy, medium and hard issues that students solve to the leaderboard API response. After this, the API response should look something like this:

{
...
  "username": {
    "name": "name",
    "rollNumber": "2020XXX-YYY",
    "score": S,
    "easy": E,
    "medium": M,
    "hard": H,
  },
...
}

The score calculation logic is here

if (data[i].labels.length === 0) {
score[student].score += 10;
} else {
let isMedium = false;
let isHard = false;
for (const label of data[i].labels) {
if (
label.name.toLowerCase() === "medium" ||
label.name.toLowerCase() === "intermediate"
) {
isMedium = true;
} else if (label.name.toLowerCase() === "hard") {
isHard = true;
}
}
if (isHard) {
score[student].score += 30;
} else if (isMedium) {
score[student].score += 20;
} else {
score[student].score += 10;
}
}
}
}

This issue is fairly simple to solve given that the checks for easy, medium and hard issues are already present.

[DOCUMENTATION] Create Readme

Create a Readme similar to the frontend repo of this website (https://github.com/aaryak-shah/git-init-FOSS).

Things to note:

  1. Local setup steps may differ
  2. Features are to be added accordingly
  3. This server has a cron job built-in which run every 1 hour and updates the scores of participants in score.json file, which is then served using a single endpoint to the frontend. Try including about the cron job in the README. Also you can read more about crontab and how it can be used to run the cron job locally using script.cron file.

Add API endpoint to obtain statistics for the event

Add an endpoint to the server, say /stats that will return the current statistics of the event in a desired format. This issue is a precursor to aaryak-shah/git-init-FOSS#20 and so the format of the stats should be what the frontend can use effectively.

Stats to be found, with respect to the event-registered repos:

  • Total number of PRs
  • Nuber of easy, medium, hard PRs
  • Number of active contributors (i.e. those who have at least one succesfully merged PR)
    + Any additional stats you think are suitable

Add ESLint and Prettier for static code analysis

At the moment, the code formatting and code style are inconsistent throughout the project. This can be easily fixed by using ESLint, and configuring it to use the Prettier plugin. Here's a useful guide for configuring ESLint with Prettier.

Additionally, add a lint script to check the linting, and a lint:fix script to automatically fix linting issues in the package.json.

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.