Enterprise .NET 8 Web API with JWT Authentication & Power Platform Integration
DataProcessingAPI is an enterprise-grade .NET 8 Web API built with Clean Architecture principles for comprehensive business data management. Features JWT authentication, reusable authentication library, and dual API architecture for enterprise scalability.
- π JWT Authentication - Secure token-based authentication with BCrypt password hashing
- π Reusable AuthLibrary - Standalone authentication library for code reuse
- ποΈ Enterprise Architecture - Separate Auth & Financial API documentation
- π° Financial Management - Secure revenue and expense tracking with authorization
- π CRUD Operations - Complete data management with proper security
- π Excel Integration - Bulk import/export with Power Automate
- β Data Validation - Multi-layer validation with business rules
- π‘οΈ Security - JWT tokens, [Authorize] attributes, SQL injection protection
- π Power Platform - Custom Connectors for Power Apps and Power Automate
- π Scalable - Modular design for easy domain extensions
- .NET 8 - Latest LTS framework
- ASP.NET Core - Web API with dual Swagger documentation
- SQL Server - Database with stored procedures
- JWT Authentication - Secure token-based auth with BCrypt
- AuthLibrary - Reusable authentication components
- Clean Architecture - Domain-driven design pattern
- Dependency Injection - Built-in .NET Core DI
- Power Platform - Custom Connectors for enterprise integration
DataProcessingAPI/
βββ AuthLibrary/ # Reusable JWT + BCrypt authentication library
β βββ Models/ # User, token models
β βββ DTOs/ # Request/response DTOs
β βββ Services/ # Auth, password, token services
β βββ Interfaces/ # Service contracts
β βββ SQL/ # Database stored procedures
βββ DataAccess/ # Database service layer
βββ DataProcessingAPI/ # Main API project
β βββ Controllers/
β β βββ Auth/ # Authentication endpoints
β β βββ Financial/ # Financial management (protected)
β βββ Application/ # Business logic
β βββ Domain/ # Domain entities
β βββ Shared/ # Common utilities
βββ publish/ # IIS deployment artifacts
- POST /api/auth/login - User authentication with JWT token
- POST /api/auth/register - New user registration
- POST /api/auth/logout - Token revocation
- POST /api/auth/change-password - Secure password updates
- GET /api/auth/profile - Get user profile
- GET /api/revenue - Get all revenue records
- GET /api/revenue/{id} - Get specific revenue by ID
- POST /api/revenue - Create new revenue record
- PUT /api/revenue/{id} - Update existing revenue
- DELETE /api/revenue/{id} - Delete revenue record
- POST /api/revenue/bulk-import - Excel bulk import with validation
- GET /api/expense - Get all expense records
- GET /api/expense/{id} - Get specific expense by ID
- POST /api/expense - Create new expense record
- PUT /api/expense/{id} - Update existing expense
- DELETE /api/expense/{id} - Delete expense record
- POST /api/expense/bulk-import - Excel bulk import with validation
- HR Management - Employee and payroll systems
- Inventory - Stock and product management
- Accounting - Ledger and financial reporting
# Clone repository
git clone https://github.com/quangxuan98765/excel-data-processing-api
# Navigate to project
cd DataProcessingAPI
# Setup database (run SQL scripts)
# 1. Run AuthLibrary/SQL/AuthStoredProcedures.sql
# 2. Configure connection string in appsettings.json
# Configure JWT settings in appsettings.json
{
"JwtSettings": {
"SecretKey": "YourSecretKey32CharactersMinimum!",
"Issuer": "DataProcessingAPI",
"Audience": "DataProcessingAPI",
"ExpiryMinutes": 60
}
}
# Run the API
dotnet run
Swagger Documentation:
- Auth API:
https://localhost:7xxx/swagger-auth
- Financial API:
https://localhost:7xxx/swagger-financial
- Register/Login β Get JWT token
- Include token in Authorization header:
Bearer <token>
- Access protected endpoints (Financial APIs require authentication)
# Login
POST /api/auth/login
{ "username": "admin", "password": "Password123!" }
# Use token for protected endpoints
GET /api/expense
Authorization: Bearer <your-jwt-token>
// API Request DTOs (Client β Server)
CreateRevenueRequest // POST /api/revenue
UpdateRevenueRequest // PUT /api/revenue/{id}
CreateExpenseRequest // POST /api/expense
UpdateExpenseRequest // PUT /api/expense/{id}
// API Response DTOs (Server β Client)
RevenueResponse // GET operations
ExpenseResponse // GET operations
// Import DTOs (Excel β API)
RevenueImportDto // Bulk import from Excel
ExpenseImportDto // Bulk import from Excel
- β Security: Request DTOs prevent ID/timestamp manipulation
- β Validation: Separate validation rules for create vs update
- β Documentation: Clear API contracts in Swagger
- β Maintainability: Easy to extend without breaking changes
POST /api/auth/login # User login with JWT token
POST /api/auth/register # New user registration
POST /api/auth/logout # Token revocation
POST /api/auth/change-password # Password updates
GET /api/auth/profile # Get user profile
# Revenue Management
GET /api/revenue # Get all revenue records
GET /api/revenue/{id} # Get revenue by ID
POST /api/revenue # Create new revenue
PUT /api/revenue/{id} # Update revenue
DELETE /api/revenue/{id} # Delete revenue
POST /api/revenue/bulk-import # Excel bulk import
# Expense Management
GET /api/expense # Get all expense records
GET /api/expense/{id} # Get expense by ID
POST /api/expense # Create new expense
PUT /api/expense/{id} # Update expense
DELETE /api/expense/{id} # Delete expense
POST /api/expense/bulk-import # Excel bulk import
- Financial Data API Connector - Complete CRUD operations with JWT authentication
- Swagger-based Definition - Auto-generated from API documentation
- Request/Response DTOs - Clean API contracts for Power Platform
- JWT Authentication Flow - Secure login with token management
- Financial Data Management - Full CRUD operations with proper authorization
- Form Validation - Client-side + server-side validation
- Data Binding - Clean Response DTOs for easy Power Apps binding
- Excel Data Import - Bulk processing with validation and error handling
- Automated Workflows - Scheduled data processing and reporting
- Error Handling - Comprehensive error logging and retry mechanisms
- β Type Safety - Strongly typed Request/Response DTOs
- β Error Handling - Structured error responses
- β Security - JWT authentication for all protected endpoints
- β Scalability - Enterprise-grade API design patterns
MIT License - see LICENSE file for details.
Developer: Quang XuΓ’n
Email: [email protected]
GitHub: @quangxuan98765
β Professional .NET development with Clean Architecture principles