Skip to content

GuledIM/transaction-tracking-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

☕ Café Order Management System — CLI Project

🧾 Overview

The Café Order Management System is a Command-Line Interface (CLI) application built to manage a café’s product catalog, customer details, courier assignments, and order tracking. The project has transitioned from file-based storage to PostgreSQL, enabling more robust data persistence, integrity, and scalability. Users can create, view, update, and delete data in real-time, directly via the terminal.

This project was built as part of a mini challenge to demonstrate database integration and CRUD operations in Python.


❓ Problem Statement

Local cafés need a lightweight yet reliable tool to manage day-to-day operations, including:

  • Taking customer orders
  • Managing couriers and products
  • Tracking the status of each order
  • Ensuring that all data is stored and persisted securely

Previously, this was handled using CSV and text files, which posed challenges in consistency, scaling, and data accuracy.


💡 Solution

The CLI Order Management System addresses these issues by:

  • Replacing CSV/text storage with PostgreSQL for structured, queryable data
  • Offering full CRUD operations for products, customers, couriers, and orders
  • Introducing real-time order tracking and inventory monitoring (in progress)
  • Providing a modular, extensible codebase that supports additional features like CSV import/export

🏆 Bonus Features

  • ✅ Display orders by status or assigned courier
  • ✅ Full CRUD for customers
  • ⚙️ Product inventory tracking (partially complete)
  • 🛠️ Planned: CSV import/export support for major entities

📋 Project Requirements Checklist

Database Integration

  • ✅ All data stored in a PostgreSQL database
  • ✅ Tables include: Products, Couriers, Orders, Order Status, Customers

Core Features

  • ✅ Create, view, update, and delete:

    • Products
    • Couriers
    • Orders
  • ✅ Update order status

  • ✅ Persist all data to PostgreSQL

Stretch Goals

  • ✅ Display orders by status/courier
  • ✅ CRUD functionality for customers
  • ⚙️ Inventory tracking (in progress)
  • 🔜 CSV import/export

🧪 How to Run the App

Prerequisites

Ensure the following are installed:

  • Python 3.12+
  • psycopg2-binary
  • python-dotenv==0.15.0
  • A running PostgreSQL database with the appropriate tables

To Start the App:

python main.py

To Run Unit Tests:

pytest test_functions.py

Additional test cases are outlined in testcase.txt.


🧱 Database Structure

Table Fields
Products id, name, price
Couriers id, first_name, last_name, phone
Orders id, customer_id, courier_id, status_id, items
Order Status id, order_status
Customers id, first_name, last_name, phone

🔁 Menu System & User Interaction

  • Products Menu: View, create, update, delete
  • Couriers Menu: View, create, update, delete
  • Orders Menu: View, update status, update order, delete
  • Customers Menu: View, create, update, delete

✅ Definition of Done (DoD)

  • All core features tested and functional
  • Modular and reusable codebase
  • Data persists correctly across sessions
  • Team (or solo) review confirms task completion
  • Code committed to repository

🔧 Tech Stack

  • Python – Main language used for CLI and logic
  • PostgreSQL – Relational database for persistence
  • psycopg2 – PostgreSQL connector for Python
  • dotenv – Manage environment variables securely
  • pytest – For testing reusable functions

💭 Project Reflections

What worked well? Building reusable functions and watching the CLI menus interact smoothly with the database was especially satisfying. Each refactor made the system more maintainable.

What could be improved with more time?

  • Refactor for separation of concerns (e.g., separate order_products logic)
  • Delete cascading logic for related entries
  • Full suite of unit tests
  • Finalize inventory tracking logic

📁 Folder Structure

├── data/
├── src/
│   ├── database/
│   ├── menus/
│   └── utils/
├── test_functions.py
├── testcase.txt
├── .env
├── README.md
└── main.py

🔜 Future Improvements

  • Separate menu for managing order_products
  • Implement cascading deletes (e.g., when an order is removed)
  • Integrate CSV import/export for bulk data management
  • Deploy using Docker for easy replication across systems

About

This was my first bootcamp project, where I built a CLI-based menu system for a café to manage products, customers, couriers, and transaction data. The project evolved over six stages — from basic Python with no data persistence to integrating PostgreSQL and Docker for a more advanced, database-driven solution.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages