Skip to content

ragner01/InvoicePro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

InvoicePro - Invoice & Billing Management System

A production-ready .NET 8 web application for managing invoices, clients, products, and payments with Clean Architecture principles.

πŸš€ Features

Core Functionality

  • Client Management: Complete CRUD operations for client information
  • Product/Service Management: Manage products and services with inventory tracking
  • Invoice Management: Create, edit, send, and track invoices
  • Payment Processing: Record payments and track outstanding balances
  • Dashboard: Real-time analytics and overview of business metrics
  • PDF Generation: Professional invoice and payment receipt generation
  • Email Integration: Send invoices via email with PDF attachments

Technical Features

  • Clean Architecture: Domain, Application, Infrastructure, and Web layers
  • ASP.NET Core 8: Modern web framework with MVC and Web API
  • Entity Framework Core: SQLite database with migrations
  • MediatR: CQRS pattern implementation
  • AutoMapper: Object-to-object mapping
  • FluentValidation: Input validation
  • Serilog: Structured logging
  • Swagger/OpenAPI: API documentation
  • Docker Support: Containerized deployment
  • Currency Support: Nigerian Naira (₦/NGN) formatting

πŸ—οΈ Architecture

InvoicePro/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ InvoicePro.Domain/          # Domain entities and business logic
β”‚   β”œβ”€β”€ InvoicePro.Application/     # Application services and DTOs
β”‚   β”œβ”€β”€ InvoicePro.Infrastructure/  # Data access and external services
β”‚   └── InvoicePro.Web/             # Web API and MVC controllers
β”œβ”€β”€ tests/                          # Unit and integration tests
β”œβ”€β”€ docker-compose.yml             # Multi-container deployment
β”œβ”€β”€ Dockerfile                     # Application containerization
└── README.md                      # This file

πŸ› οΈ Prerequisites

πŸ“¦ Installation & Setup

Option 1: Local Development

  1. Clone the repository

    git clone https://github.com/yourusername/invoicepro.git
    cd invoicepro
  2. Restore dependencies

    dotnet restore
  3. Update database

    dotnet ef database update --project src/InvoicePro.Infrastructure --startup-project src/InvoicePro.Web
  4. Run the application

    dotnet run --project src/InvoicePro.Web
  5. Access the application

Option 2: Docker Deployment

  1. Clone the repository

    git clone https://github.com/yourusername/invoicepro.git
    cd invoicepro
  2. Run with Docker Compose

    docker-compose up -d
  3. Access the application

πŸ”§ Configuration

Environment Variables

Create appsettings.Development.json for local development:

{
  "ConnectionStrings": {
    "DefaultConnection": "Data Source=invoicepro.db"
  },
  "Email": {
    "SmtpHost": "smtp.gmail.com",
    "SmtpPort": "587",
    "EnableSsl": "true",
    "Username": "your-email@gmail.com",
    "Password": "your-app-password",
    "FromAddress": "noreply@invoicepro.com"
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  }
}

Email Configuration

For email functionality, configure SMTP settings:

  1. Gmail Setup:

    • Enable 2-factor authentication
    • Generate an app-specific password
    • Use your Gmail address and app password
  2. Other SMTP Providers:

    • Update SmtpHost, SmtpPort, and EnableSsl accordingly

πŸ“Š Database Schema

The application uses SQLite with the following main entities:

  • Clients: Company information and contact details
  • Products: Products and services with pricing
  • Invoices: Invoice headers with line items
  • Payments: Payment records linked to invoices
  • InvoiceItems: Individual line items on invoices

πŸ§ͺ Testing

Run the test suite:

# Run all tests
dotnet test

# Run with coverage
dotnet test --collect:"XPlat Code Coverage"

πŸ“š API Documentation

The API is documented using Swagger/OpenAPI. Access the interactive documentation at:

Key Endpoints

  • GET /api/v1/dashboard - Dashboard data
  • GET /api/v1/clients - List all clients
  • POST /api/v1/clients - Create new client
  • GET /api/v1/invoices - List all invoices
  • POST /api/v1/invoices - Create new invoice
  • GET /api/v1/payments - List all payments
  • POST /api/v1/payments - Record payment

🐳 Docker Deployment

Single Container

# Build image
docker build -t invoicepro .

# Run container
docker run -p 8080:80 invoicepro

Multi-Container (Recommended)

# Start all services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

πŸš€ Production Deployment

Azure App Service

  1. Create App Service

    az webapp create --resource-group myResourceGroup --plan myAppServicePlan --name invoicepro-app --runtime "DOTNET|8.0"
  2. Deploy from GitHub

    • Connect your GitHub repository
    • Enable continuous deployment
    • Configure environment variables

AWS Elastic Beanstalk

  1. Package application

    dotnet publish -c Release -o ./publish
  2. Deploy using EB CLI

    eb init
    eb create production
    eb deploy

Kubernetes

apiVersion: apps/v1
kind: Deployment
metadata:
  name: invoicepro
spec:
  replicas: 3
  selector:
    matchLabels:
      app: invoicepro
  template:
    metadata:
      labels:
        app: invoicepro
    spec:
      containers:
      - name: invoicepro
        image: invoicepro:latest
        ports:
        - containerPort: 80
        env:
        - name: ConnectionStrings__DefaultConnection
          value: "Data Source=/app/data/invoicepro.db"

πŸ”’ Security Features

  • Input Validation: FluentValidation for all user inputs
  • SQL Injection Protection: Entity Framework parameterized queries
  • XSS Protection: ASP.NET Core built-in protections
  • CSRF Protection: Anti-forgery tokens
  • Secure Headers: Security headers middleware
  • Environment-based Configuration: Separate configs for dev/prod

πŸ“ˆ Monitoring & Logging

  • Serilog: Structured logging with multiple sinks
  • Health Checks: Application health monitoring
  • Performance Counters: Built-in ASP.NET Core metrics
  • Exception Handling: Global exception middleware

🀝 Contributing

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

Development Guidelines

  • Follow Clean Architecture principles
  • Write unit tests for new features
  • Use meaningful commit messages
  • Update documentation as needed
  • Follow C# coding conventions

πŸ“ License

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

πŸ†˜ Support

πŸ™ Acknowledgments

πŸ“Š Project Status

Build Status Code Coverage License


InvoicePro - Professional invoice management made simple. πŸ’Όβœ¨

About

Invoice and billing management system built with .NET 8 and Clean Architecture.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages