Skip to content

Andrei123f/RELI-back-end

Repository files navigation


Logo

RenderLingo - API

E-learning platform that evaluates the solution using ASTs(Abstract Syntax Trees) comparisons and unit testing.
**This is the RenderLingo API documentation. If you want to read the RendeLingo Portal documentation please click here.**

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact

About The Project

This is the API for the RenderLingo Portal. The API is responsible with the user auth, user account creation and challenge evaluation/retrieval.
The project uses OAuth 2.0 flow for the user authentication and MongoDB for data storing.

How Does RenderLingo work

⚙️ Once you submit a challenge solution, RELI's API will evaluate your solution and give you 3 values, P1, P2, C alongside with the tests failed and passed. In short, P1 is a % of how similar is your solution to mine for that challenge, P2 is a % of how many tests your solution passed and C is a value calculated as C = 20%P1 + 80%P2.

P1 is determined by comparing the ASTs(short for Abstract Syntax Trees) generated by your solution and my solution using the following distance algorithms The Levenshtein distance, Longest Common Subsequence(LCS), Metric Longest Common Subsequence(MLCS) and Cosine similarity.

Built With

The major frameworks that I used:

(back to top)

Getting Started

You will need npm and nodejs. You can get them from here.

Prerequisites

After installing npm and node you may run

npm install npm@latest -g

to get the latest version of npm

Installation

  1. Clone the repo

    git clone https://github.com/Andrei123f/RELI-back-end.git
  2. Install NPM packages

    npm install
  3. Create a .env file and place the following value there

    ATLAS_URI=mongo_db_url
    PASSWORD_SALT_ROUNDS=10
    ACCESS_TOKEN_SECRET=access_token_secret
    REFERESH_TOKEN_SECERET=refresh_token_secret
    ACCESS_TOKEN_EXP_H=1h
    REFRESH_TOKEN_EXP_M=29d

    mongo_db_url is your mongo db connection string
    access_token_secret is your access token secret (please read the JWT documentation and OAuth 2.0 documentation)
    refresh_token_secret is your refresh token secret (please read the JWT documentation and OAuth 2.0 documentation)

  4. Run the following command to start the project

    npm run devStart

(back to top)

Usage

Anyone who wants to learn the basics of JavaScript, including Variables, Functions, Arrays and Objects, Classes, Object-oriented programming(OOP) can learn the fundamentals of these concepts in a unique and interesting way by translating a story to code.

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Andrei Popa - @andreispkpd - andrei.popabd@gmail.com

Project Link: https://github.com/Andrei123f/RELI-back-end

(back to top)

Releases

No releases published

Packages

No packages published