A web application for opening, triaging, handling and closing technical support tickets, with deadline tracking (SLA), full history and a metrics dashboard for the manager.
Built for the Transdisciplinary Integrative Project in Software Engineering II course, continuing the planning done in PIT I.
- Registration and sign-in with three roles: requester, technician and manager
- Ticket creation with category, priority and attachments (up to 5 MB)
- Unique ticket number in the
YYYY-NNNNNNformat - Listing with filters (status, priority, period and search) and pagination
- Technician assignment and a controlled status workflow
- Interaction history with author and date
- Closing with a mandatory record of the solution
- Metrics dashboard: total, open, average resolution time and SLA rate
- Responsive interface, usable on a phone
| Layer | Technology |
|---|---|
| Front end | React 19 · TypeScript · Next.js 16 (App Router) |
| Back end | Python 3.12 · Flask · SQLAlchemy — JSON API |
| Database | PostgreSQL 16 (SQLite for local development) |
| Tests | pytest (API and rules) · Playwright (interface) |
| Hosting | Render — two services |
Version 3.1 split the interface off into an application of its own. Version 3.2 reorganised the API as a Clean Architecture: the business rules sit at the centre, and every dependency points inwards, towards them.
Browser
│
▼
frontend/ CLIENT — Next.js, React Server + Client Components
│ rewrites /api/* to the API, server-side
▼ HTTP (JSON)
backend/ API — Flask
app/interfaces/http/ blueprints, session guard, JSON presenters
│ read the request → call one use case → present the result
▼
app/application/ use cases (OpenTicket, ChangeTicketStatus, …)
│ and the ports they need: repositories, unit of work, hasher
▼
app/domain/ entities, workflow, validation, rules, errors
plain Python — no Flask, no SQLAlchemy
app/infrastructure/ implements the ports: SQLAlchemy mapping and
repositories, Werkzeug password hashing, seed data
app/container.py composition root — plugs each adapter into its port
The two halves are separate projects that share nothing but the HTTP contract: each has its own folder, its own dependencies, its own tests and its own service on Render. The frontend never imports backend code, and the backend has no idea the frontend is written in React.
| Layer | Knows about | Never imports |
|---|---|---|
domain |
nothing but itself | Flask, SQLAlchemy, Werkzeug, any other layer |
application |
domain |
frameworks, infrastructure, interfaces |
infrastructure |
application, domain |
interfaces |
interfaces |
application, domain |
infrastructure |
backend/tests/test_architecture.py reads the imports of every module and fails the
build if one of those arrows is reversed.
The entities are ordinary classes. SQLAlchemy is attached to them from the
outside, with an imperative mapping in backend/app/infrastructure/orm.py, so the
schema did not change and neither did a single endpoint: the frontend never
noticed the move. What changed is what the rules can be tested without —
backend/tests/test_domain.py exercises the SLA, the workflow and the visibility rules
with no application and no database, in milliseconds.
The browser never talks to Flask directly. Next rewrites /api/* to the
API on the server side, which keeps the whole application same-origin: the
session cookie stays httpOnly and is sent automatically, and the CSRF
protection added in V-02 keeps working without CORS credentials. The token is
fetched from GET /api/csrf and replayed in the X-CSRFToken header.
Two processes. Start the API first.
git clone https://github.com/YOUR-USERNAME/chamati.git
cd chamati
# --- Backend (API) ---------------------------------------------------------
cd backend
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
export FLASK_APP=run.py # Windows: set FLASK_APP=run.py
flask init-db # creates the tables
flask seed # fills it with sample data
python run.py # http://localhost:5000
# --- Frontend (client, another terminal) -----------------------------------
cd frontend
npm install
cp .env.example .env.local # points at the API above
npm run dev # http://localhost:3000Open http://localhost:3000.
Without a DATABASE_URL variable the API uses SQLite. To use PostgreSQL (from
backend/):
export DATABASE_URL="postgresql://user:password@localhost:5432/chamati"
psql "$DATABASE_URL" -f database/ddl.sql
psql "$DATABASE_URL" -f database/seed.sql
flask seedIf you are upgrading a database that is already running version 2.1, apply
backend/database/migration-3.0.sql instead of ddl.sql
— it renames the schema to English without losing any data. Version 3.1
changed no tables.
Password for all of them: chamati123
| Role | |
|---|---|
| Manager | ana.manager@chamati.dev |
| Technician | bruno.technician@chamati.dev |
| Requester | diego@chamati.dev |
150 tests across two suites, split by what they are able to prove.
cd backend && pytest # 127 — domain, use cases, permissions, API contract
cd frontend && npm run test:e2e # 23 — the interface, in a real browser| Suite | Tests | Covers |
|---|---|---|
backend/tests/ (pytest) |
127 | Domain rules, use cases, the ticket lifecycle, permissions, SLA, metrics, the dependency rule and the JSON envelope every endpoint returns |
frontend/e2e/ (Playwright) |
23 | What the browser renders and how it behaves, against the real stack: Flask, Next and Chromium |
Of those, 79 are regression tests:
| File | Tests | Origin |
|---|---|---|
backend/tests/test_verification_v2.py |
29 | Verification — the 9 defects found while reviewing v1.0. Documented in docs/verification-v1.md |
backend/tests/test_validation_reports.py |
27 | Validation — the rule and API half of the 6 findings. Documented in docs/validation-reports.md |
frontend/e2e/l01…l06 |
19 | Validation — the interface half. Four of the six findings were interface defects, so this is where those regressions actually live |
frontend/e2e/smoke.spec.ts |
4 | The paths each role walks, end to end |
The Playwright suite boots the real stack itself, with a deterministic database
built by backend/scripts/e2e_api.py, run with
the interpreter in backend/.venv (set E2E_PYTHON to use another). It is not mocked on
purpose: four of the six findings survived a passing unit suite, and a mocked
API would have let every one of them through again.
| Document | Contents |
|---|---|
docs/scope.md |
Problem, target audience and MVP scope |
docs/uml/ |
Use cases, classes, sequence and activity diagrams |
docs/data-model.md |
Conceptual, normalized logical and physical models |
backend/database/data-dictionary.md |
Data dictionary |
docs/hci.md |
Interface and accessibility decisions |
docs/test-plan.md |
Verification and validation strategy |
docs/verification-v1.md |
Verification: the 9 defects in v1.0, the fixes and the evidence |
docs/validation-reports.md |
Validation: the findings reported by the testers and the fixes |
docs/user-manual.md |
Usage manual, by role |
reports/ |
Test forms from the 5 testers and the quality report |
chamati/
├── frontend/ # CLIENT — Next.js interface
│ ├── src/app/ # routes (App Router)
│ ├── src/components/ # shared components
│ ├── src/lib/ # API client, types, formatting
│ ├── e2e/ # Playwright specs
│ └── package.json
├── backend/ # API — Flask, Clean Architecture
│ ├── app/
│ │ ├── domain/ # entities, rules, workflow, errors
│ │ ├── application/ # use cases and ports
│ │ ├── infrastructure/ # SQLAlchemy, repositories, hashing, seed
│ │ ├── interfaces/http/ # blueprints, session guard, presenters
│ │ └── container.py # composition root
│ ├── database/ # DDL, seed, migrations and data dictionary
│ ├── scripts/ # e2e database bootstrap
│ ├── tests/ # pytest suite
│ ├── requirements.txt
│ └── run.py # API entry point
├── docs/ # Documentation and diagrams
├── reports/ # User testing
└── render.yaml # the two Render services, one per folder
![]() |
![]() |
![]() |
![]() |
The screenshots above were captured from version 2.1, when the interface was rendered by Jinja and still in Portuguese. The layout and the design system they show are the ones the React interface reuses, but the wording is not current, and they are due to be retaken.




