modified: README.md new file: logo.png modified: static/favicon.ico modified: templates/index.html modified: templates/modify_info.html modified: templates/points.html modified: templates/record.html
3.6 KiB
AL Najeeb System
Introduction
AL Najeeb System is a simple web application built with the Flask framework in Python, utilizing SQLite as its database. This application allows users to manage student information, including personal data, contact details, memorization progress, and a points tracking system. The frontend is built with Tailwind CSS for a clean and responsive user experience.
Installation and Running
Follow these streamlined steps to get the application up and running on your local machine.
Prerequisites
- Python 3.8 or newer
git(for cloning the repository)
Installation
-
Clone the repository: Open your terminal and clone the project repository:
git clone --depth 1 <your-repository-url> cd <your-project-directory> -
Set up your Python Environment: Create and activate a virtual environment, then install the required Python packages.
python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt -
Initialize your database IF needed run
flask init-dbif thedatabases/directory is empty .the
flask init-dbwill delete the students.db if exists and creates a new empty one . -
Start The App Make sure the
serve.shscript is executable:chmod +x serve.shThen run it:
./serve.sh -
Access the application: After
serve.shsuccessfully runs, open your web browser and navigate to:http://127.0.0.1:8000/
How to Update
Updating the application involves pulling the latest code, updating dependencies, and carefully handling any database changes.
-
Stop the Current Application: If the application is running, stop it by pressing
Ctrl + Cin the terminal window where Gunicorn is running. -
Update the Code: Ensure you are in your project directory and pull the latest changes from your Git repository:
git pull -
Activate the Virtual Environment: Before installing dependencies or running database updates, always activate your virtual environment:
source .venv/bin/activate # Linux/macOS .venv\Scripts\activate.bat # Windows Command Prompt .venv\Scripts\Activate.ps1 # Windows PowerShell -
Update Dependencies: If the project's dependencies have changed, update them.
pip install -r requirements.txt -
Update the Database (Important): This is the most critical and sensitive step when updating an application that uses an SQLite database. Since I still not using a dedicated database migration tool (like Flask-Migrate / Alembic), database schema updates must be handled manually.
- The safest method without a migration tool is to:
1. Backup your current data: Copy your
databases/students.dbfile to a safe, external location.bash cp databases/students.db databases/students_backup_$(date +%Y%m%d%H%M%S).db2. Reinitialize the database:bash flask init-dbNote: This will delete the old database and recreate a new, empty schema. You will then need to manually re-import your backed-up data if you wish to restore it (e.g., using a SQLite browser tool to import from CSVs you might have exported).
- The safest method without a migration tool is to:
1. Backup your current data: Copy your
-
Restart the Application: After updating the code and managing the database, restart the application:
./serve.sh
