A simplified fintech/ecommerce platform for teaching Java. This project simulates a commerce backend where merchants can create products, accept customer orders, and process payments.
PayNest is a fictional platform that allows merchants to:
- Create products with names and prices
- Accept customer orders
- Process payments via multiple payment methods (card, EFT, wallet)
The codebase is designed for beginner–intermediate Java students and will be extended through multiple capstones. Later capstones add persistence and optional AI-assisted monitoring; early capstones use plain Java with clear packages.
PayNest is a fictional fintech company providing a simplified commerce backend. The platform enables merchants to manage products, handle customer orders, and accept various payment types. This project represents a teaching simulation of such a system.
- Java 21
- Maven 3.6+
- Capstone 5 only: Ollama installed locally (
ollama serve), with a small model pulled (for exampleollama pull llama3.2)
# Compile the project
mvn compile
# Run unit tests
mvn test
# Run the application
mvn exec:javaAlternatively:
mvn compile exec:java -Dexec.mainClass="com.paynestsystem.app.PayNestApplication"Order Summary
Customer: John Smith
Items:
Laptop x1 - R12000
Mouse x2 - R400
Total: R12400
Payment successful via CARD
Amount: R12400
Order completed successfully.
The default PayNestApplication demonstrates Capstones 1–2 only. Capstones 3–5 are exercised from tests or your own main methods.
Learner-facing project briefs, deliverables, and rubrics live under docs/assessments/. Use them as the assignment specification; this README stays focused on build, layout, and quick orientation.
Scaffolding note: Capstones 3–5 ship with interfaces, skeleton implementations, and TODOs in code—complete behaviour to the brief, not only the stubs.
flowchart LR
subgraph cap4 [Capstone4]
Pipeline[ReliablePipeline]
Store[TransactionRecordStore]
Idem[IdempotencyRegistry]
Reports[ReportGenerator]
end
subgraph cap3 [Capstone3]
Router[RoutingEngine]
Risk[RiskEvaluator]
end
subgraph cap5 [Capstone5]
Queue[EventQueue]
Ollama[OllamaClient]
Hybrid[HybridRisk]
AiLog[AiDecisionStore]
end
Queue --> Pipeline
Pipeline --> Idem
Pipeline --> Router
Pipeline --> Risk
Hybrid --> Risk
Hybrid --> Ollama
Pipeline --> Store
Hybrid --> AiLog
Store --> Reports
Objectives are summarized here; each assessment brief defines outcomes and grading in detail.
- Capstone 1: Classes, objects, constructors, encapsulation, collections (
List), basic business logic - Capstone 2: Interfaces, inheritance, polymorphism, dependency design, basic architecture
- Capstone 3: Layered design, strategy-style routing, risk scoring, configuration placeholders, extending interfaces without a finished rules engine
- Capstone 4: Persistence, idempotency, lifecycle state, operational reporting, failure handling
- Capstone 5: Hybrid risk assessment, external HTTP integration, defensive parsing, queued monitoring, audit trails
src/main/java/com/paynestsystem/
├── domain/ # Product, Customer, OrderItem, Order, Transaction, TransactionStatus,
│ # TransactionRecord, AiDecisionRecord
├── service/ # OrderService
├── payment/ # PaymentMethod, implementations, PaymentProcessor
├── routing/ # RoutingEngine, DefaultRoutingEngine, RouteDecision, DecisionLogger
├── rules/ # RoutingRule, AbstractRoutingRule, example rules
├── providers/ # PaymentProvider, BasePaymentProvider, ProviderA, ProviderB
├── risk/ # RiskLevel, RiskEvaluator, BasicRiskEvaluator, AiResponseParser, HybridRiskEvaluator
├── config/ # RoutingConfig
├── persistence/ # TransactionRecordStore, IdempotencyRegistry, AiDecisionStore; InMemory* stubs
├── persistence/jdbc/ # H2Schema DDL placeholders
├── reliability/ # ReliableTransactionPipeline, PipelineResult
├── reporting/ # ReportGenerator, OperationsReport, StubReportGenerator
├── ollama/ # OllamaConfig, OllamaClient, HttpOllamaClient, UnavailableOllamaClient
├── monitoring/ # RiskMonitoringService
└── app/ # PayNestApplication (Capstones 1–2 demo)