A production-ready .NET 8 web application for managing invoices, clients, products, and payments with Clean Architecture principles.
- 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
- 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
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
- .NET 8 SDK
- Docker (optional)
- Git
-
Clone the repository
git clone https://github.com/yourusername/invoicepro.git cd invoicepro
-
Restore dependencies
dotnet restore
-
Update database
dotnet ef database update --project src/InvoicePro.Infrastructure --startup-project src/InvoicePro.Web
-
Run the application
dotnet run --project src/InvoicePro.Web
-
Access the application
- Web UI: http://localhost:5291
- API Documentation: http://localhost:5291/api
-
Clone the repository
git clone https://github.com/yourusername/invoicepro.git cd invoicepro
-
Run with Docker Compose
docker-compose up -d
-
Access the application
- Web UI: http://localhost:8080
- API Documentation: http://localhost:8080/api
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"
}
}
}
For email functionality, configure SMTP settings:
-
Gmail Setup:
- Enable 2-factor authentication
- Generate an app-specific password
- Use your Gmail address and app password
-
Other SMTP Providers:
- Update
SmtpHost
,SmtpPort
, andEnableSsl
accordingly
- Update
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
Run the test suite:
# Run all tests
dotnet test
# Run with coverage
dotnet test --collect:"XPlat Code Coverage"
The API is documented using Swagger/OpenAPI. Access the interactive documentation at:
- Development: http://localhost:5291/api
- Production: https://yourdomain.com/api
GET /api/v1/dashboard
- Dashboard dataGET /api/v1/clients
- List all clientsPOST /api/v1/clients
- Create new clientGET /api/v1/invoices
- List all invoicesPOST /api/v1/invoices
- Create new invoiceGET /api/v1/payments
- List all paymentsPOST /api/v1/payments
- Record payment
# Build image
docker build -t invoicepro .
# Run container
docker run -p 8080:80 invoicepro
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
-
Create App Service
az webapp create --resource-group myResourceGroup --plan myAppServicePlan --name invoicepro-app --runtime "DOTNET|8.0"
-
Deploy from GitHub
- Connect your GitHub repository
- Enable continuous deployment
- Configure environment variables
-
Package application
dotnet publish -c Release -o ./publish
-
Deploy using EB CLI
eb init eb create production eb deploy
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"
- 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
- Serilog: Structured logging with multiple sinks
- Health Checks: Application health monitoring
- Performance Counters: Built-in ASP.NET Core metrics
- Exception Handling: Global exception middleware
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Follow Clean Architecture principles
- Write unit tests for new features
- Use meaningful commit messages
- Update documentation as needed
- Follow C# coding conventions
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- ASP.NET Core - Web framework
- Entity Framework Core - ORM
- MediatR - Mediator pattern
- AutoMapper - Object mapping
- Serilog - Logging framework
- Bootstrap - CSS framework
- Font Awesome - Icons
InvoicePro - Professional invoice management made simple. πΌβ¨