Software Design and Implementation Document
Software Design and Implementation Document
Document
Project Name: Knowledge Management System
Version: 1.0
Date: December 31st, 2024
Prepared by:
1. Introduction
a. Introduction to the Project:
The purpose of the KMS is to address common challenges faced by educators and
institutions, such as scattered resources, lack of version control, and inefficient sharing
methods. The system empowers users to:
Significance:
● Enhances Productivity: Reduces the time spent searching for resources and
managing users.
● Encourages Collaboration: Provides shared access to materials and tools,
fostering teamwork.
● Ensures Secure Storage: Offers controlled access to sensitive information
through role-based permissions.
● Supports Seamless Workflows: Facilitates efficient management of both
content and user roles, streamlining operations across the institution.
● User Management: Simplifies account creation, role assignment, and
permission handling to ensure a smooth user experience while maintaining
security and compliance.
c. Scope and Target Users:
Scope:
The system is scalable and can be implemented across various educational
institutions, including schools, colleges, and universities. It supports multiple file types and
allows users to manage their files through features like uploading, modifying, and deleting
resources.
Target Users:
1. Lecturers and Teachers: To store lesson plans, presentations, and educational
materials.
2. Departments: To manage administrative files and shared resources.
d. Summary of Key Features:
Documents Management:
Version Control:
Access Control:
● Assign roles and permissions to ensure secure file sharing and management.
Collaboration Tools:
Activity Logs:
● Monitor file access and modifications for accountability.
Cloud Integration:
Frontend:
Backend:
● Python with FastAPI: A modern and high-performance web framework ideal for
building APIs, known for its speed and intuitive design.
Database:
● MongoDB: A NoSQL database that stores file metadata and user information in a
flexible, document-oriented format, allowing for efficient handling of unstructured
data.
2. Software Architecture
The software is based on a Client-Server architecture, where the mobile app (client)
communicates with a remote server to fetch and store data. The server hosts the business logic
and interacts with a relational database.
3. Functional Requirements
a. Knowledge Management:
● File Upload:
Users (lecturers, teachers, departments) can upload files of various
formats, including:
○ PDFs
○ Images
○ Word documents
○ Text files
○ Other common formats
● File Editing:
Users can modify uploaded files by replacing them or updating file
metadata (e.g., title, description, tags).
● File Deletion:
Users can delete files they no longer need while ensuring accidental
deletion is prevented with a confirmation step.
● Version control: Maintain a history of file updates to allow users to:
○ View previous versions.
○ Restore older versions if needed.
● Activity Logs: Track user actions, such as file uploads, modifications,
deletions, and logins, for accountability and auditing.
● Collaboration Tools: Allow users to share files with specific individuals
or groups. Enable co-editing or commenting on shared files to encourage
collaboration.
b. File Viewing and Searching:
● File List Display:
Display a list of uploaded files with essential details, such as name, type,
upload date, and owner.
● Search and Filter:
Users can search and filter files by:
○ File type
○ Upload date
○ Tags
○ Owner
c. User Authentication and Authorization:
● Secure Login and Registration:
Implement OAuth for secure user authentication, ensuring only authorized
users can access the system.
● Role-Based Access Control:
Assign permissions based on user roles, such as:
○ Admin: Full access to all files and system settings.
○ Department: Access to department-specific files.
○ Lecturer/Teacher: Access to their own and shared resources.
4. Database Design
4.1 Identify Entities And Relationships
4.2 Tables
❖ User
➢ Fields:
■ The User entity has attributes like UserID, Name, Email, Password,
RoleID, and DepartmentID. These become the fields in the User table.
➢ Data Types:
■ UserID is an integer (INT).
■ Name, Email, and Password are strings with fixed lengths (VARCHAR).
■ RoleID and DepartmentID are integers (INT) because they reference
other tables.
➢ Constraints:
■ UserID, Name, Email, and Password cannot be null (NOT NULL).
■ RoleID and DepartmentID cannot be null because every user must belong
to a role and department.
➢ Keys:
■ UserID is the primary key (Y(P)).
■ RoleID and DepartmentID are foreign keys
❖ FileManager
➢ Fields:
■ FileManagerID: Primary key for FileManager table.
■ UserID: Foreign key referencing the User table.
■ DocID: Foreign key referencing the Document table
➢ Keys:
■ Both DocID and TagID are foreign keys.
❖ Document
➢ Fields:
■ The Document entity has attributes like DocID, Name, Type,
DepartmentID, and CurrentVersion. These become the fields in the
Document table.
➢ Data Types:
■ DocID is an integer (INT).
■ Name is a string with a fixed length (VARCHAR).
■ Type is a string with a fixed length (VARCHAR).
■ DepartmentID is an integer (INT) because it references the Department
table.
■ CurrentVersion is an integer (INT)
➢ Constraints:
■ DocID, Name and DepartmentID cannot be null (NOT NULL).
■ Type and CurrentVersion can be null (optional).
➢ Keys:
■ DocID is the primary key (Y(P)).
■ DepartmentID, and CurrentVersion is foreign keys
❖ DocumentTag
➢ Fields:
■ DocID: Foreign key referencing the File table.
■ TagID: Foreign key referencing the Tag table.
➢ Keys:
■ Composite Primary Key: (DocID, TagID).
■ Both DocID and TagID are foreign keys.
❖ Tag
➢ Fields:
■ The Tag entity has attributes like TagID, Name, and DocID. These
become the fields in the Tag table.
➢ Data Types:
■ TagID is an integer (INT).
■ Name is a string with a fixed length (VARCHAR).
■ DocID is an integer (INT) because it references the Document table.
➢ Constraints:
■ TagID, Name, and DocID cannot be null (NOT NULL).
➢ Keys:
■ TagID is the primary key (Y(P)).
■ DocID is a foreign key
❖ Department
➢ Fields:
■ The Department entity has attributes like DepartmentID, Name, and
Description. These become the fields in the Department table.
➢ Data Types:
■ DepartmentID is an integer (INT).
■ Name is a string with a fixed length (VARCHAR).
■ Description is a long text (TEXT).
➢ Constraints:
■ DepartmentID and Name cannot be null (NOT NULL).
■ Description can be null (optional).
➢ Keys:
■ DepartmentID is the primary key (Y(P)).
❖ Activity Log
➢ Fields:
■ The ActivityLog entity has attributes like LogID, UserID, DocID, Action,
Description, and Date. These become the fields in the ActivityLog table.
➢ Data Types:
■ LogID is an integer (INT).
■ UserID is an integer (INT) because it references the User table.
■ DocID is an integer (INT) because it references the Document table.
■ Action is a string with a fixed length (VARCHAR).
■ Date is a date and time (DATETIME).
➢ Constraints:
■ LogID, UserID, DocID, Action, and Date cannot be null (NOT NULL).
■ Description can be null (optional).
➢ Keys:
■ LogID is the primary key (Y(P)).
■ UserID and DocID are foreign keys
❖ Version
➢ Fields:
■ The Version entity has attributes like VersionID, DocID, VersionNumber,
ModifiedBy, ModificationDate, and FilePath. These become the fields in
the Version table.
➢ Data Types:
■ VersionID is an integer (INT).
■ DocID is an integer (INT) because it references the Document table.
■ VersionNumber is an integer (INT).
■ ModifiedBy is an integer (INT) because it references the User table.
■ ModificationDate is a date and time (DATETIME).
■ FilePath is a string with a fixed length (VARCHAR).
➢ Constraints:
■ VersionID, DocID, VersionNumber, ModifiedBy, ModificationDate, and
FilePath cannot be null (NOT NULL).
➢ Keys:
■ VersionID is the primary key (Y(P)).
■ DocID and ModifiedBy are foreign keys
6. System Design
6.1 Frontend Design
● Model: Represents the data and business logic (task data, user credentials, etc.).
● View: The UI components responsible for displaying data and receiving user input.
● ViewModel: A layer that communicates between the View and the Model, managing UI
state and updating the View based on changes in the data model.
The backend is built using Node.js with the Express framework. The server exposes a RESTful
API, and communication is done via HTTP requests with JSON responses.
7. API Design
7.1 Endpoints
● POST /auth/register
Registers a new user.
Request Body: { "email": "[email protected]", "password":
"password123" }
Response: { "token": "jwt_token" }
● POST /auth/login
Authenticates a user and returns a JWT token.
Request Body: { "email": "[email protected]", "password":
"password123" }
Response: { "token": "jwt_token" }
● GET /tasks
Fetches a list of tasks for the authenticated user.
Headers: { "Authorization": "Bearer jwt_token" }
Response: { "tasks": [{ "task_id": 1, "title": "Task 1",
"due_date": "2024-12-31" }] }
● POST /tasks
Creates a new task.
Request Body: { "title": "New Task", "description": "Description",
"due_date": "2024-12-31", "priority": "High" }
Response: { "task_id": 1 }
● PUT /tasks/{task_id}
Updates an existing task.
Request Body: { "title": "Updated Task", "description": "Updated
description", "due_date": "2024-12-31", "priority": "Medium" }
Response: { "task_id": 1 }
8. Implementation Plan
8.1 Milestones
9. Testing Strategy
9.1 Unit Testing
● Perform UAT with stakeholders to ensure that the system meets business requirements.
10. Conclusion
This document outlines the complete design and implementation plan for the MyApp application.
By following this plan, we aim to build a robust, scalable, and secure task management system
that provides an excellent user experience.