Skip to content

xCirno1/BM-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Key Features

  • Session control (session token & refresh token)
  • Real time notification
  • Authorization implementation on every route and websocket
  • Customizable display settings

Setting up

Configuring Poetry

  1. Install poetry

  2. Change the directory to backend using cd backend

  3. Run poetry install to install dependencies.

  4. [optional] Change the venv and venvPath in pyrightconfig.json to be the venv name and absolute path (info displayed before install starts)

  5. Modify config.json in the backend directory, an example configuration:

{
    "ORIGINS": ["http://192.168.1.13:3000", "http://localhost:3000"],
    "DB_NAME": "core",
    "DB_HOST": "localhost",
    "DB_PORT": 3307,
    "DB_USERNAME": "xCirno",
    "DB_PASSWORD": "MyPassword",
    "HOST": "192.168.1.13",
    "PORT": 8000,
    "JWT_PRIVATE_KEY": "YOUR_PRIVATE_KEY_HERE",
    "JWT_PUBLIC_KEY" : "YOUR_PUBLIC_KEY_HERE",
    "JWT_ALGORITHM": "RS256"
}
  1. Start the API by using poetry run backend (It will run on port 8000)

Configuring React

  1. Install node.js

  2. Change the directory to frontend using cd frontend

  3. Install all the required packages using npm install

  4. Create .env package inside the ./frontend directory and set these configurations:

REACT_APP_BASE_API_URL = ...      # For example: https://example.com:8000/api
REACT_APP_BASE_WS_URL = ...       # For example: ws://example.com:8000/ws
REACT_APP_BASE_CLIENT_ROUTE = ... # For example: /sma/tutor
  1. Build the web app using npm run build (It will run on port 3000)

  2. Start the web app using serve -s build (run npm install -g serve if it hasn't been installed)

Configuring MySQL Database

  1. Connect to a MySQL database, you should already have MySQL database properly configured. (Using MySQL workbench is recommended)

  2. Create schema named core

CREATE SCHEMA `core` DEFAULT CHARACTER SET utf8mb4;
  1. Create table notifications with this query:
CREATE TABLE `core`.`notifications` (
  `id` binary(16) NOT NULL PRIMARY KEY,
  `title` VARCHAR(100) NOT NULL,
  `content` VARCHAR(500) NOT NULL,
  `from` VARCHAR(45) NOT NULL,
  `to` VARCHAR(45) NOT NULL,
  `timestamp` INT UNSIGNED NOT NULL,
  `type` TINYINT(20) NOT NULL
);
  1. Create table meetings with this query:
CREATE TABLE `core`.`meetings` (
  `id` binary(16) NOT NULL PRIMARY KEY,
  `group_id` BINARY(16) NOT NULL,
  `meeting_timestamp` INT UNSIGNED NOT NULL,
  `teacher` VARCHAR(100) NULL,
  `student` VARCHAR(100) NOT NULL,
  `topic` VARCHAR(150) NOT NULL,
  `realization` VARCHAR(45) NOT NULL,
  `meeting_class` VARCHAR(20) NULL,
  `arrangement_timestamp` INT UNSIGNED NOT NULL,
  `evaluation` VARCHAR(250) NULL,
  `description` VARCHAR(250) NULL,
  `created_by` VARCHAR(100) NOT NULL,
  UNIQUE INDEX `id_UNIQUE` (`id` ASC));
  1. Create table students with this query:
CREATE TABLE `core`.`accounts` (
  `id` VARCHAR(50) NOT NULL,
  `name` VARCHAR(100) NOT NULL,
  `class` VARCHAR(25) NOT NULL,
  `password` BINARY(64) NULL,
  `type` ENUM("student", "teacher", "other") NOT NULL,
  PRIMARY KEY (`id`));

About

Implementation of Bintang Mulia's new tutor system.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published