Skip to content
/ rsd Public

A full-stack Recording Students Degrees System that record students daily revising and memorising of Quran, The store uses Flask as its backend, PostgreSQL as database, and CSS, HTML, JS/TS and Bootstrap as its Frontend

Notifications You must be signed in to change notification settings

BR19-gh/rsd

Repository files navigation

RSD رصد (Recording Students Degrees) System

still working on README.md....

Overview

A full-stack Recording Students Degrees System that record students daily revising and memorising of Quran, The store uses Flask as its backend, PostgreSQL as database, and CSS, HTML, JS/TS and Bootstrap as its Frontend.

The application is deployed on Heroku and can be accessed at
RSD-br19.herokuapp.com (currently not accessable)

Running the Project Locally

Project Dependencies


Python 3.9.10

Install Here: python docs


Virtual Environment

  • virtualenv as a tool to create isolated Python environments

  • It is recommended to work with a virtual environment whenever using Python for projects. This keeps your dependencies for each project separate and organized.

  • Instructions for setting up a virtual environment for your platform can be found in the python docs


Installing Dependencies

Once you have your virtual environment setup and running, install dependencies by running:

pip install -r requirements.tx

This will install all the required packages as mentioned within the requirements.txt file.

Key Dependencies

  • Flask is a lightweight backend microservices framework. Flask is required to handle requests and responses.

  • Flask-CORS is the extension to use for handling cross-origin requests from our frontend server when running the project locally.

    • after installing this dependency, uncomment the following line in app/main.py for the app to work locally:
# cors = CORS(app)

Database Setup

  • SQLite is the database for local running and spdb.db is the database file

  • PostgreSQL is the database for production environment, because of that, you have to comment out this line of code in all of app/main.py:

self.conn = psycopg2.connect(DATABASE_URL, sslmode='require')

and uncomment the following line in all of app/main.py:

# self.conn = sqlite3.connect("spdb.db")

for database connections to work locally

Environment variables

  • Create .env file in the root directory and put the following values in:
USERNAME = xxxx

PASSWORD = xxxx

Running the server

  • From within the project directory first ensure you are working using your created virtual environment, then type the following:
flask run

or in PowerShell for Windows

$env:FLASK_APP  =  "app/main.py"

$env:FLASK_ENV  =  "development"

flask run

API Reference

Getting Started

Error Handling and Status Codes

The API will return the following error codes and status codes

when requests fail or success:

  • 200: Entity is Updated

  • 201: Entity is Created

  • 202: Accepted for Processing

  • 204: Deleted Successfully or No Content to Return

  • 400: Bad Request

  • 401: Unauthorized Access

  • 403: Entity Exists

  • 404: Resource Not Found

  • 405: Method Used Not Allowed

  • 429: Rate-Limit of Requests Exceeded

  • 500: Internal Server Error

  • 503: Server is Down Due to Maintenance

API Endpoints

Frontend

Updates

About

A full-stack Recording Students Degrees System that record students daily revising and memorising of Quran, The store uses Flask as its backend, PostgreSQL as database, and CSS, HTML, JS/TS and Bootstrap as its Frontend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published