0% found this document useful (0 votes)
7 views10 pages

Management System Documentation

AI waste management system

Uploaded by

lazarus
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views10 pages

Management System Documentation

AI waste management system

Uploaded by

lazarus
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Management System Documentation

1. Introduction
This documentation provides an overview of the Management System's design and
functionalities. The system supports user management for roles including student, teacher,
and admin, with functionalities for course management, fee payments, and assignments.

2. System Overview
2.1. Frontend

 Technologies: JavaScript, HTML, Node.js


 Login and Signup Pages:
o Login Page: Allows users to log in with email, password, and role (student,
teacher, admin). Below is login

o Signup Page: Allows users to register with first name, last name, email,
password, and role.
 Dashboards:

1. Student Dashboard: Below is student dashboard details

I. Apply for Course: Students can apply for courses. Applications are reviewed by
admins.

II. View Assignments: Students can download assignments set by teachers.


III. Make Fee Payment: Students can pay fees using PayPal.

IV. Submit Assignment: Students can submit assignments by posting Google Drive links.

2.Teacher Dashboard:

a. Set Assignments: Teachers can post assignment links using Google Drive.
b. Mark Assignments: Teachers can access and mark student assignments.

c. View Grades: Teachers can set and view student grades.

3. Admin Dashboard:

I. Approve Course Application: Admins review and approve or reject student course
applications.

II. View Fee Payment: Admins review fee payments and update student payment
statuses.
2.2. Backend

Done On: 2024-11-07


Done By: Lazarus Iteke Wafula
Database Name: MANAGEMENT SYSTEM
Schema Name: App

 Technologies: PostgreSQL, Node.js


 Database: PostgreSQL manages data with tables and relationships as described in the
schema.

3. Database Schema
3.1. Schema Creation
CREATE SCHEMA IF NOT EXISTS app;

3.2. Table Definitions

3.2.1. app.person Table

Stores user details.

CREATE TABLE app.person (


person_id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT 1),
first_name VARCHAR(100) NOT NULL,
last_name VARCHAR(100) NOT NULL,
email VARCHAR(100) NOT NULL,
password VARCHAR(100) NOT NULL,
role VARCHAR(100) NOT NULL,
PRIMARY KEY (person_id)
);

3.2.2. app.student Table

Stores student-specific information.

CREATE TABLE app.student (


student_id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT 1),
institution_id INT,
person_id INT,
PRIMARY KEY (student_id),
FOREIGN KEY (institution_id) REFERENCES app.institution (institution_id),
FOREIGN KEY (person_id) REFERENCES app.person (person_id)
);

3.2.3. app.teacher Table

Stores teacher-specific information.

CREATE TABLE app.teacher (


teacher_id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT 1),
spec_id INT,
employee_id INT,
course_id INT,
person_id INT,
PRIMARY KEY (teacher_id),
FOREIGN KEY (spec_id) REFERENCES app.specialization (spec_id),
FOREIGN KEY (employee_id) REFERENCES app.employee (employee_id),
FOREIGN KEY (course_id) REFERENCES app.course (course_id),
FOREIGN KEY (person_id) REFERENCES app.person (person_id)
);

3.2.4. app.course Table

Stores course information.

CREATE TABLE app.course (


course_id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT 1),
course_name VARCHAR(100) NOT NULL,
course_description VARCHAR(100) NOT NULL,
course_price DECIMAL(10, 2) NOT NULL,
PRIMARY KEY (course_id)
);

3.2.5. app.content Table

Stores course content details.

CREATE TABLE app.content (


content_id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT 1),
course_id INT,
ContentTitle VARCHAR(100) NOT NULL,
ContentType VARCHAR(50) NOT NULL,
ContentURL VARCHAR(255) NOT NULL,
PRIMARY KEY (content_id),
FOREIGN KEY (course_id) REFERENCES app.course (course_id)
);

3.2.6. app.payment Table

Stores payment details.

CREATE TABLE app.payment (


payment_id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT 1),
student_id INT,
Amount DECIMAL(10, 2) NOT NULL,
PaymentDate DATE NOT NULL,
payment_method VARCHAR(100) NOT NULL,
PRIMARY KEY (payment_id),
FOREIGN KEY (student_id) REFERENCES app.student (student_id)
);

3.2.7. app.bill Table

Stores billing details.

CREATE TABLE app.bill (


bill_id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT 1),
payment_id INT,
BillAmount DECIMAL(10, 2) NOT NULL,
BillStatus VARCHAR(10) NOT NULL,
PRIMARY KEY (bill_id),
FOREIGN KEY (payment_id) REFERENCES app.payment (payment_id)
);

3.2.8. app.rebate Table

Stores rebate information.

CREATE TABLE app.rebate (


rebate_id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT 1),
institution_id INT,
RebateAmount DECIMAL(10, 2) NOT NULL,
PRIMARY KEY (rebate_id),
FOREIGN KEY (institution_id) REFERENCES app.institution (institution_id)
);

3.2.9. app.specialization Table

Stores specialization details.

CREATE TABLE app.specialization (


spec_id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT 1),
specialization_name VARCHAR(100) NOT NULL,
description VARCHAR(100) NOT NULL,
PRIMARY KEY (spec_id)
);

3.2.10. app.employee Table

Stores employee information.

CREATE TABLE app.employee (


employee_id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT 1),
Role VARCHAR(50) NOT NULL,
person_id INT,
PRIMARY KEY (employee_id),
FOREIGN KEY (person_id) REFERENCES app.person (person_id)
);

3.2.11. app.institution Table

Stores institution details.

CREATE TABLE app.institution (


institution_id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT
1),
InstitutionName VARCHAR(100),
PRIMARY KEY (institution_id)
);
3.2.12. app.course_student Table

Junction table for many-to-many relationship between courses and students.

CREATE TABLE app.course_student (


id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT 1),
course_id INT,
student_id INT,
PRIMARY KEY (id),
FOREIGN KEY (course_id) REFERENCES app.course (course_id),
FOREIGN KEY (student_id) REFERENCES app.student (student_id)
);

3.2.13. app.course_teacher Table

Junction table for many-to-many relationship between courses and teachers.

CREATE TABLE app.course_teacher (


id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT 1),
course_id INT,
teacher_id INT,
PRIMARY KEY (id),
FOREIGN KEY (course_id) REFERENCES app.course (course_id),
FOREIGN KEY (teacher_id) REFERENCES app.teacher (teacher_id)
);

3.3. Primary Key Constraints


-- Adding Primary Key Constraints
ALTER TABLE app.admin ADD PRIMARY KEY (id);
ALTER TABLE app.course ADD PRIMARY KEY (course_id);
ALTER TABLE app.person ADD PRIMARY KEY (person_id);
ALTER TABLE app.student ADD PRIMARY KEY (student_id);
ALTER TABLE app.employee ADD PRIMARY KEY (employee_id);
ALTER TABLE app.teacher ADD PRIMARY KEY (teacher_id);
ALTER TABLE app.specialization ADD PRIMARY KEY (spec_id);
ALTER TABLE app.content ADD PRIMARY KEY (content_id);
ALTER TABLE app.payment ADD PRIMARY KEY (payment_id);
ALTER TABLE app.bill ADD PRIMARY KEY (bill_id);
ALTER TABLE app.rebate ADD PRIMARY KEY (rebate_id);
ALTER TABLE app.institution ADD PRIMARY KEY (institution_id);
ALTER TABLE app.course_teacher ADD PRIMARY KEY (id);
ALTER TABLE app.course_student ADD PRIMARY KEY (id);

3.4. Foreign Key Constraints


-- Adding Foreign Key Constraints
ALTER TABLE app.admin ADD CONSTRAINT fk_admin_student FOREIGN KEY (student_id)
REFERENCES app.student (student_id);
ALTER TABLE app.admin ADD CONSTRAINT fk_admin_teacher FOREIGN KEY (teacher_id)
REFERENCES app.teacher (teacher_id);
ALTER TABLE app.admin ADD CONSTRAINT fk_admin_institution FOREIGN KEY (institution_id)
REFERENCES app.institution (institution_id);
ALTER TABLE app.admin ADD CONSTRAINT fk_admin_payment FOREIGN KEY (payment_id)
REFERENCES app.payment (payment_id);
ALTER TABLE app.admin ADD CONSTRAINT fk_admin_bill FOREIGN KEY (bill_id) REFERENCES
app.bill (bill_id);
ALTER TABLE app.student ADD CONSTRAINT fk_student_institution FOREIGN KEY (institution_id)
REFERENCES app.institution (institution_id);
ALTER TABLE app.student ADD CONSTRAINT fk_student_person FOREIGN KEY (person_id)
REFERENCES app.person (person_id);
ALTER TABLE app.teacher ADD CONSTRAINT fk_teacher_spec FOREIGN KEY (spec_id) REFERENCES
app.specialization (spec_id);
ALTER TABLE app.teacher ADD CONSTRAINT fk_teacher_employee FOREIGN KEY (employee_id)
REFERENCES app.employee (employee_id);
ALTER TABLE app.teacher ADD CONSTRAINT fk_teacher_course FOREIGN KEY (course_id)
REFERENCES app.course (course_id);
ALTER TABLE app.teacher ADD CONSTRAINT fk_teacher_person FOREIGN KEY (person_id)
REFERENCES app.person (person_id);
ALTER TABLE app.content ADD CONSTRAINT fk_content_course FOREIGN KEY (course_id)
REFERENCES app.course (course_id);
ALTER TABLE app.payment ADD CONSTRAINT fk_payment_student FOREIGN KEY (student_id)
REFERENCES app.student (student_id);
ALTER TABLE app.bill ADD CONSTRAINT fk_bill_payment FOREIGN KEY (payment_id) REFERENCES
app.payment (payment_id);
ALTER TABLE app.rebate ADD CONSTRAINT fk_rebate_institution FOREIGN KEY (institution_id)
REFERENCES app.institution (institution_id);
ALTER TABLE app.course_student ADD CONSTRAINT fk_course_student_course FOREIGN KEY
(course_id) REFERENCES app.course (course_id);
ALTER TABLE app.course_student ADD CONSTRAINT fk_course_student_student FOREIGN KEY
(student_id) REFERENCES app.student (student_id);
ALTER TABLE app.course_teacher ADD CONSTRAINT fk_course_teacher_course FOREIGN KEY
(course_id) REFERENCES app.course (course_id);
ALTER TABLE app.course_teacher ADD CONSTRAINT fk_course_teacher_teacher FOREIGN KEY
(teacher_id) REFERENCES app.teacher (teacher_id);

4. Data Entry and Management


4.1. User Management

 Registration: Users are added through the app.person table. Based on their role, they
are then associated with specific roles in tables such as student, teacher, or admin.

4.2. Course Management

 Course Creation: Managed through the app.course table.


 Content Management: Managed via the app.content table.
 Assignments: Teachers set assignments via links posted in app.content, visible to
students in their dashboard.

4.3. Fee Management

 Payments: Managed through the app.payment table using PayPal for transactions.
 Billing: Managed through the app.bill table.
 Rebates: Managed via the app.rebate table.

4.4. Dashboard Interactions

 Student Dashboard:
o Apply for Course: Applications sent to Admin for approval.
o View Assignments: Assignments set by teachers.
o Make Fee Payment: Payment through PayPal.
o Submit Assignment: Link submission via Google Drive.
 Teacher Dashboard:
o Set Assignments: Assignment links posted via Google Drive.
o Mark Assignments: Access and grading of assignments.
o View Grades: Grades set for students.
 Admin Dashboard:
o Approve Course Application: Review and approve/reject applications.
o View Fee Payment: Review and update fee payment statuses.

5. Additional Information
 Relationships: Many-to-many relationships are handled using junction tables such as
app.course_student and app.course_teacher.
 Data Integrity: Foreign key constraints ensure referential integrity between related
tables.

6. References
 SQL Reference for Data Definition Language (DDL)

7. Contact Information
For further assistance or inquiries regarding the Management System, please contact:

Lazarus Iteke Wafula


Email: [email protected]
Phone: +254768877400

You might also like