/Prashanth-PWA

Primary LanguageJavaScript

Documentaition

Welcome to the documentation for the Askanjlee This document will guide you through setting up the application, installing its dependencies, and running it. Additionally, you'll find a brief description of the project's purpose.

Table of Contents

Getting Started

Follow these steps to set up and run the application on your local machine.

Prerequisites

Before you begin, ensure you have the following installed on your system:

  • Node.js (version x.x.x or higher)
  • npm (usually comes with Node.js installation)

Installation

  1. Clone this repository to your local machine using the following command:

    git clone https://github.com/your-username/project-name.git
  2. Navigate to project directory

    cd project-name
  3. Run Npm install

    npm install
    

Running

  1. Run
    npm start

Screenshots

image image Screenshot (1) Screenshot (2) Screenshot (3) Screenshot (5) Screenshot (7)

Backend System

Folder Structure

image

The backend system is organized into the following directory structure:

  • /server: Contains the main application code.

    • app.py: Contains the main application logic and routes for handling different endpoints.
    • config.py: Contains configuration settings for the application.
    • models.py: Contains data models and database interaction logic.
    • requirements.txt: Lists all the Python libraries and packages required to run the application.
  • README.md: Contains documentation and instructions for setting up and running the application.

Main File (app.py)

Endpoints

  1. /Login (POST): Login the user with session enabled for that particular user.
  2. /@me (GET): Fetches details of a specific user based on session id.
  3. /courses (GET): Fetches a list of courses.
  4. /courses/<course_id> (GET): Fetches details of a specific course based on course_id.
  5. /registration(POST): Enters the details of a user into the database
  6. /logout(GET): Ends the session of the user.

Configuration File (config.py)

Flask Configuration

  • SECRET_KEY: Secret key for session management.
  • SQLALCHEMY_DATABASE_URI: URI for connecting to the PostgreSQL database.

Database Configuration

  • DB_HOST: PostgreSQL host address.
  • DB_PORT: PostgreSQL port.
  • DB_NAME: Name of the database.
  • DB_USER: Database username.
  • DB_PASSWORD: Database password.

Redis Configuration

  • REDIS_HOST: Redis host address.
  • REDIS_PORT: Redis port.

Data Model File (models.py)

  • Defines classes representing the data entities (e.g., User, Course).
  • Includes methods for querying, creating, updating, and deleting records in the database.

Requirements File (requirements/requirements.txt)

  • Lists all the Python libraries and packages required to run the application. Includes Flask, SQLAlchemy, psycopg2 (for PostgreSQL), redis, and any other dependencies.

Purpose

The Aim of this project is to provide courses to students in field of Mathematics, Science , STEM related content and Olympiads.