A console application written in Python for organizing events and managing their participants. It manages people, events and enrollments. Data is stored in text files, and the app includes reports, random data generation and a unit test suite.
I built it during the 1st semester of my first year at university (2025) for the Fundamentals of Programming course. The UI text is in Romanian.
- People: add, delete, update, search by ID and list. Each person has an ID, name, address and height.
- Events: add, delete, update, search by ID and list. Each event has an ID, date, time and description.
- Enrollments: register a person for an event. Duplicate enrollments are rejected.
- Cascading deletes: deleting a person or an event also removes their enrollments.
- Random data generation for people and events
- Reports:
- the events a person attends, sorted by description and then by date
- the people who attend the most events
- the top 20% of events by number of participants
- the 5 events with the fewest participants
- Persistence: data is saved to and loaded from text files. An in-memory mode can be enabled in
app_coordinator.py. - Validation with descriptive error messages, for example rejecting events dated in the past
The project uses a layered architecture:
| Layer | Folder | Responsibility |
|---|---|---|
| Domain | domain/ |
Entities (Person, Event, Enrollment), DTOs used by the reports, validators, custom exception hierarchy |
| Repository | repository/ |
In-memory repositories, and file-backed repositories that extend them |
| Service | service/ |
Business logic, cascading deletes, reports, random generation |
| UI | ui/ |
Text-based console interface |
| Utils | utils/ |
Hand-written selection sort and cocktail shaker sort. Both support key, a custom comparator and reverse, like Python's built-in sorted. |
The layers are wired together in app_coordinator.py. Each service receives its validator and repositories through its constructor.
The app needs Python 3.10 or newer and no external packages.
Run it from the project folder, because the data files are opened with relative paths:
python app_coordinator.pyCommands: adauga (add), sterge (delete), modifica (update), cauta (search), afiseaza (list), genereaza (generate), rapoarte (reports) and exit.
The project has 35 unit tests written with unittest. They cover the entities, validators, repositories and services.
python -m unittest tests.testeapp_coordinator.py # entry point, wires the layers together
domain/ # entities, validation, exceptions
repository/ # in-memory and file repositories
service/ # business logic and reports
ui/ # console interface
utils/ # custom sorting algorithms
tests/ # unit tests
persoane.txt # stored people
evenimente.txt # stored events
inscrieri.txt # stored enrollments
lista_*.txt # sample names, addresses and descriptions used for random generation
- The random generators are implemented recursively, so very large batches (around 1,000 items or more) hit Python's recursion limit.
- All people in the data files are fictional.