TFMS-CodeForce is a Django-based Task Force Management System (TFMS) submitted as the SE Project course deliverable for the Master of Software Engineering programme at Universiti Teknologi Malaysia (UTM). The project simulates a real software-engineering engagement for the Faculty of Artificial Intelligence (FAI) — the FAI scenario is the course's client brief, not a live deployment.
It provides role-based dashboards (Admin, HOD, PSM, Management/Dean, Lecturer), staff and department administration, task force creation and approval workflows, workload settings, audit logs with CSV export, and report exports in Excel/PDF. The UI is rendered with Django templates and Bootstrap, and data is stored in SQLite by default (PostgreSQL via DATABASE_URL).
Built by Team CodeForce under contract reference MSE-FT31-2025:
- Junaed Muhammad Chowdhury — Project Leader
- Yahya Haghshenas
- Abubakar Abdu Usman
- Dou Chenhui
- Qi Junqiu
- Roshaimieza Binti Mat Adam
Course supervisors: Assoc. Prof. Ts. Dr. Azri Bin Azmi (Project Manager) and Ts. Dr. Othman bin Mohd Yusop (Client).
The full set of formal SE Project deliverables lives in docs/:
| Document | File |
|---|---|
| User Requirements Specification (URS) | docs/URS for Taskforce Monitoring System v1.pdf |
| Software Development Plan (SDP) | docs/SDP-TFMS-261225-V1.pdf |
| Software Requirements Specification (SRS) | docs/SRS-TFMS-140126-V1.pdf |
| Software Design Description (SDD) | docs/SDD-TFMS-190126-V1.pdf |
| Software Test Description (STD) | docs/STD-TFMS-190126-V1.pdf |
| Software Test Report (STR) | docs/STR-TFMS-190126-V1.pdf |
- Team & Supervisors
- Project Documents
- Quick Start (Beginner, Step-by-Step)
- Requirements (Prerequisites)
- Download / Clone the Project
- Setup (Local Development)
- Database Setup
- Create an Admin / Superuser
- Running the Project Locally
- Updating the Project Using AI
- Testing
- Troubleshooting
- Project Structure
- Tech Stack
These steps assume you only have an internet connection and a computer. If you already have Git and Python installed, start at step 4.
- Install Homebrew (skip if already installed):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - Install Git and Python 3.10+:
brew install git python
- Verify installs:
git --version python3 --version
- Download the project:
git clone https://github.com/Junaed29/TFMS-CodeForce.git cd TFMS-CodeForce - Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate - Install dependencies:
python3 -m pip install -r requirements.txt
- Create a
.envfile for email (needed for mail service; see Gmail App Password for password generation):Important: Ifcat > .env <<'EOF' EMAIL_HOST=smtp.gmail.com EMAIL_PORT=587 [email protected] EMAIL_HOST_PASSWORD=your_app_password DEFAULT_FROM_EMAIL=TFMS Support <[email protected]> EOF
EMAIL_HOST_USERorEMAIL_HOST_PASSWORDis missing, email features will not send. - Initialize the database:
python3 manage.py migrate
- Create an admin account:
python3 manage.py createsuperuser
- Start the server:
python3 manage.py runserver- Open
http://127.0.0.1:8000/in your browser and log in.
- Install Git (skip if already installed):
winget install --id Git.Git -e
- Install Python 3.10+ (skip if already installed):
If
winget install --id Python.Python.3.11 -e
wingetis not available, install fromhttps://git-scm.com/andhttps://python.org/. - Verify installs:
git --version python --version
- Download the project:
git clone https://github.com/Junaed29/TFMS-CodeForce.git cd TFMS-CodeForce
- Create and activate a virtual environment:
python -m venv venv venv\Scripts\activate - Install dependencies:
python -m pip install -r requirements.txt
- Create a
.envfile for email (needed for mail service; see Gmail App Password for password generation):Paste and save:notepad .env
Important: IfEMAIL_HOST=smtp.gmail.com EMAIL_PORT=587 EMAIL_HOST_USER[email protected] EMAIL_HOST_PASSWORD=your_app_password DEFAULT_FROM_EMAIL=TFMS Support <[email protected]>
EMAIL_HOST_USERorEMAIL_HOST_PASSWORDis missing, email features will not send. - Initialize the database:
python manage.py migrate
- Create an admin account:
python manage.py createsuperuser
- Start the server:
python manage.py runserver- Open
http://127.0.0.1:8000/in your browser and log in.
You will need:
- Python 3.10+ (required for this project)
- Git
- Optional: PostgreSQL if you choose it in Database Setup
- Install Homebrew (if you do not have it):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - Install Git and Python:
brew install git python
- Verify installs:
git --version python3 --version pip3 --version
Common pitfalls:
- If
pythondoes not exist, usepython3in all commands. - If
pipis missing, runpython3 -m ensurepip --upgrade.
- Install Git:
winget install --id Git.Git -e
- Install Python 3.10+:
winget install --id Python.Python.3.11 -e
- Verify installs:
git --version python --version pip --version
Common pitfalls:
- If
pythonopens the Microsoft Store, reinstall Python and check "Add Python to PATH", or usepy -3.11. - If
pipis missing, runpython -m ensurepip --upgrade.
Git is a version control tool that downloads the project and lets you update it later with git pull.
- Open Terminal.
- Clone the repo:
git clone https://github.com/Junaed29/TFMS-CodeForce.git
- Enter the folder:
cd TFMS-CodeForce - You should see files like
manage.py,requirements.txt,accounts/,dashboard/,university/,tfms_core/,templates/,static/,PythonAnywhere_Update_Guide.md,logoAndDocuments/.
- Open PowerShell or Command Prompt.
- Clone the repo:
git clone https://github.com/Junaed29/TFMS-CodeForce.git
- Enter the folder:
cd TFMS-CodeForce - You should see files like
manage.py,requirements.txt,accounts/,dashboard/,university/,tfms_core/,templates/,static/,PythonAnywhere_Update_Guide.md,logoAndDocuments/.
manage.py and tfms_core/wsgi.py load .env via python-dotenv. Create .env in the repo root (next to manage.py).
| Variable | Required | Purpose | Safe local default |
|---|---|---|---|
EMAIL_HOST |
Optional | SMTP host (hardcoded to smtp.gmail.com in tfms_core/settings.py) |
smtp.gmail.com |
EMAIL_PORT |
Optional | SMTP port (hardcoded to 587 in tfms_core/settings.py) |
587 |
EMAIL_HOST_USER |
Optional | SMTP username; DEFAULT_FROM_EMAIL is set to this in tfms_core/settings.py |
Leave blank to skip email sending |
EMAIL_HOST_PASSWORD |
Optional | SMTP password or app password | Leave blank to skip email sending |
DEFAULT_FROM_EMAIL |
Optional | Display name/from address (not read from env in current code) | Edit tfms_core/settings.py to use this |
DATABASE_URL |
Optional | Overrides the default SQLite DB via dj_database_url.config |
If you use db.sqlite3, you do not need this |
Notes:
- Important: If
EMAIL_HOST_USERorEMAIL_HOST_PASSWORDis missing, email features will not send. tfms_core/settings.pyhardcodesDEBUG=True,SECRET_KEY,EMAIL_HOST=smtp.gmail.com,EMAIL_PORT=587, andEMAIL_USE_TLS=True. To change these, edittfms_core/settings.py.- The repo does not include a
Local_Run_Guide.mdfile anymore; this README is the source of truth for local setup.
Example .env:
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_HOST_USER[email protected]
EMAIL_HOST_PASSWORD=your_app_password
DEFAULT_FROM_EMAIL=TFMS Support <[email protected]>
# DATABASE_URL=postgresql://user:password@localhost:5432/tfmsIf you use Gmail as shown above, you must use a Google App Password (free) instead of your normal Gmail password.
- Go to
https://myaccount.google.com/securityand enable 2-Step Verification. - Open
https://myaccount.google.com/apppasswordsand sign in. - Under Select app, choose Mail. Under Select device, choose Other (Custom name) and enter
TFMS Local. - Click Generate, then copy the 16-character password.
- Paste it into
.envasEMAIL_HOST_PASSWORD.
If the App Passwords page looks different or is not available, search the internet for "Google app password" and follow the latest official Google instructions.
- Create a virtual environment:
python3 -m venv venv
- Activate it:
source venv/bin/activate - Install dependencies:
python3 -m pip install -r requirements.txt
- Create
.envif you have not already:cat > .env <<'EOF' EMAIL_HOST=smtp.gmail.com EMAIL_PORT=587 [email protected] EMAIL_HOST_PASSWORD=your_app_password DEFAULT_FROM_EMAIL=TFMS Support <[email protected]> EOF
- Create a virtual environment:
python -m venv venv
- Activate it:
venv\Scripts\activate
- Install dependencies:
python -m pip install -r requirements.txt
- Create
.envif you have not already:Paste and save:notepad .env
EMAIL_HOST=smtp.gmail.com EMAIL_PORT=587 EMAIL_HOST_USER[email protected] EMAIL_HOST_PASSWORD=your_app_password DEFAULT_FROM_EMAIL=TFMS Support <[email protected]>
Checked requirements.txt, tfms_core/settings.py, manage.py, and PythonAnywhere_Update_Guide.md. Missing items you must supply:
- SMTP credentials (
EMAIL_HOST_USER,EMAIL_HOST_PASSWORD) if you want emails for account creation, password resets, and lecturer remarks. - A
DATABASE_URLvalue if you want PostgreSQL instead of SQLite. - Production-safe settings (the repo hardcodes
SECRET_KEYandDEBUG=True). - There is no tracked
.env.example,Dockerfile, ordocker-compose.yml; setup is manual as documented here.
- Run migrations:
python3 manage.py migrate
- This creates
db.sqlite3in the repo root.
- Install PostgreSQL:
brew install postgresql brew services start postgresql
- Create a database and user:
psql postgres
Exit withCREATE DATABASE tfms; CREATE USER tfms_user WITH PASSWORD 'your_password'; GRANT ALL PRIVILEGES ON DATABASE tfms TO tfms_user;
\q. - Add this to
.env:DATABASE_URL=postgresql://tfms_user:your_password@localhost:5432/tfms - Run migrations:
python3 manage.py migrate
- Verify connection:
Then run
python3 manage.py dbshell
\dtand exit with\q.
- Run migrations:
python manage.py migrate
- This creates
db.sqlite3in the repo root.
- Install PostgreSQL:
winget install --id PostgreSQL.PostgreSQL -e
- Open "SQL Shell (psql)" or PowerShell:
psql -U postgres - Create a database and user:
Exit with
CREATE DATABASE tfms; CREATE USER tfms_user WITH PASSWORD 'your_password'; GRANT ALL PRIVILEGES ON DATABASE tfms TO tfms_user;
\q. - Add this to
.env:DATABASE_URL=postgresql://tfms_user:your_password@localhost:5432/tfms - Run migrations:
python manage.py migrate
- Verify connection:
Then run
python manage.py dbshell
\dtand exit with\q.
- Run:
python3 manage.py createsuperuser
- Follow the prompts and choose a password that matches the rules below.
- Run:
python manage.py createsuperuser
- Follow the prompts and choose a password that matches the rules below.
Password rules in tfms_core/settings.py:
- Minimum length 8, maximum length 16
- Must contain at least one letter and one number
After you start the server (see Running the Project Locally), log in at http://127.0.0.1:8000/accounts/login/ or http://127.0.0.1:8000/.
- Activate your virtual environment (if not already):
source venv/bin/activate - Make sure you have completed Create an Admin / Superuser so the admin can enter the admin dashboard.
- Start the server:
python3 manage.py runserver
- Open
http://127.0.0.1:8000/and log in. - Stop the server with
Ctrl+C.
- Activate your virtual environment (if not already):
venv\Scripts\activate
- Make sure you have completed Create an Admin / Superuser so the admin can enter the admin dashboard.
- Start the server:
python manage.py runserver
- Open
http://127.0.0.1:8000/and log in. - Stop the server with
Ctrl+C.
Server logs and errors appear in the terminal where you ran runserver. Django will auto-reload when you change Python or template files.
If you are new and want to change this project (add a feature, fix a bug, update wording), you can use an AI coding assistant. A safe workflow:
- Make sure the project runs first (finish Quick Start).
- Tell the AI exactly what you want to change and ask it to read the relevant files (for example:
README.md,tfms_core/settings.py,accounts/,dashboard/,university/,templates/). - Ask the AI to explain the plan before changing files, then apply the changes.
- Review the changes before running the app.
- Run the update steps below based on what was changed.
Important:
- Do not paste secrets into an AI chat (real passwords, tokens, or private emails).
- If the AI adds new packages, it should update
requirements.txt. - If the AI changes Django models, you must create migrations.
- Activate the virtual environment:
source venv/bin/activate - If
requirements.txtchanged, reinstall dependencies:python3 -m pip install -r requirements.txt
- If models changed, create and apply migrations:
python3 manage.py makemigrations python3 manage.py migrate
- Start the server:
python3 manage.py runserver
- Activate the virtual environment:
venv\Scripts\activate
- If
requirements.txtchanged, reinstall dependencies:python -m pip install -r requirements.txt
- If models changed, create and apply migrations:
python manage.py makemigrations python manage.py migrate
- Start the server:
python manage.py runserver
No automated tests were found in the tracked files (no tests.py or test_*.py files). If you add tests later, run:
python manage.py test- Symptom:
Address already in use-> Cause: another app is using port 8000 -> Fix:python manage.py runserver 8001or stop the other app. - Symptom:
ModuleNotFoundError-> Cause: virtual environment not active or dependencies not installed -> Fix: activatevenvand runpython -m pip install -r requirements.txt. - Symptom:
no such table/relation does not exist-> Cause: migrations not applied -> Fix:python manage.py migrate. - Symptom:
could not connect to server(PostgreSQL) -> Cause: Postgres not running or wrongDATABASE_URL-> Fix: start Postgres and re-check.env. - Symptom:
CSRF cookie not seton local HTTP -> Cause:CSRF_COOKIE_SECUREandSESSION_COOKIE_SECUREareTrueintfms_core/settings.py-> Fix: set them toFalsefor local development. - Symptom: email send fails -> Cause: missing or incorrect
EMAIL_HOST_USER/EMAIL_HOST_PASSWORD-> Fix: update.envor switch to the console email backend intfms_core/settings.py. - Symptom: login keeps failing or account locked -> Cause: the app locks non-admin accounts after 3 failed attempts -> Fix: log in as an admin and unlock the user in the Admin Staff list.
- Symptom:
venv\Scripts\activatenot found on Windows -> Cause: virtual environment not created in the repo folder -> Fix: runpython -m venv venvfrom the project root, then activate again.
tfms_core/- Django settings, URLs, WSGI/ASGI entry pointsaccounts/- Custom user model, authentication views, validators, audit loggingdashboard/- Role dashboards, admin tools, exports, and API endpointsuniversity/- Department, task force, and workload logictemplates/- Django HTML templates and email templatesstatic/- CSS and imagesdocs/- Formal SE Project deliverables (URS, SDP, SRS, SDD, STD, STR)logoAndDocuments/- UTM and CodeForce logos, supplementary use case materialmanage.py- Django management entry pointrequirements.txt- Python dependenciesPythonAnywhere_Update_Guide.md- Notes for updating a PythonAnywhere deployment
- Python 3.10+ (required for this project)
- Django >= 5.0 (from
requirements.txt; settings header mentions 4.2.27) - SQLite (default via
dj-database-url) - PostgreSQL (optional via
psycopg2-binaryandDATABASE_URL) - Bootstrap 5.3.3 and Bootstrap Icons 1.11.3 (CDN in
templates/base.html) - Poppins font (Google Fonts in
templates/base.html) - openpyxl and reportlab for Excel/PDF exports
- python-dotenv for
.envloading
