Kshitij2604 commited on
Commit
6f7fccc
Β·
verified Β·
1 Parent(s): 6a95647

Upload 34 files

Browse files
Files changed (5) hide show
  1. README.md +172 -171
  2. app.py +100 -36
  3. domain_descriptions.json +12 -0
  4. projects.json +32 -0
  5. students.json +20 -0
README.md CHANGED
@@ -1,171 +1,172 @@
1
- ---
2
- title: Project Management System
3
- emoji: πŸš€
4
- colorFrom: blue
5
- colorTo: indigo
6
- sdk: gradio
7
- sdk_version: 5.22.0
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- # Project Management System
13
-
14
- A web-based project management system for managing student projects across different domains.
15
-
16
- ## Features
17
-
18
- - User Authentication (Student/Faculty)
19
- - Project Management
20
- - Domain-based Project Organization
21
- - Student Project Assignment
22
- - Admin Panel
23
- - Responsive Design
24
-
25
- ## Local Development
26
-
27
- 1. Clone the repository
28
- 2. Install Python dependencies:
29
- ```bash
30
- pip install -r requirements.txt
31
- ```
32
- 3. Set up your environment variables in a `.env` file:
33
- ```
34
- DB_HOST=localhost
35
- DB_USER=root
36
- DB_PASSWORD=your_password
37
- DB_NAME=dms
38
- ```
39
- 4. Run the application:
40
- ```bash
41
- python app.py
42
- ```
43
-
44
- ## Database Setup
45
-
46
- 1. Create a MySQL database named 'dms'
47
- 2. Import the database schema from `dms.sql`
48
- 3. Run `create_domain_descriptions.php` to set up domain descriptions
49
-
50
- ## Directory Structure
51
-
52
- ```
53
- β”œβ”€β”€ app.py # Gradio application
54
- β”œβ”€β”€ requirements.txt # Python dependencies
55
- β”œβ”€β”€ index.php # Homepage
56
- β”œβ”€β”€ domains.php # Domain listing
57
- β”œβ”€β”€ project_*.php # Project management files
58
- β”œβ”€β”€ admin.php # Admin panel
59
- β”œβ”€β”€ css/ # Stylesheets
60
- β”œβ”€β”€ js/ # JavaScript files
61
- β”œβ”€β”€ includes/ # PHP includes
62
- └── ajax/ # AJAX handlers
63
- ```
64
-
65
- ## Security Considerations
66
-
67
- - All user inputs are sanitized
68
- - Passwords are hashed using secure methods
69
- - Session management is implemented
70
- - Access control is enforced based on user roles
71
-
72
- ## Contributing
73
-
74
- 1. Fork the repository
75
- 2. Create a feature branch
76
- 3. Commit your changes
77
- 4. Push to the branch
78
- 5. Create a Pull Request
79
-
80
- ## License
81
-
82
- This project is licensed under the MIT License - see the LICENSE file for details.
83
-
84
- # Domain Management System
85
-
86
- A web-based platform to explore, search, and view projects across various domains, based on the DMS database.
87
-
88
- ## Features
89
-
90
- - **Browse Domains**: View all available domains in the system and their associated projects.
91
- - **Project Search**: Search for projects by name, description, domain, or type (Hardware/Software).
92
- - **Project Details**: View detailed information about each project, including descriptions, contact information, and associated resources.
93
- - **Student Information**: If the student table exists, search and view student information related to projects.
94
- - **Dynamic Data Fetching**: The system automatically fetches data from parent tables, avoiding manual duplication of data.
95
- - **Domain Descriptions**: Domain descriptions are automatically generated from the database or fallback to defaults.
96
-
97
- ## Setup Instructions
98
-
99
- ### Prerequisites
100
-
101
- - Web server with PHP support (e.g., Apache, Nginx)
102
- - MySQL/MariaDB database server
103
- - PHP 7.0 or higher
104
-
105
- ### Database Setup
106
-
107
- 1. Create a new database named `dms` in your MySQL server:
108
- ```sql
109
- CREATE DATABASE dms;
110
- ```
111
-
112
- 2. Import the SQL file (`dms (2).sql`) into your database:
113
- - Using phpMyAdmin: Go to the Import tab, select the SQL file, and click "Go"
114
- - Using MySQL command line:
115
- ```
116
- mysql -u username -p dms < "dms (2).sql"
117
- ```
118
-
119
- 3. (Optional) Create domain descriptions table:
120
- - Access the `create_domain_descriptions.php` script in your browser to create and populate the domain_descriptions table
121
- - This step is optional but recommended for better organization of domain metadata
122
-
123
- ### Web Application Setup
124
-
125
- 1. Copy all files to your web server's document root (or a subdirectory).
126
- 2. Update the database connection details in `includes/db_connect.php` if needed.
127
- 3. Make sure your web server has permissions to read/write to the files.
128
- 4. Access the website through your web browser.
129
-
130
- ## Database Structure
131
-
132
- The database consists of multiple tables:
133
-
134
- - `domain_1` through `domain_12`: Tables containing projects from different domains
135
- - `students_info`: Table containing student information (if available)
136
- - `domain_descriptions`: Optional table for storing domain descriptions
137
-
138
- Each domain table has a similar structure with fields like:
139
- - `Domain_ID`
140
- - `Project_ID`
141
- - `Project_Name`/`Project _Name`
142
- - `Email`
143
- - `H/S` (Hardware/Software)
144
- - `Description`
145
- - `Links`
146
-
147
- ## Dynamic Data Handling
148
-
149
- The system uses several utility functions to automatically fetch and process data:
150
-
151
- - **Domain Descriptions**: Automatically fetched from the domain_descriptions table if it exists, otherwise falls back to default values
152
- - **Project Names**: The system handles different column naming conventions across tables
153
- - **Cross-Domain Search**: Searches can be performed across all domain tables simultaneously
154
- - **Student-Project Association**: Student data is linked dynamically to projects for comprehensive viewing
155
-
156
- ## Usage
157
-
158
- 1. **Home Page**: View basic statistics and recent projects from all domains
159
- 2. **Domains Page**: Browse all domains and access their projects
160
- 3. **Projects Page**: Search for projects across all domains with advanced filtering
161
- 4. **Students Page**: Search for students by name, division, or domain (if the table exists)
162
-
163
- ## Troubleshooting
164
-
165
- - If you encounter database connection errors, verify that the credentials in `includes/db_connect.php` are correct.
166
- - Make sure that the `dms` database has been properly imported with all required tables.
167
- - Check your PHP error logs if you're experiencing issues with the website.
168
-
169
- ## Credits
170
-
171
- Created as a Database Management System project.
 
 
1
+ ---
2
+ title: Project Management System
3
+ emoji: πŸš€
4
+ colorFrom: blue
5
+ colorTo: indigo
6
+ sdk: gradio
7
+ sdk_version: "3.50.2"
8
+
9
+ app_file: app.py
10
+ pinned: false
11
+ ---
12
+
13
+ # Project Management System
14
+
15
+ A web-based project management system for managing student projects across different domains.
16
+
17
+ ## Features
18
+
19
+ - User Authentication (Student/Faculty)
20
+ - Project Management
21
+ - Domain-based Project Organization
22
+ - Student Project Assignment
23
+ - Admin Panel
24
+ - Responsive Design
25
+
26
+ ## Local Development
27
+
28
+ 1. Clone the repository
29
+ 2. Install Python dependencies:
30
+ ```bash
31
+ pip install -r requirements.txt
32
+ ```
33
+ 3. Set up your environment variables in a `.env` file:
34
+ ```
35
+ DB_HOST=localhost
36
+ DB_USER=root
37
+ DB_PASSWORD=your_password
38
+ DB_NAME=dms
39
+ ```
40
+ 4. Run the application:
41
+ ```bash
42
+ python app.py
43
+ ```
44
+
45
+ ## Database Setup
46
+
47
+ 1. Create a MySQL database named 'dms'
48
+ 2. Import the database schema from `dms.sql`
49
+ 3. Run `create_domain_descriptions.php` to set up domain descriptions
50
+
51
+ ## Directory Structure
52
+
53
+ ```
54
+ β”œβ”€β”€ app.py # Gradio application
55
+ β”œβ”€β”€ requirements.txt # Python dependencies
56
+ β”œβ”€β”€ index.php # Homepage
57
+ β”œβ”€β”€ domains.php # Domain listing
58
+ β”œβ”€β”€ project_*.php # Project management files
59
+ β”œβ”€β”€ admin.php # Admin panel
60
+ β”œβ”€β”€ css/ # Stylesheets
61
+ β”œβ”€β”€ js/ # JavaScript files
62
+ β”œβ”€β”€ includes/ # PHP includes
63
+ └── ajax/ # AJAX handlers
64
+ ```
65
+
66
+ ## Security Considerations
67
+
68
+ - All user inputs are sanitized
69
+ - Passwords are hashed using secure methods
70
+ - Session management is implemented
71
+ - Access control is enforced based on user roles
72
+
73
+ ## Contributing
74
+
75
+ 1. Fork the repository
76
+ 2. Create a feature branch
77
+ 3. Commit your changes
78
+ 4. Push to the branch
79
+ 5. Create a Pull Request
80
+
81
+ ## License
82
+
83
+ This project is licensed under the MIT License - see the LICENSE file for details.
84
+
85
+ # Domain Management System
86
+
87
+ A web-based platform to explore, search, and view projects across various domains, based on the DMS database.
88
+
89
+ ## Features
90
+
91
+ - **Browse Domains**: View all available domains in the system and their associated projects.
92
+ - **Project Search**: Search for projects by name, description, domain, or type (Hardware/Software).
93
+ - **Project Details**: View detailed information about each project, including descriptions, contact information, and associated resources.
94
+ - **Student Information**: If the student table exists, search and view student information related to projects.
95
+ - **Dynamic Data Fetching**: The system automatically fetches data from parent tables, avoiding manual duplication of data.
96
+ - **Domain Descriptions**: Domain descriptions are automatically generated from the database or fallback to defaults.
97
+
98
+ ## Setup Instructions
99
+
100
+ ### Prerequisites
101
+
102
+ - Web server with PHP support (e.g., Apache, Nginx)
103
+ - MySQL/MariaDB database server
104
+ - PHP 7.0 or higher
105
+
106
+ ### Database Setup
107
+
108
+ 1. Create a new database named `dms` in your MySQL server:
109
+ ```sql
110
+ CREATE DATABASE dms;
111
+ ```
112
+
113
+ 2. Import the SQL file (`dms (2).sql`) into your database:
114
+ - Using phpMyAdmin: Go to the Import tab, select the SQL file, and click "Go"
115
+ - Using MySQL command line:
116
+ ```
117
+ mysql -u username -p dms < "dms (2).sql"
118
+ ```
119
+
120
+ 3. (Optional) Create domain descriptions table:
121
+ - Access the `create_domain_descriptions.php` script in your browser to create and populate the domain_descriptions table
122
+ - This step is optional but recommended for better organization of domain metadata
123
+
124
+ ### Web Application Setup
125
+
126
+ 1. Copy all files to your web server's document root (or a subdirectory).
127
+ 2. Update the database connection details in `includes/db_connect.php` if needed.
128
+ 3. Make sure your web server has permissions to read/write to the files.
129
+ 4. Access the website through your web browser.
130
+
131
+ ## Database Structure
132
+
133
+ The database consists of multiple tables:
134
+
135
+ - `domain_1` through `domain_12`: Tables containing projects from different domains
136
+ - `students_info`: Table containing student information (if available)
137
+ - `domain_descriptions`: Optional table for storing domain descriptions
138
+
139
+ Each domain table has a similar structure with fields like:
140
+ - `Domain_ID`
141
+ - `Project_ID`
142
+ - `Project_Name`/`Project _Name`
143
+ - `Email`
144
+ - `H/S` (Hardware/Software)
145
+ - `Description`
146
+ - `Links`
147
+
148
+ ## Dynamic Data Handling
149
+
150
+ The system uses several utility functions to automatically fetch and process data:
151
+
152
+ - **Domain Descriptions**: Automatically fetched from the domain_descriptions table if it exists, otherwise falls back to default values
153
+ - **Project Names**: The system handles different column naming conventions across tables
154
+ - **Cross-Domain Search**: Searches can be performed across all domain tables simultaneously
155
+ - **Student-Project Association**: Student data is linked dynamically to projects for comprehensive viewing
156
+
157
+ ## Usage
158
+
159
+ 1. **Home Page**: View basic statistics and recent projects from all domains
160
+ 2. **Domains Page**: Browse all domains and access their projects
161
+ 3. **Projects Page**: Search for projects across all domains with advanced filtering
162
+ 4. **Students Page**: Search for students by name, division, or domain (if the table exists)
163
+
164
+ ## Troubleshooting
165
+
166
+ - If you encounter database connection errors, verify that the credentials in `includes/db_connect.php` are correct.
167
+ - Make sure that the `dms` database has been properly imported with all required tables.
168
+ - Check your PHP error logs if you're experiencing issues with the website.
169
+
170
+ ## Credits
171
+
172
+ Created as a Database Management System project.
app.py CHANGED
@@ -1,55 +1,119 @@
1
  import gradio as gr
2
  import os
3
- import subprocess
4
- import tempfile
5
- import shutil
6
 
7
- def execute_php(php_file):
 
8
  try:
9
- # Create a temporary directory for PHP execution
10
- with tempfile.TemporaryDirectory() as temp_dir:
11
- # Copy the PHP file to temp directory
12
- shutil.copy2(php_file, os.path.join(temp_dir, 'index.php'))
13
-
14
- # Copy all required directories
15
- for dir_name in ['css', 'js', 'includes', 'ajax']:
16
- if os.path.exists(dir_name):
17
- shutil.copytree(dir_name, os.path.join(temp_dir, dir_name))
18
-
19
- # Execute PHP using the system's PHP interpreter
20
- result = subprocess.run(
21
- ['php', '-n', '-d', 'display_errors=1', '-d', 'error_reporting=E_ALL', 'index.php'],
22
- cwd=temp_dir,
23
- capture_output=True,
24
- text=True
25
- )
26
-
27
- return result.stdout
28
- except Exception as e:
29
- return f"Error executing PHP: {str(e)}"
30
-
31
- def serve_static_file(filepath):
32
  try:
33
- with open(filepath, 'rb') as f:
34
- return f.read()
35
- except Exception as e:
36
- return f"Error reading file: {str(e)}"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  # Create Gradio interface
39
  with gr.Blocks() as demo:
40
  gr.Markdown("# Project Management System")
41
 
42
  with gr.Tab("Home"):
43
- gr.Markdown(execute_php('index.php'))
44
 
45
  with gr.Tab("Domains"):
46
- gr.Markdown(execute_php('domains.php'))
47
 
48
  with gr.Tab("Projects"):
49
- gr.Markdown(execute_php('domain_projects.php'))
50
 
51
- with gr.Tab("Admin"):
52
- gr.Markdown(execute_php('admin.php'))
53
 
54
  # Launch the interface
55
  if __name__ == "__main__":
 
1
  import gradio as gr
2
  import os
3
+ import json
4
+ from datetime import datetime
 
5
 
6
+ # Load domain descriptions
7
+ def load_domain_descriptions():
8
  try:
9
+ with open('domain_descriptions.json', 'r') as f:
10
+ return json.load(f)
11
+ except FileNotFoundError:
12
+ return {}
13
+
14
+ # Load projects data
15
+ def load_projects():
16
+ try:
17
+ with open('projects.json', 'r') as f:
18
+ return json.load(f)
19
+ except FileNotFoundError:
20
+ return {}
21
+
22
+ # Load students data
23
+ def load_students():
 
 
 
 
 
 
 
 
24
  try:
25
+ with open('students.json', 'r') as f:
26
+ return json.load(f)
27
+ except FileNotFoundError:
28
+ return []
29
+
30
+ def get_domain_stats():
31
+ projects = load_projects()
32
+ students = load_students()
33
+ domains = load_domain_descriptions()
34
+
35
+ total_projects = len(projects)
36
+ total_students = len(students)
37
+ total_domains = len(domains)
38
+
39
+ return f"""
40
+ ### Project Management System Statistics
41
+
42
+ - **Total Domains:** {total_domains}
43
+ - **Total Projects:** {total_projects}
44
+ - **Total Students:** {total_students}
45
+ """
46
+
47
+ def get_domain_list():
48
+ domains = load_domain_descriptions()
49
+ projects = load_projects()
50
+
51
+ domain_list = []
52
+ for domain_id, description in domains.items():
53
+ domain_projects = [p for p in projects.values() if p.get('domain') == domain_id]
54
+ project_count = len(domain_projects)
55
+
56
+ domain_list.append(f"""
57
+ ### Domain {domain_id}
58
+ {description}
59
+
60
+ **Projects:** {project_count}
61
+ """)
62
+
63
+ return "\n".join(domain_list)
64
+
65
+ def get_project_list():
66
+ projects = load_projects()
67
+ students = load_students()
68
+
69
+ project_list = []
70
+ for project_id, project in projects.items():
71
+ assigned_students = [s for s in students if project_id in s.get('projects', [])]
72
+ student_names = ", ".join([s['name'] for s in assigned_students])
73
+
74
+ project_list.append(f"""
75
+ ### {project['name']}
76
+ **Domain:** {project['domain']}
77
+ **Type:** {'Hardware' if project.get('type') == 'H' else 'Software'}
78
+ **Description:** {project.get('description', 'No description available')}
79
+ **Assigned Students:** {student_names if student_names else 'None'}
80
+ """)
81
+
82
+ return "\n".join(project_list)
83
+
84
+ def get_student_list():
85
+ students = load_students()
86
+ projects = load_projects()
87
+
88
+ student_list = []
89
+ for student in students:
90
+ student_projects = [projects.get(pid) for pid in student.get('projects', [])]
91
+ project_names = ", ".join([p['name'] for p in student_projects if p])
92
+
93
+ student_list.append(f"""
94
+ ### {student['name']}
95
+ **ID:** {student['id']}
96
+ **Email:** {student['email']}
97
+ **Projects:** {project_names if project_names else 'None'}
98
+ """)
99
+
100
+ return "\n".join(student_list)
101
 
102
  # Create Gradio interface
103
  with gr.Blocks() as demo:
104
  gr.Markdown("# Project Management System")
105
 
106
  with gr.Tab("Home"):
107
+ gr.Markdown(get_domain_stats())
108
 
109
  with gr.Tab("Domains"):
110
+ gr.Markdown(get_domain_list())
111
 
112
  with gr.Tab("Projects"):
113
+ gr.Markdown(get_project_list())
114
 
115
+ with gr.Tab("Students"):
116
+ gr.Markdown(get_student_list())
117
 
118
  # Launch the interface
119
  if __name__ == "__main__":
domain_descriptions.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "1": "Machine Learning and Artificial Intelligence",
3
+ "2": "Web Development and Cloud Computing",
4
+ "3": "Cybersecurity and Network Security",
5
+ "4": "Mobile Application Development",
6
+ "5": "Data Science and Analytics",
7
+ "6": "Internet of Things (IoT)",
8
+ "7": "Blockchain Technology",
9
+ "8": "Computer Vision and Image Processing",
10
+ "9": "Natural Language Processing",
11
+ "10": "Robotics and Automation"
12
+ }
projects.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "1": {
3
+ "name": "AI Image Recognition System",
4
+ "domain": "1",
5
+ "type": "S",
6
+ "description": "A deep learning-based system for real-time image recognition using convolutional neural networks."
7
+ },
8
+ "2": {
9
+ "name": "Secure Cloud Storage",
10
+ "domain": "2",
11
+ "type": "S",
12
+ "description": "A cloud storage solution with end-to-end encryption and secure file sharing capabilities."
13
+ },
14
+ "3": {
15
+ "name": "Network Intrusion Detection",
16
+ "domain": "3",
17
+ "type": "S",
18
+ "description": "An AI-powered system for detecting and preventing network intrusions in real-time."
19
+ },
20
+ "4": {
21
+ "name": "Mobile Health Tracker",
22
+ "domain": "4",
23
+ "type": "S",
24
+ "description": "A cross-platform mobile application for tracking health metrics and providing personalized recommendations."
25
+ },
26
+ "5": {
27
+ "name": "Predictive Analytics Dashboard",
28
+ "domain": "5",
29
+ "type": "S",
30
+ "description": "A web-based dashboard for visualizing and analyzing predictive models for business intelligence."
31
+ }
32
+ }
students.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "id": "STU001",
4
+ "name": "John Doe",
5
+ "email": "john.doe@example.com",
6
+ "projects": ["1", "2"]
7
+ },
8
+ {
9
+ "id": "STU002",
10
+ "name": "Jane Smith",
11
+ "email": "jane.smith@example.com",
12
+ "projects": ["3"]
13
+ },
14
+ {
15
+ "id": "STU003",
16
+ "name": "Mike Johnson",
17
+ "email": "mike.johnson@example.com",
18
+ "projects": ["4", "5"]
19
+ }
20
+ ]