Skip to content

SubTrackr is a C# subscription management system that handles users, plans, payments, notifications, and reports. Built with OOP, design patterns, and clean architecture. Includes full unit, integration, and non-functional tests.

Notifications You must be signed in to change notification settings

NickiMash17/SubTrackr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 SubTrackr

A Modern Subscription Management Platform

Track, manage, and monitor your subscriptions with ease

.NET C# License Tests


πŸ“‹ Table of Contents


🎯 Overview

SubTrackr is a comprehensive subscription management system built with .NET 8.0. It provides a complete solution for managing users, subscriptions, payments, and generating detailed reports. The application demonstrates modern software engineering principles including clean architecture, design patterns, and comprehensive testing.

Key Highlights

✨ Fully Functional Console Application - Interactive menu-driven interface
πŸ§ͺ Comprehensive Test Suite - 51 passing tests covering unit, integration, and non-functional testing
πŸ—οΈ Clean Architecture - Well-organized layers with separation of concerns
πŸ’Ύ Data Persistence - JSON-based file storage for all entities
πŸ“Š Advanced Reporting - Monthly reports with detailed analytics


✨ Features

πŸ‘₯ User Management

  • Create, update, and remove users
  • Role-based access control (Customer, Admin, System Process)
  • User profile management

πŸ“¦ Subscription Management

  • Basic & Premium subscription types
  • Create, update, cancel, and renew subscriptions
  • Support for Monthly, Quarterly, and Yearly renewal frequencies
  • Automatic renewal date calculation
  • Subscription status tracking

πŸ’³ Payment Processing

  • Process payments with transaction tracking
  • Automatic retry mechanism for failed payments
  • Payment history tracking
  • Transaction reference generation

πŸ”” Notification System

  • Renewal reminders
  • Payment failure notifications
  • Cancellation confirmations
  • Read/unread status tracking

πŸ“Š Reporting & Analytics

  • Monthly subscription reports
  • Payment history analysis
  • Failed payment tracking
  • Export reports to text files

πŸ—οΈ Architecture

SubTrackr follows a layered architecture pattern with clear separation of concerns:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      SubTrackr.Console              β”‚  ← Presentation Layer
β”‚      (User Interface)                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      SubTrackr.Core                 β”‚  ← Business Logic Layer
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Services                      β”‚  β”‚
β”‚  β”‚ Repositories                  β”‚  β”‚
β”‚  β”‚ Models                        β”‚  β”‚
β”‚  β”‚ Interfaces                    β”‚  β”‚
β”‚  β”‚ Factories                     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      Data Persistence              β”‚  ← Data Layer
β”‚      (JSON File Storage)          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Design Patterns Implemented

  • Repository Pattern - Abstract data access layer
  • Factory Pattern - Subscription creation
  • Service Layer Pattern - Business logic encapsulation
  • Dependency Injection - Loose coupling between components

πŸš€ Getting Started

Prerequisites

  • .NET 8.0 SDK or later
  • Visual Studio 2022 / VS Code / Rider (optional)

Installation

  1. Clone the repository

    git clone https://github.com/NickiMash17/SubTrackr.git
    cd SubTrackr
  2. Restore dependencies

    dotnet restore
  3. Build the solution

    dotnet build
  4. Run the console application

    dotnet run --project SubTrackr.Console/SubTrackr.Console.csproj

πŸ’» Usage

Running the Console App

# From the solution root
dotnet run --project SubTrackr.Console/SubTrackr.Console.csproj

The application will display a welcome screen and interactive menu:

╔════════════════════════════════════════╗
β•‘   Welcome to SubTrackr System          β•‘
β•‘   Subscription Management Platform     β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

╔════════════════════════════════════════╗
β•‘           MAIN MENU                    β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
1. User Management
2. Subscription Management
3. Payment Processing
4. View Notifications
5. Generate Reports
6. Save & Exit

Example Workflow

  1. Create a User

    • Select option 1 β†’ 1 (Add User)
    • Enter name, email, and select role
  2. Create a Subscription

    • Select option 2 β†’ 1 (Create Subscription)
    • Choose subscription type (Basic/Premium)
    • Enter plan details and renewal frequency
  3. Process Payment

    • Select option 3 β†’ 1 (Process Payment)
    • Enter user ID, subscription ID, and amount
  4. Generate Report

    • Select option 5 (Generate Reports)
    • Enter user ID, month, and year
    • Optionally save report to file

πŸ“ Project Structure

SubTrackr/
β”œβ”€β”€ SubTrackr.Core/                    # Core business logic
β”‚   β”œβ”€β”€ Models/                        # Domain models
β”‚   β”‚   β”œβ”€β”€ User.cs
β”‚   β”‚   β”œβ”€β”€ SubscriptionBase.cs        # Abstract base class
β”‚   β”‚   β”œβ”€β”€ BasicSubscription.cs
β”‚   β”‚   β”œβ”€β”€ PremiumSubscription.cs
β”‚   β”‚   β”œβ”€β”€ Payment.cs
β”‚   β”‚   β”œβ”€β”€ Notification.cs
β”‚   β”‚   └── MonthlyReport.cs
β”‚   β”œβ”€β”€ Services/                      # Business logic services
β”‚   β”‚   β”œβ”€β”€ UserService.cs
β”‚   β”‚   β”œβ”€β”€ SubscriptionService.cs
β”‚   β”‚   β”œβ”€β”€ PaymentService.cs
β”‚   β”‚   β”œβ”€β”€ NotificationService.cs
β”‚   β”‚   └── ReportService.cs
β”‚   β”œβ”€β”€ Repositories/                  # Data access layer
β”‚   β”‚   β”œβ”€β”€ GenericRepository.cs
β”‚   β”‚   β”œβ”€β”€ UserRepository.cs
β”‚   β”‚   β”œβ”€β”€ SubscriptionRepository.cs
β”‚   β”‚   β”œβ”€β”€ PaymentRepository.cs
β”‚   β”‚   └── NotificationRepository.cs
β”‚   β”œβ”€β”€ Interfaces/                    # Contracts
β”‚   β”œβ”€β”€ Factories/                     # Factory pattern
β”‚   └── Enums/                         # Enumerations
β”‚
β”œβ”€β”€ SubTrackr.Console/                 # Console application
β”‚   β”œβ”€β”€ Program.cs                     # Entry point
β”‚   └── MenuSystem.cs                  # Menu system
β”‚
└── SubTrackr.Tests/                   # Test suite
    β”œβ”€β”€ UnitTests/                     # Unit tests
    β”‚   β”œβ”€β”€ UserServiceTests.cs
    β”‚   β”œβ”€β”€ SubscriptionServiceTests.cs
    β”‚   β”œβ”€β”€ PaymentServiceTests.cs
    β”‚   └── ReportServiceTests.cs
    β”œβ”€β”€ IntegrationTests/              # Integration tests
    β”‚   β”œβ”€β”€ SubscriptionPaymentIntegrationTests.cs
    β”‚   └── EndToEndTests.cs
    β”œβ”€β”€ NonFunctionalTests/            # Performance & reliability
    β”‚   β”œβ”€β”€ PerformanceTests.cs
    β”‚   └── ReliabilityTests.cs
    └── TestHelpers/                   # Test utilities
        └── MockFactory.cs

πŸ§ͺ Testing

The project includes a comprehensive test suite with 51 passing tests covering:

Unit Tests

  • Service layer testing with mocks
  • Model validation and business logic
  • Factory pattern testing

Integration Tests

  • End-to-end workflows
  • Data persistence verification
  • Service integration testing

Non-Functional Tests

  • Performance benchmarks
  • Reliability and error handling
  • Concurrent operation testing

Running Tests

# Run all tests
dotnet test SubTrackr.Tests/SubTrackr.Tests.csproj

# Run with detailed output
dotnet test SubTrackr.Tests/SubTrackr.Tests.csproj --verbosity normal

# Run specific test category
dotnet test --filter "FullyQualifiedName~UnitTests"
dotnet test --filter "FullyQualifiedName~IntegrationTests"

Test Results

βœ… Total: 52 tests
βœ… Passed: 51
⏭️  Skipped: 1 (expected - polymorphic JSON limitation)
❌ Failed: 0

πŸ› οΈ Technologies

  • .NET 8.0 - Modern C# runtime
  • C# 12 - Latest language features
  • NUnit 3.14 - Testing framework
  • Moq 4.20 - Mocking framework
  • System.Text.Json - JSON serialization

πŸ“Š Data Storage

SubTrackr uses JSON file-based storage for simplicity:

  • users.json - User data
  • subscriptions.json - Subscription records
  • payments.json - Payment history
  • notifications.json - Notification records

Data is automatically loaded on startup and saved on exit.


🎨 Key Features in Detail

Subscription Types

Basic Subscription

  • Standard pricing
  • Single device support
  • No discounts

Premium Subscription

  • Discounted renewal pricing
  • Multiple bonus features
  • Extended grace period (7 days)

Payment Processing

  • 90% success rate simulation
  • Automatic retry mechanism (max 3 attempts)
  • Transaction reference tracking
  • Failure reason logging

Reporting

Monthly reports include:

  • Active subscriptions summary
  • Payment history
  • Total amount billed
  • Failed payment count
  • Export to text file

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘€ Author

Nicolette Mashaba

Created by Nicolette Mashaba


πŸ™ Acknowledgments

  • Built with modern .NET best practices
  • Comprehensive test coverage
  • Clean architecture principles

Made with ❀️ using .NET 8.0

⭐ Star this repo if you find it helpful!


Created by Nicolette Mashaba 🎨

SubTrackr - Your subscription management solution

About

SubTrackr is a C# subscription management system that handles users, plans, payments, notifications, and reports. Built with OOP, design patterns, and clean architecture. Includes full unit, integration, and non-functional tests.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages