A lightweight web application to validate your Data-Classification-to-Control Baseline for SMEs.
This app has three main parts:
- Case Checker: Load your cases (C01–C08) and automatically check them against baseline rules. Conflicts are flagged.
- Reviewer Form: Collect structured feedback from reviewers on four criteria: clarity, consistency, feasibility, and traceability.
- Export & Report: Generate clean CSV and text reports ready to paste into your thesis.
- Python 3.8+
- pip
-
Navigate to the project directory:
cd validation_app -
Create a virtual environment:
python3 -m venv venv
-
Activate the virtual environment:
- macOS/Linux:
source venv/bin/activate - Windows:
venv\Scripts\activate
- macOS/Linux:
-
Install dependencies:
pip install -r requirements.txt
-
Make sure the virtual environment is activated.
-
Run the app:
python run.py
-
Open your browser and go to:
http://127.0.0.1:5000 -
The app will create a SQLite database (
validation.db) automatically.
By default, the app uses SQLite (app/validation.db). To store form data in PostgreSQL, set DATABASE_URL before running the app.
Example:
export DATABASE_URL="postgresql+psycopg://postgres:postgres@localhost:5432/validation_app"
python run.pyIf DATABASE_URL is set, all app data (cases, baselines, reviews, LLM suggestions, threat models) is stored in PostgreSQL.
If you want your local app and Render to show the exact same data, use the same hosted PostgreSQL connection string in both places.
- Copy the PostgreSQL
DATABASE_URLfrom Render. - Create a local
.envfile invalidation_app/. - Put this inside the file:
DATABASE_URL="postgresql+psycopg://USER:PASSWORD@HOST:PORT/DATABASE_NAME" - Restart your local app with
python run.py.
The app will load .env automatically, so local and Render will point to the same database.
Before adding cases, define your baseline rules. Example:
- Level: Top Secret
- Min Access Rule: Named accounts with role-based access
- MFA Required: Yes
- Min Admin Rule: Dual approval for admin access
- Min Logging Rule: All access, all modifications, failed attempts
- Encryption Required: Yes
- Go to Case Checker.
- Fill in the case details (case ID, data level, access rule, etc.).
- Click Add Case. The app will automatically check it against baseline rules.
- View results immediately.
Example Case:
- Case ID: C01
- Data Level: Top Secret
- Access Rule: Named accounts with role-based access
- MFA Required: Yes
- Admin Rule: Dual approval
- Logging Rule: All access, all modifications, failed attempts
- Encryption Required: Yes
- Go to Review Form.
- Send the link to reviewers.
- Reviewers fill out the form with:
- Clarity score (1–5)
- Consistency score (1–5)
- Feasibility score (1–5)
- Traceability score (1–5)
- Comments for each criterion
- Overall feedback
Go to Results & Export and download:
- conflict_log.csv: All case-vs-baseline mismatches. Ready to paste into thesis.
- reviewer_scores.csv: Reviewer scores and averages. Ready to paste into thesis.
- reviewer_comments.txt: All reviewer feedback organized by person. Use for baseline v2 revision.
validation_app/
├── run.py # Entry point
├── requirements.txt # Python dependencies
├── validation.db # SQLite database (created on first run)
└── app/
├── __init__.py # Flask app factory
├── models.py # Database models (Case, Baseline, Review, etc.)
├── checker.py # Case checker logic
├── routes.py # All API and web routes
├── export.py # Export CSV and text reports
├── static/
│ ├── css/
│ │ └── style.css # Custom CSS (Bootstrap theme)
│ └── js/
│ ├── checker.js # Case form and checking logic
│ ├── reviewer.js # Reviewer form submission
│ └── results.js # Results and export display
└── templates/
├── index.html # Home page
├── checker.html # Case checker page
├── reviewer.html # Reviewer form page
└── results.html # Results & export page
GET /api/baseline– Get all baseline rulesPOST /api/baseline– Create or update baseline rule
GET /api/cases– Get all casesPOST /api/cases– Create a new casePUT /api/cases/<case_id>– Update a caseDELETE /api/cases/<case_id>– Delete a case
GET /api/checker/check/<case_id>– Check a single caseGET /api/checker/check-all– Check all cases
POST /api/reviewer– Submit a reviewer's feedbackGET /api/reviews– Get all reviews
GET /api/export/conflict-log– Download conflict log (CSV)GET /api/export/reviewer-scores– Download reviewer scores (CSV)GET /api/export/reviewer-comments– Download reviewer comments (TXT)
- Monday: Define baseline rules. Add cases C01–C08. Run checks. See 2 conflicts.
- Tuesday: Send reviewer form link to 3 reviewers.
- Wednesday: Reviewers submit feedback.
- Thursday: Download reports. Review comments. Update baseline v2.
- Friday: Prepare for interviews using cleaned-up baseline v2.
Edit app/templates/reviewer.html to add or change scoring questions. Also update app/models.py Review model.
By default, SQLite is used (no server needed). To switch to PostgreSQL:
- Create a PostgreSQL database (example name:
validation_app). - Set
DATABASE_URL, for example:export DATABASE_URL="postgresql+psycopg://postgres:postgres@localhost:5432/validation_app"
- Run the app. Tables are created automatically on startup.
Create a Dockerfile and docker-compose.yml if you want to containerize the app. (Example provided on request.)
- Delete old data: Remove
validation.dband restart the app. - Migrations: The app auto-creates tables on first run.
Change the port in run.py:
app.run(debug=True, host='127.0.0.1', port=5001) # Use 5001 instead of 5000If running the frontend on a different port, add CORS headers. Install:
pip install Flask-CORSUpdate app/__init__.py:
from flask_cors import CORS
CORS(app)- User authentication for reviewers
- Mobile app
- Automated email invitations to reviewers
For questions or issues, consult the code, the thesis documentation, or me directly (kelvilikol13@gmail.com)
Built for: Data-Classification-to-Control Baseline for SMEs (Master's Thesis)
Created: May 2026