This repository contains a multi-service attendance platform built around facial recognition, academic attendance workflows, and an Ollama-backed RAG/chat assistant.
This README reflects a static repository audit performed from the codebase contents on April 18, 2026. It documents how the project is wired today, what each service does, how requests flow across the stack, what test coverage exists in the repo, and which security strengths and risks are visible from source alone.
No builds, containers, or test suites were executed as part of this audit.
The project is organized as a 4-service application stack orchestrated by docker-compose.yml:
- A React frontend in
AttendifyAI/ - A Spring Boot backend in
facial-attendance-system/ - A Python face-recognition service in
facial-recognition/ - Infrastructure services for MariaDB and Ollama
At a high level:
- The frontend handles authentication, attendance screens, professor/director dashboards, notifications, and chat UI.
- The Spring backend is the main application API and business logic layer.
- The Python service handles face-photo storage and face-recognition requests.
- MariaDB stores the application data.
- Ollama provides local LLM chat and embedding support for the RAG feature.
Top-level directories and notable files:
AttendifyAI/: Create React App frontendfacial-attendance-system/: Java 21 Spring Boot backendfacial-recognition/: Python 3.11 face-recognition servicedocker-compose.yml: main local/container orchestration file.env: local environment file currently containing populated secrets on disk.env.example: example environment filejenkins-report/index.html: committed static report artifactJenkinsfile: helper pipeline file, but there is no meaningful.githubCI definition in the repo
Generated or report-like artifacts currently committed to the repository include:
AttendifyAI/build/: frontend production build outputfacial-recognition/coverage-report/: Python coverage report outputjenkins-report/index.html: static Jenkins report output
The frontend lives in AttendifyAI/package.json and is a Create React App application using:
- React 19
react-scripts- Tailwind CSS / PostCSS
- Testing Library + Jest
- An Nginx production image for serving the built static bundle
Key characteristics:
- Built with
npm run build - Served as static assets behind Nginx in production/container usage
- Contains API bindings in
AttendifyAI/src/api/index.js - Contains face-recognition browser flow in
AttendifyAI/src/pages/Presences.js
The backend lives in facial-attendance-system/pom.xml and uses:
- Java 21
- Spring Boot 3.5
- Spring Web
- Spring Data JPA
- Spring Validation
- Spring Security
- Spring Mail
- Spring Boot Actuator
- Spring AI Ollama
- MapStruct
- Lombok
- Apache PDFBox
- JWT via
jjwt - BCrypt password hashing
- MariaDB with HikariCP
Key runtime configuration is defined in facial-attendance-system/src/main/resources/application.properties.
The face-recognition service lives in facial-recognition/requirements.txt and is a Python 3.11 service built around:
opencv-pythonface_recognitionnumpy- stdlib HTTP handling
- local HTTP endpoints exposed for photo save and recognition operations
The implementation entry point highlighted by the audit is facial-recognition/main.py.
The Compose stack also includes:
- MariaDB
- Ollama
MariaDB is currently configured in Compose to run with the root user, which is a security concern for non-local or production-like deployments.
Based on the repository configuration, the stack exposes the following main services:
| Service | Purpose | Port(s) | Access |
|---|---|---|---|
| API Gateway (NEW) | Nginx reverse proxy - unified entry point | 80 |
Public |
| Frontend | React UI (internal, served via gateway) | — | Via Gateway |
| Spring Boot backend | Main API at /api/* (internal) |
— | Via Gateway |
| Python recognition service | Face recognition at /recognize/*, /photo/* (internal) |
— | Via Gateway |
| Ollama | Local LLM chat and embeddings | 11434 |
Internal |
| MariaDB | Application database | host 3307 -> container 3306 |
Internal |
The repository is container-oriented and wired through Docker Compose.
- Source lives under
AttendifyAI/ - Built with
npm run build - Produces a static asset bundle
- Production image serves the bundle with Nginx
- Source lives under
facial-attendance-system/ - Built with Maven
- Produces a Spring Boot fat JAR
- Source lives under
facial-recognition/ - Docker image installs dependencies from
facial-recognition/requirements.txt
docker-compose.yml wires together:
- frontend
- spring backend
- python recognition
- MariaDB
- Ollama
Dependencies are arranged so the backend waits on database health and expects Ollama and Python recognition to be available for their respective features.
The stack is not a simple frontend -> backend-only system. Different features take different paths.
Most browser requests go through the Spring backend via AttendifyAI/src/api/index.js.
This includes functionality for:
- authentication
- students
- classes
- attendance
- professors
- notifications
- admin health
- RAG chat and indexing
Face recognition is handled differently from the rest of the app:
- The browser calls the Python recognition service directly on
:5051/recognizefromAttendifyAI/src/pages/Presences.js. - The recognition result is then sent back to Spring at
/api/attendance/process.
This means attendance recognition currently uses a browser -> Python -> browser -> Spring flow rather than a fully backend-mediated flow.
Student photo registration follows this path:
- Browser uploads to Spring at
/api/biometric/students/photo - Spring forwards the request server-to-server to Python at
/save-photo
The Spring backend also communicates directly with:
- Python for biometric health checks and cache preload
- Ollama for chat generation and embeddings
- Gmail SMTP for email delivery
Important application configuration is concentrated in:
docker-compose.ymlfacial-attendance-system/src/main/resources/application.properties.envAttendifyAI/src/api/index.js
Visible configuration themes in the repo include:
- datasource configuration for MariaDB
- JWT secret and expiration settings
- CORS allowlists
- app URL and frontend origins
- Actuator health exposure
- Ollama base URL and model selection
- Python biometric endpoint URLs
- RAG indexing settings
- multipart upload size limits
Testing exists in all three application layers.
The frontend includes 3 Jest / Testing Library tests.
Audit note:
- The frontend test suite appears stale.
- Some tests still import API functions that no longer exist in the current API module.
- This suggests the frontend tests are at risk of failing or no longer validating current behavior accurately.
The backend includes 12 JUnit / MockMvc / Mockito / H2-oriented test files.
Audit note:
- The backend test setup appears reasonably modern.
- The presence of
spring-boot-starter-test,spring-security-test, and H2 indicates a solid basis for service, controller, security, and exception testing.
The Python service includes 6 pytest-based test files and uses pytest-cov.
Audit note:
- Python testing appears to cover API helpers, recognition logic, photo handling, and service entry behavior.
There is no meaningful modern CI pipeline definition under .github in the repository.
What does exist:
- helper scripts
- generated report artifacts
- a
Jenkinsfile - committed frontend build output in
AttendifyAI/build/ - committed coverage/report output in
facial-recognition/coverage-report/andjenkins-report/
This means the repo currently looks more like a locally run or manually verified project than one protected by an enforced CI pipeline.
The repository does contain real security controls. This is not an entirely unprotected application.
The audit found evidence of:
- stateless JWT authentication
- BCrypt password hashing
- role-based access control with
DIRECTEURandPROF - DTO validation
- CORS allowlists
- audit logs
- reset-token expiry
- suspicious-login tracking
- school-scoped data access
Relevant backend security configuration is centered around facial-attendance-system/src/main/java/com/attendance/security/SecurityConfig.java.
The audit also identified several important issues:
- The root
.envfile contains populated secrets on disk.
- Self-registration can request the
DIRECTEURrole.
- JWTs are stored in
localStorage. - This increases exposure to token theft if XSS is introduced anywhere in the frontend.
- No HTTPS enforcement visible in repo-level runtime config
- No Content Security Policy layer
- No explicit rate limiting
- No account lockout layer
- No dedicated security-header enforcement layer
PUT /api/professors/profiletrusts an email address from the request body instead of deriving identity from the authenticated principal.
- Both chat widgets use
dangerouslySetInnerHTML.
- The frontend directly probes raw health endpoints over HTTP.
- The Python recognition endpoints rely on CORS but do not authenticate requests themselves.
- Compose runs MariaDB as
root.
The repository includes an implemented RAG feature, backed by Spring AI and Ollama.
However, the backend knowledge/ directory is effectively empty except for .gitkeep.
Practical implication:
- document question-answering currently depends more on uploaded PDFs or database-backed data than on a preloaded repository knowledge base
In practical terms, the project behaves like this:
- The React application is the main user interface.
- Spring Boot is the central API, authentication, business logic, email, and orchestration layer.
- Python handles biometric storage and recognition operations.
- MariaDB stores the operational data.
- Ollama powers local chat and embeddings for the assistant/RAG feature.
The unusual part of the architecture is that facial recognition is not fully mediated by Spring. The browser talks directly to the Python recognition endpoint during the attendance flow, then sends processed results back to Spring. That split trust boundary is one of the most important design characteristics of the current implementation.
If you need to understand the current architecture quickly, start with these files:
docker-compose.ymlAttendifyAI/src/api/index.jsAttendifyAI/src/pages/Presences.jsfacial-attendance-system/src/main/resources/application.propertiesfacial-attendance-system/src/main/java/com/attendance/security/SecurityConfig.javafacial-recognition/main.py
This README is intentionally descriptive of the repository as it exists in source control.
What this audit did not do:
- run the frontend build
- run the backend Maven build
- run the Python test suite
- execute Docker Compose
- validate runtime behavior against a live environment
- confirm whether every configured security control is fully effective at runtime
Accordingly, this document should be read as a static architecture and code-surface audit, not a runtime penetration test or a verified deployment guide.