Code Monkey home page Code Monkey logo

edutecx's Introduction

Contributors Forks Stargazers Issues BSD-3-Clause License


EduTecX

Paving sustainable education pathways
Report Bug · Live Demo

About The Project

Application Development project @ Nanyang Polytechnic Singapore

This project aims to provide more environmental-friendly education materials. By bridging the gap between vendors, educators and students, we aim to make the learning process more sustainable and accessible.

To saving children's backs!


Warning

This project will not be maintained after 12/02/2024. However, issues and pull requests will still be accepted.


Contributors


Live the live demo here.

(back to top)

Getting Started

This is an example of how you may set up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

  • Python 3.11.2+

Installation

Below is an example of how you can install and set up your app.

  1. Clone the repository
    git clone https://github.com/caffeine-addictt/edutecx
    cd edutecx
  2. Install dependencies
    pip install -r requirements.txt
  3. Write environment variables
    echo "ENV=development" >> .env
  4. Start the server
    gunicorn --bind 0.0.0.0:8080 --workers=2 --threads=2 --worker-class=gthread --reload run:app

(back to top)

Roadmap

  • Release

See the open issues for a full list of proposed features (and known issues).

(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 GNU GENERAL PUBLIC LICENSE. See LICENSE for more information.

(back to top)

Contact

(back to top)

edutecx's People

Contributors

andrewace avatar caffeine-addictt avatar chloelkl avatar dependabot[bot] avatar maann1 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

edutecx's Issues

User Roles

Only Admin and User exist currently.

  • Add Educator, Student roles
  • /classroom/join
  • v1/classroom/join
  • v1/classrom/leave
  • v1/classroom/list
  • Update v1/user/create
  • Impose role limits: Student cant create classrooms
  • Impose role limits: Educators can create up to 3 classrooms (Free plan)
  • Impose role limits: Educator classrooms have a max of 5 students (Free plan)
  • Impose role limits: Educators can create unlimited classrooms with unlimited seating (Paid plan)

Persistent database

Why

At present, only sqlite3 is being used - along with sqlalchemyORM.
SQLite is not suitable for production as the database is local and will be overwritten and wiped at every production deploy, losing data.

Solution

We should migrate to a remote SQL database without much refactoring needed for the current schemas.
The SQL database should be able to support Foreign key constraints and Enums.

Note

This migration should only affect production and development should still utilize sqlite for simplicity

  • Chosen database: PostgreSQL
  • Chosen database hosting: supabase

Checklist

  • PostgreSQL integration
  • Supabase integration
  • Simultaneous support for development (sqlite) and production (postgresql)

Ability to style svg

This is the graph generation workflow at present

Request -> Query DB -> Plot -> Render to SVG -> upload to /static/tmp/ -> Return URI

This method, however, causes the svg to be rendered in the html as an <img /> tag and styling is not possible.

Proposed fix

Request -> Query DB -> Plot -> Render SVG to StringIO -> Return SVG string

Populating HTML at runtime, this should theoretically allow for styling of SVG

API type safety

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
A better way of writing and interpreting api responses and requests

Describe the solution you'd like
A clear and concise description of what you want to happen.
utility library to host and interpret request and response data into easily mutable dictionary-convertible classes

Improving notifications

Notifications are reset and shown for the full time length after a reload/redirect

  • Dynamically set live duration
  • Store first render of toast
  • Toast timeouts after 5minutes
  • Max limits of toasts at a time

Creating Assignment Frontend

Is your feature request related to a problem? Please describe.
To have frontend assignment to display the functions used in backend APIs and JS

Describe the solution you'd like
To design the frontend assignment pages with reference to the wireframe

Document editing

Is your feature request related to a problem? Please describe.
At present users would be able to only purchase and view documents.
Users should be able to edit documents and save changes made.

Describe the solution you'd like

  • User drawing
  • User highlighting
  • User sticky notes

Additional context
Feel free to add on to the list below

Textbook viewing

Is your feature request related to a problem? Please describe.
Bought textbooks should be able to be viewed.

To Refactor

  • Removing editable textbooks
  • Removing cloning and deleting clones from CDN
  • Update stripeAPI
  • Remove EditableTB API
  • Update sale DB schema
  • Update frontend

To Add

  • viewing textbooks

Ambigious flag scopes

At present, all "flags" for statuses are ambiguously strings.

Meaning a status column where only values "Uploading" and "Uploaded" are expected, other values are not validated against and could cause unintended effects.

Database Testing

Testing cases should be done for all DB models to verify they function as expected, even before all the Front-end to Back-end logic is written to do testing then.

Canceling stripe payments

At present, the user is redirected to /checkout-cancel but there is no api for canceling an active session.

Overhaul Toasting to be javascript compatible

At present, toasts are rendered server-side from layout.html on new page GET payload,.

This means that without reloading, the page, it cannot be shown and similarly so when invoked with javascript.

  • Auto fetching alerts
  • Invoking alerts at runtime
  • Queuing alerts

Creating the Register and Login Page

Purpose
For users to check in to our website to use our features.

Context
To also store users' information into our database for other use.

Outcome
To create a Register and Login html page that allow users to login or create their account to access the landing home page.

Creating Navbar

I want to create navbar.
Navbar bar to have directory to Policy page, contact us page, store page, login or register page (as a button), API page, Help page, and logo.
Features:

  • On hover, to change from white theme to black theme nav bar.
  • Register button on the top right of the screen (Try to be animated)

Details and Assumptions

*I know how to create a simple navbar with the help of using basic navbar templates from w3schools and bootstrap.

Acceptance Criteria

Finished Product:

  • Able to redirect to the different pages
  • Working buttons with good styling
  • Able to change theme of nav on scroll
  • Able to highlight the directory of page when a specific pages

API bug hunting

Problem

API empty string is parsed as 'None'
Use request.files instead of _Files

Routes

  • Assignment
  • Auth
  • Classroom
  • Comment
  • Editabletextbook
  • Image
  • Notify
  • Sale
  • Stripe
  • Submission
  • SubmissionSnippet
  • Textbook
  • User

Submitted Snippets Schema

Is your feature request related to a problem? Please describe.
For submitting to assignments, a submitted snippets model needs to be created from the editable textbook model to persist submissions.

Model structure

Submission Model
|_ User Model
|_ Submitted Snippet Model
|_ ...

Admin list modals to manage models

/dashboard/users

  • User Account Delete
  • User Account LOCK

/dashboard/textbooks

  • Textbook Delete
  • Textbook LOCK
  • Textbook status (DMCA etc.)

Resend email sending does not error

Details

Failing to send a verification email at user account registering should disregard the request and return a 400 Bad Request. However, at present, this does not happen and the user account is created.

Reason

This started happening after the migration from flask_mail to resend.
This is because email_provider.send_email() returns a Boolean indicating a successful or unsuccessful send and this boolean is not accounted for.

Fix

res = email_provider.send_email()
if not res:
  # handle unsuccessful email
  ...

Creating textbook - front end

Feature Request

Creating frontend textbook that links to the textbook API for users to use the function

Describe the solution you'd like

To link the backend of textbook to the frontend of textbook

Checklist

  • Set up the textbook listing page for individual accounts / profile
  • Able to view own textbooks in a account
  • Able to update textbook details on admin side
  • Able to view own textbooks
  • Textbook focus view for own textbooks

JWT access token refresh errors

🐞 Bug Report

Describe the bug

  • When the access token verification fails due to it being expired the v1/token/refresh endpoint is called
  • Endpoint works
  • The API Wrapper interprets the response to { access_token: { access_token: str } }

Is this a regression?

Yes


Expected behaviour

  • The interpreted response should be { status: int, message: str, data: { access_token: str } }

Toasts do not appear

Prerequisites

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (for multi-repository projects)

Expected Behavior

When flask.flash is run at runtime, toasts should appear at the top-right hand corner of the page

Current Behavior

When flask.flash is run at runtime, toasts do not appear

Routes not registering in testing

Describe the bug

When tests are ran as a batch, the test for root '/' errors.

This bug only occurs when tests are ran as a batch.
Expected behavior when running the app and when running the test case by itself.

To Reproduce

Steps to reproduce the behavior:

  1. Go to vsCode's testing tab
  2. Click on "Run Tests" at the top
  3. View failed tests

Expected behavior

The test for root '/' should return status200 and pass

Screenshots

Screenshot of the failed test when ran as a batch:
image

Additional context

Stdout of registered routes:
image

Docker CI/CD setup

Details

To handle production deploys with docker images.

  • Docker build and publish workflow
  • Key setup
  • Workflow run limitations

Testing steps

  1. Trigger dispatch
  2. Ensure image build is pushed correctly
  3. Pull image locally
  4. Run tests
  • Merging workflow to main #130
  • Testing workflow_dispatch
  • Testing Push dispatch
  • Testing local run

Final steps

  • Update documentation

Styling Contact Us Page

Describe the solution you'd like
Using bootstrap and some css to style the contact us page

Describe alternatives you've considered
With reference to other contact us pages

Creating Classrooms List

Making the HTML for /classrooms and /classrooms/new

/classrooms

classroom list, fetches the classrooms the user is in, including the quick view of assignments' details.

Outcome

  • each class tile contains its name, teacher, picture
  • each class tile contains pending assignments and their due date
  • hovering each class tile has an animation
  • clicking a class tile navigates the page to its respective ID
  • clicking the assignment navigates to the respective assignment submission view
  • search bar to find classrooms by name and teacher
  • "Sort By" filter
  • "Create" button for educators to navigate to classrooms/new

/classrooms/new

for educators only - enter details to create a new classroom

Outcome

  • back button to go back to /classrooms
  • able to upload an image file
  • title and description inputs
  • able to add textbooks from their collection, with a "get more" button
  • "Clear" and "Create" to empty or submit contents with confirmation
  • validation to make sure contents are not empty before submitting
  • clicking "Create" brings the educator to classrooms/id after creation

Store backend

  • Adding to cart functionality
  • Stripe integration
  • Callback API

Documentation

Is your feature request related to a problem? Please describe.
Some functions are not yet documented

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.