How ssoad/employee-management-system works
Project Type and Purpose
• This is a terminal‐based Employee Management System (EMS) written in C.
• Its goal is to provide CRUD operations on employee data, secured by password protection and binary file encryption.
File Structure
• Top-level C source:
• Employee Management System-github.c – the main program implementing CLI, business logic, file I/O, and encryption.
• Employee Management System-github.o – compiled object file.
• Configuration/docs:
• README.md/readme.pdf – project description and usage instructions.
• _config.yml, sitemap.xml, google*.html – GitHub Pages site configuration (not part of runtime).
• CI workflow: .github/workflows/jekyll-gh-pages.yml – automates documentation site deploy (irrelevant to runtime architecture).
Key Architectural Components
a. User Interface (CLI Layer)
• Displays login prompt, menu options (Add, Delete, Modify, Query), and formatted reports.
• Calls underlying functions in the business logic layer.
b. Authentication & Encryption Module
• Handles invisible password input, password verification, and encrypting/decrypting the binary data file.
c. Business Logic Layer
• Implements operations: addEmployee(), deleteEmployee(), modifyEmployee(), queryEmployees(), generateReports().
• Enforces input validation and workflow sequencing.
d. Data Access Layer (File I/O)
• Reads/writes an encrypted binary file to persist employee records.
• Uses low-level C file APIs (fopen, fread, fwrite, fclose).
e. Data Storage
• The encrypted binary file on disk houses serialized employee structs.
f. External/DevOps Services
• GitHub Actions for docs deployment (not in runtime).
• GitHub Pages serves the README and PDF documentation.
Relationships and Data Flow
1. User types credentials → CLI Layer
2. CLI Layer calls Auth Module → decrypts file, validates password
3. CLI displays menu → user selects operation
4. CLI invokes Business Logic → which calls Data Access Layer
5. Data Access Layer reads/writes decrypted data in memory
6. Auth Module re-encrypts and persists file before exit or upon each mutation
7. Business Logic returns results → CLI renders output/reports
Architectural Patterns & Principles
• Layered (Presentation → Business → Data Access).
• Single Responsibility: separate modules for UI, auth/encryption, business rules, and file I/O.
• Encapsulation: employee record struct and file format hidden behind Data Access APIs.
• Minimal external dependencies (pure C, file APIs only).
Technology & Libraries
• Language: C (standard library).
• File I/O: fopen/fread/fwrite.
• Encryption: custom XOR or simple cipher functions in C.
• Build: gcc or similar.
• CI/CD: GitHub Actions (for documentation).