https://github.com/quangxuan98765/data-processing-api
ASP.NET Core Web API for Excel Data Processing & Bulk Database Operations
https://github.com/quangxuan98765/data-processing-api
aspnet-core bulk-insert demo-project dotnet-core excel-processing power-automate sql-server web-api
Last synced: 26 days ago
JSON representation
ASP.NET Core Web API for Excel Data Processing & Bulk Database Operations
- Host: GitHub
- URL: https://github.com/quangxuan98765/data-processing-api
- Owner: quangxuan98765
- Created: 2025-07-26T09:58:32.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-09-17T08:42:54.000Z (9 months ago)
- Last Synced: 2026-03-06T15:40:25.891Z (3 months ago)
- Topics: aspnet-core, bulk-insert, demo-project, dotnet-core, excel-processing, power-automate, sql-server, web-api
- Language: C#
- Homepage:
- Size: 5.18 MB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ข DataProcessingAPI - Enterprise Business Management System
> **Enterprise .NET 8 Web API with JWT Authentication & Power Platform Integration**
## ๐ Overview
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.
### โจ Key Features
- ๐ **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
## ๐ ๏ธ Technology Stack
- **.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
## ๐๏ธ Project Structure
```
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
```
## ๐ฏ API Architecture
### ๐ Authentication API (Auth Group)
- **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
### ๐ฐ Financial API (Financial Group) - ๐ JWT Protected
#### Revenue Management
- **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
#### Expense Management
- **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
### ๐ Future Extensions
- **HR Management** - Employee and payroll systems
- **Inventory** - Stock and product management
- **Accounting** - Ledger and financial reporting
## ๐ Quick Start
```bash
# 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`
## ๐ Authentication Flow
1. **Register/Login** โ Get JWT token
2. **Include token** in Authorization header: `Bearer `
3. **Access protected endpoints** (Financial APIs require authentication)
```http
# Login
POST /api/auth/login
{ "username": "admin", "password": "Password123!" }
# Use token for protected endpoints
GET /api/expense
Authorization: Bearer
```
## ๐ Enterprise DTOs & Clean Architecture
### Request/Response Pattern
```csharp
// 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
```
### Benefits
- โ
**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
## ๐ API Endpoints
### Authentication Endpoints
```
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
```
### Financial Endpoints (๐ JWT Required)
```
# 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
```
## ๐ Power Platform Integration
### Custom Connectors
- **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
### Power Apps Integration
- **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
### Power Automate Flows
- **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
### Integration Benefits
- โ
**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
## ๐ License
MIT License - see [LICENSE](LICENSE) file for details.
## ๐ Contact
**Developer**: Quang Xuรขn
**Email**: acongchuongheo@gmail.com
**GitHub**: [@quangxuan98765](https://github.com/quangxuan98765)
---
โญ **Professional .NET development with Clean Architecture principles**