- Session control (session token & refresh token)
- Real time notification
- Authorization implementation on every route and websocket
- Customizable display settings
-
Install poetry
-
Change the directory to backend using
cd backend
-
Run
poetry install
to install dependencies. -
[optional] Change the
venv
andvenvPath
inpyrightconfig.json
to be the venv name and absolute path (info displayed before install starts) -
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"
}
- Start the API by using
poetry run backend
(It will run on port 8000)
-
Install node.js
-
Change the directory to frontend using
cd frontend
-
Install all the required packages using
npm install
-
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
-
Build the web app using
npm run build
(It will run on port 3000) -
Start the web app using
serve -s build
(runnpm install -g serve
if it hasn't been installed)
-
Connect to a MySQL database, you should already have MySQL database properly configured. (Using MySQL workbench is recommended)
-
Create schema named
core
CREATE SCHEMA `core` DEFAULT CHARACTER SET utf8mb4;
- 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
);
- 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));
- 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`));