Coder Social home page Coder Social logo

caffeine-addictt / edutecx Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 6.14 MB

EduTecX - Paving sustainable education

Home Page: https://edutecx.ngjx.org

License: GNU General Public License v3.0

Python 49.68% HTML 32.50% SCSS 1.07% Dockerfile 0.07% JavaScript 16.68%
ebooks education flask-application jwt-authentication school-project sqlalchemy-orm website-development api cloudinary flask

edutecx's Introduction

Hi, I'm Jun Xiang

I am a full-stack developer from Singapore looking to create performant and amazing software.

Fun facts

  • Powered by coffee ☕
  • I use arch, BTW
  • I use NeoVim, BTW

       ╱| 、
     (˚ˎ 。7  
      |、˜〵
     じ しˍ,)ノ

GNU/Linux #1

edutecx's People

Contributors

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

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

edutecx's Issues

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.

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)

Documentation

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

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
|_ ...

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

Canceling stripe payments

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

Store backend

  • Adding to cart functionality
  • Stripe integration
  • Callback API

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

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

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)

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

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
  ...

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.

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

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

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 } }

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

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.

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

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

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

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

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

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

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 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

Admin list modals to manage models

/dashboard/users

  • User Account Delete
  • User Account LOCK

/dashboard/textbooks

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

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.