How nkosimlaba/facial-recognition-attendance-system works
Main Components
• Frontend/UI:
• Represented by the static HTML templates (e.g., arrival.html, departure.html, employee_enroll.html, student_enroll.html) and associated CSS/JavaScript files (pause-camera.js, picture-capture.js, common.css, pause-camera.css) within src/main/resources/static.
• This is the browser-based UI that users interact with.
• Web API / Application Server:
• The Java-based web server and controller classes (WebServer.java and Controller.java) located in src/main/java/za/co/theemlaba/webapi. They are responsible for routing, handling HTTP requests, and serving the web pages.
• Database Access Layer:
• Both Java and Python modules are present for database interactions (e.g., Database.java in the Java package and database.py in the python package), which abstract interactions with the underlying SQLite database.
• Face Recognition Service:
• The Python module (face_recognition_service.py) which implements the face recognition logic, integrated with the attendance workflow.
• Build and Dependency Components:
• Build scripts and configurations like Makefile, pom.xml (for Maven), and CMake dependency files ensure that dependencies and builds are managed correctly.
Relationships and Interactions
• Clients (web browsers) send user interactions and HTTP requests to the Web API.
• The Web API (Java server) receives these requests, interfaces with the Database Access Layer for enrollment and attendance recording.
• For face recognition, the API or a background service triggers the Python-based face recognition module, which processes camera feeds and returns recognition results.
• There is a clear separation between the frontend and backend layers, with well-defined interfaces (HTTP endpoints).
• The static resources (HTML, CSS, JS) are served by the web server to the clients.
Architectural Patterns and Technologies
• MVC-like Pattern:
• The web API design implies a separation between the controller (handling HTTP requests), models (the data layer via Database classes) and views (HTML templates served to clients).
• Hybrid Technology Stack:
• Java is used for the core server functionality and web API.
• Python is used for specialized tasks such as face recognition and possibly some database interactions.
• Web-Client/Server Architecture:
• The interaction between the browser and the backend server is central to the design, with RESTful endpoints implied by the “make webapi” and provided endpoints.
• Build and Dependency Management:
• Maven (pom.xml) and Makefiles are used to handle compilation, dependency resolution, and testing procedures.