Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
__pycache__/
*.pyc
*.pyo
*.db
*.sqlite
*.sqlite3

.idea/
.vscode/
*.iml

venv/
env/
.venv/
ENV/

build/
dist/
*.spec

.DS_Store
Thumbs.db
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Jenks00

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
129 changes: 127 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,127 @@
# Student-Management-System
A desktop-based School Management System built with Python, Tkinter, and SQLite
# Student Management System

A desktop student records manager built with Python and Tkinter, backed by
a local SQLite database. It supports role-based logins (admin, staff,
student), full CRUD on student records, search, CSV/PDF export, and a
light/dark theme.

<!-- Screenshot placeholder: run the app locally (`python main.py`), log
in, and drop a screenshot of the dashboard here, e.g.:
![Dashboard screenshot](docs/screenshot.png) -->

## Features

- **Role-based login** — three roles with different permissions:
- `admin` — full access: manage students, manage users, export data.
- `staff` — manage students and export data, cannot create new users.
- `student` — read-only access to their own linked record only.
- **Student records CRUD** — add, update, delete, and browse student
records (roll number, name, email, gender, contact, date of birth,
address, and an optional link to a login username).
- **Search** — search by roll number, name, contact, or username, with
partial matching.
- **Sortable, striped data table** — click any column header to sort;
alternating row colors for readability.
- **Export** — export the current table view to CSV, or to a formatted
PDF report.
- **Light/dark theme** — toggle between a light and dark UI at runtime.
- **Input validation** — required fields, email format, phone format, and
date format are all validated in the UI with clear error messages
instead of raw exceptions or silent failures.
- **Password hashing** — user passwords are stored as SHA-256 hashes, not
plaintext.
- **Self-initializing database** — the SQLite database and its tables are
created automatically on first run; nothing needs to be set up by hand.

## Tech stack

Everything the core application needs is in the Python standard library:

- **Python 3** — application language
- **Tkinter / ttk** — GUI toolkit (themed widgets, `ttk.Treeview` data
table, `ttk.Style` for the custom color palette)
- **sqlite3** — embedded database, no server required
- **hashlib / csv / re** — password hashing, CSV export, and input
validation

The only optional, non-standard-library dependency is **reportlab**,
used solely for the "Export PDF" button. If it is not installed, every
other feature (including CSV export) still works normally, and clicking
"Export PDF" shows a clear message telling you how to install it instead
of crashing.

## Project structure

```
Student-Management-System/
├── main.py # Entry point — run this
├── app/
│ ├── database.py # SQLite access layer (schema, CRUD, auth)
│ ├── login_window.py # Login screen
│ ├── dashboard.py # Main dashboard window (table + manage panel)
│ ├── theme.py # ttk.Style color palette and widget styling
│ ├── export.py # CSV / PDF export helpers
│ └── validators.py # Input validation rules
├── tests/
│ ├── test_database.py # Standalone tests for the database layer
│ └── test_gui.py # End-to-end test driving the real Tk widgets
├── requirements.txt
└── README.md
```

## Getting started

### Requirements

- Python 3.9 or later, with Tk support (this ships with the standard
Windows/macOS installers from python.org; on Linux you may need to
install `python3-tk` via your package manager).

### Setup

```bash
git clone https://github.com/Jenks00/Student-Management-System.git
cd Student-Management-System
pip install -r requirements.txt # optional, only needed for PDF export
python main.py
```

On first launch, the app creates `app.db` in the project root and seeds
a default administrator account:

```
Username: admin
Password: admin123
```

Change or remove this account after your first login if you plan to use
the app beyond local testing.

### Running the tests

```bash
python tests/test_database.py # database layer, no display required
python tests/test_gui.py # drives the real UI, requires a display
```

Both scripts run against a temporary throwaway database and never touch
`app.db`.

## Packaging as a standalone executable

Since this is a desktop application, you can package it into a single
`.exe` (Windows), `.app` (macOS), or Linux binary using
[PyInstaller](https://pyinstaller.org/), so end users don't need Python
installed:

```bash
pip install pyinstaller
pyinstaller --onefile --windowed --name StudentManagementSystem main.py
```

The resulting executable will be in the `dist/` folder. This step is
optional and not required to run or develop the app.

## License

Released under the MIT License — see [LICENSE](LICENSE).
Loading