A Next-Generation Financial Management Platform Built with a Microservices Architecture
- Executive Summary
- Project Vision and Target Audience
- Core Features and Capabilities
- Subscription Models and Revenue Strategy
- System Architecture
- 5.1. General Architecture and Microservices
- 5.2. Backend Architecture
- 5.3. Frontend (WPF) Architecture
- 5.4. Database Architecture and Strategy
- Technologies Used
- Key Systems and Workflows
- 7.1. User Authentication and Registration (OTP & JWT)
- 7.2. Secure Debt System (GBS)
- 7.3. Multi-Format Reporting System
- 7.4. Dynamic Exchange Rate Management
- DevOps, Containerization, and Monitoring
- 8.1. Docker Architecture and Services
- 8.2. Monitoring and Health Checks (Prometheus & Grafana)
- 8.3. Data Backup and Security
- Installation, Configuration, and Running
- 9.1. Prerequisites
- 9.2. Quick Setup with Docker (Recommended)
- 9.3. Configuration (
appsettings.json) - 9.4. Environment File Setup (
.envfor Docker Compose & FinBot)
- API Usage and Testing
- Conclusion and Future Vision
- License and Contact
FinTrack is a next-generation Software as a Service (SaaS) platform that empowers both individual and professional users to take full control of their financial lives. Built on a microservices architecture, the project consists of the core business logic service FinTrackWebApi, the AI operations service FinBotWebApi, and the system administration service WinTrackManagerPanel (in development). With its comprehensive feature set, multi-format professional reporting, AI-powered smart assistant, and multi-platform support, FinTrack eliminates complexity in financial management, offering users clarity, security, and efficiency.
Vision: To create the world's most intuitive and powerful financial management tool, increasing financial literacy and empowering users of all levels to achieve their financial goals.
Target Audience:
- Entry-Level Users: Individuals looking to track personal expenses and create a budget.
- Intermediate and Advanced Users: Individuals and families managing multiple accounts, investments, and budgets who require detailed analysis.
- Professionals and Freelancers: Professionals who need to meticulously manage cash flow, require detailed reporting, and need legally valid debt tracking.
- Comprehensive Currency Support: Track and convert over 950 global currencies in real-time.
- Strategic Budget Management: Create dynamic budgets, set spending limits, and track goals.
- Centralized Account Tracking: Manage all bank, credit card, and investment accounts from a single dashboard.
- Smart Income/Expense Analysis: Automatically categorize transactions and provide insights into spending habits.
- Secure Debt System (GBS): A peer-to-peer debt platform with video verification, encryption, and legally admissible evidence.
- AI-Powered Financial Assistant (FinBot): An intelligent assistant that offers personalized financial advice, answers questions, and provides proactive solutions.
- Detailed and Flexible Reporting: Generate professional reports in PDF, WORD, TEXT, XML, EXCEL, and MARKDOWN formats.
- Comprehensive Admin Panel (WinTrackManagerPanel): System management, user supervision, content moderation, and system health monitoring.
- Data Visualization: Turn data into understandable insights with interactive charts using LiveCharts2.
FinTrack uses a freemium model to cater to different user segments. The payment infrastructure is integrated with Stripe, providing globally recognized security standards.
| Plan Name | Price | Target Audience |
|---|---|---|
| Free | 0 USD/Month | Basic financial tracking for entry-level users. |
| Plus | 10 USD/Month | Intermediate users managing multiple accounts and budgets. |
| Pro | 25 USD/Month | Professionals, freelancers, and users who need advanced features like GBS. |
FinTrack is built on a Microservices Architecture, consisting of independent, scalable, and flexible units. This structure allows each service to use its own technology stack and be developed and deployed independently.
- FinTrackWebApi (Main API Service): The heart of the project. It houses all critical business logic, including user management, authentication, account/transaction/budget management, Stripe integration, and reporting.
- FinBotWebApi (ChatBot Service): Manages artificial intelligence operations. Developed with Python & FastAPI for integration with Ollama and the Mistral 7B model.
- WinTrackManagerPanel (Admin Panel): A service designed for system administrators, providing administrative functions such as user management, GBS approval processes, system monitoring, and content moderation.
- FinTrackWebApi & WinTrackManagerPanel: Developed on ASP.NET Core 8.0 following RESTful API principles and the Dependency Injection (DI) design pattern.
- FinBotWebApi: Developed with Python and the high-performance FastAPI framework.
- FinTrackForWindows (WPF): A native application providing a rich desktop experience for Windows. It communicates with FinTrackWebApi via secure REST API calls.
- Centralized Data Management (Store Pattern): Data management is centralized using services (Stores) like
AccountStoreandBudgetStore. This ensures data consistency across components and optimizes API calls.
- Database Engine: PostgreSQL 15
- ORM (Object-Relational Mapper): Entity Framework Core 8
- Approach: Code-First with Migrations
FinTrack uses a dual-database strategy to ensure data integrity and auditability:
- MainDB: The primary database that stores main application data (users, accounts, transactions, budgets, etc.).
- LogDB: A secondary database that records all data manipulation operations (POST, PUT, DELETE) on
MainDBfor auditing purposes.
For comprehensive technical documentation covering all database tables, columns, data types, relationships (including an ER diagram), constraints, and indexes, please refer to the file below:
➡️ Detailed Database Schema Document
| Category | Technology / Tool |
|---|---|
| Backend Framework | ASP.NET Core 8.0, Python (FastAPI) |
| Language | C# 12, Python 3.10-slim |
| Frontend | WPF (.NET) |
| Database | PostgreSQL v15 |
| ORM | Entity Framework Core 8.0 |
| Architecture | Microservices, RESTful API |
| Containerization | Docker, Docker Compose |
| Authentication | JWT (JSON Web Tokens), ASP.NET Core Identity, OTP |
| Monitoring | Prometheus, Grafana, cAdvisor, Node Exporter |
| Payment System | Stripe SDK |
| AI/ChatBot | Ollama, Mistral 7B |
| API Documentation | Swagger (OpenAPI) |
| Notifications | SMTP, Notification.Wpf |
| Visualization | LiveCharts2 |
- Request: The user sends their email, username, and password to the
POST /Auth/user/initiate-registrationendpoint. - Process: The server checks for the uniqueness of the information. It generates a 6-digit OTP. The hashed version of this OTP and the user's information (including password) are temporarily saved in the
OtpVerificationstable. The plain OTP is sent to the user via email. - Response: If successful, a message "OTP has been sent to your email address" is returned.
- Request: The user sends the code from their email to the
POST /Auth/user/verify-otp-and-registerendpoint. - Process: The server verifies the OTP. If correct, it retrieves the user information from the temporary table and permanently saves it to the ASP.NET Identity system using
UserManager.CreateAsync(). The user is assigned a default role, and the temporary OTP record is deleted. - Response: A message "Registration successful. You can now log in" is returned.
- Request: The user sends a request to the
POST /Auth/user/loginendpoint with their email and password. - Process: The credentials are verified using
SignInManager.CheckPasswordSignInAsync. If successful, a JWT Access Token containing the user's ID, email, and roles is generated. - Response: A
200 OKresponse is returned with user information and theaccessToken. This token is used in theAuthorization: Bearer <token>header to access protected endpoints.
- Proposal: The lender sends a debt proposal by entering the borrower's email.
- Video Verification: The borrower, upon accepting the proposal, records a security video containing a legal commitment statement.
- Operator Approval: An operator reviews the video and debt details via the
WinTrackManagerPanel. - Encryption: The approved video is irreversibly encrypted. A 20-character private key to unlock the video is delivered only to the lender.
- Automatic Tracking: For overdue debts, the lender is granted access to the video and can decrypt it using their key.
A flexible system that allows users to convert their financial data into meaningful and portable documents.
- Request: The user selects the data range (date, accounts, categories, etc.) and the desired format (PDF, WORD, EXCEL, XML, TEXT, MARKDOWN) via the WPF application.
- API Call: The client sends a request with these criteria to the relevant reporting endpoint on FinTrackWebApi (e.g.,
POST /api/reports/generate). - Data Collection and Processing: The server fetches the relevant financial data from the database based on the request.
- Report Generation: The fetched data is processed using format-specific libraries (e.g., QuestPDF for PDF, ClosedXML for Excel) and converted into a file stream.
- Response: The generated file stream is returned to the client with the appropriate
Content-Typeheader. The client then presents this file to the user for download.
An intelligent mechanism is used for data storage efficiency. The system compares the exchange rate data fetched from an external provider with existing data. If the change in the rate is below a significant threshold (e.g., the 6th decimal place), instead of creating a new record, a "multiplier" value of the existing record is updated. This optimizes the database size and improves query performance.
All system components are containerized with Docker, ensuring portability, isolation, and easy deployment.
| Service Name | Technology/Purpose | Description |
|---|---|---|
| fintrack_api | ASP.NET Core | The Web API that executes the main business logic. |
| finbot_api | Python/FastAPI | The AI assistant service. |
| wintrack_manager | ASP.NET Core | The admin panel service. |
| postgres_db | PostgreSQL | The main application database (MainDB). |
| postgres_db_logs | PostgreSQL | The logging database (LogDB). |
| ollama | AI Engine | The AI engine that runs the Mistral 7B model. |
| prometheus | Monitoring | A time-series database that collects metrics. |
| grafana | Visualization | A dashboard for visualizing metrics. |
| node_exporter | Exporter | Collects health metrics from the API services. |
| postgres_exporter | Exporter | Collects health metrics from PostgreSQL. |
| cadvisor | Monitoring | Collects performance metrics of Docker containers. |
| postgres_backup | Backup | Automatically backs up MainDB every night at 03:00. |
| ngrok | Tunneling | Exposes the development API to the internet. |
- Prometheus: Collects real-time performance metrics from all system components (APIs, databases, Docker) via
node_exporter,postgres_exporter, andcAdvisor. - Grafana: Visualizes the data collected by Prometheus in interactive dashboards, showing the overall health of the system (CPU, RAM, API response times, etc.).
The postgres_backup container takes a full backup of MainDB every night at 03:00, safeguarding the system against potential data loss.
- .NET SDK 8.0+
- Docker Desktop
- Git
- Python 3.10-Slim
- Clone the Repository:
git clone https://github.com/EnesEfeTokta/FinTrackWebApi.git cd FinTrackWebApi - Start Services with Docker Compose:
This command will automatically start all microservices, databases, and dependencies.
docker-compose up -d
Sensitive configurations (API keys, passwords) are managed via the appsettings.json file and environment variables. For production, it is highly recommended to use environment variables or a secure secret management tool.
You need to create environment variable files for both Docker Compose and the FinBot service. These files store sensitive information and configuration values securely.
A. Docker Compose .env File Example:
Create a file named .env in the project root with the following content (replace values as needed):
# --- PostgreSQL Main Database Settings ---
POSTGRES_DB=YOUR_POSTGRES_DB
POSTGRES_USER=YOUR_POSTGRES_USER
POSTGRES_PASSWORD=YOUR_POSTGRES_PASSWORD
# --- PostgreSQL Log Database Settings ---
LOG_DB_PASSWORD=YOUR_LOG_DB_PASSWORD
# --- Ngrok Service Settings ---
NGROK_AUTHTOKEN=YOUR_NGROK_AUTHTOKENB. FinBot .env File Example:
FINTRACK_API_BASE_URL="http://localhost:8090"How to Use:
- Copy the template for the main
.envfile into a new file named.envin the project's root directory. - Replace all placeholder values (e.g.,
your_db_user) with your actual configuration secrets and keys. - Never commit
.envfiles with real secrets to public repositories. Ensure your.gitignorefile includes.env.
Below is a reference for the appsettings.json structure, which is populated by these environment variables when running with Docker.
{
"ConnectionStrings": {
"DefaultConnection": "Host=localhost;Port=Your_Port;Database=Your_DB;Username=Your_UserName;Password=Your_Password",
"LogConnection": "Host=localhost;Port=Your_Port;Database=Your_DB;Username=Your_UserName;Password=Your_Password"
},
"Token": {
"Issuer": "Your_Url",
"Audience": "Your_Url",
"SecurityKey": "Your_SecurityKey",
"Expiration": 0
},
//... other settings
}Security Note: For production, always use environment variables, Azure Key Vault, or similar secure configuration management tools for sensitive data.
-
API Reference and Detailed Documentation The FinTrack API is documented with an interactive Swagger UI and detailed Markdown documents for each controller.
-
Interactive API Documentation (Swagger) To test API endpoints and view schemas live, you can access the Swagger UI when the project is running at the following address:
-
FinTrackWebApi: http://localhost:5246/swagger
-
Grafana This allows us to monitor the overall health of the system from a single central location. By default, the username and password are
admin. -
Grafana: http://localhost:3000
-
Detailed Endpoint Documents Below are links to the detailed documentation files for each controller in the FinTrackWebApi service. Each document explains the endpoint's purpose, required request formats, and successful and error responses in detail.
-
UserAuthController- Manages user registration, OTP verification, and login processes. -
UserController- Provides all profile, settings, and summary data for the logged-in user from a single source. -
UserSettingsController- Manages the user's profile, security, application, and notification settings. -
AccountController- Manages the user's financial accounts (bank, cash, etc.). -
TransactionCategoryController- Manages personal categories for income/expense transactions. -
TransactionsController- Records and filters all income/expense transactions. -
BudgetsController- Creates and manages the user's budgets. -
ReportsController- Generates dynamic financial reports in various formats (PDF, Excel, etc.). -
DebtController- Manages the main workflow of the Secure Debt System (GBS) (proposal, acceptance, default). -
VideosController- Manages video upload, encryption, and secure viewing processes for GBS. -
MembershipController- Manages subscription plans and user memberships, initiates Stripe payment sessions. -
StripeWebhookController- Listens for successful payment events from Stripe and automatically activates memberships. -
NotificationController- Manages user-specific in-app notifications. -
FeedbackController- Allows users to submit feedback. -
ChatController- Acts as a secure proxy for the FinBot (Python) service. -
LogController- Provides (secured) access to system log files.
This project is supported by comprehensive documentation aimed at various technical levels. Use the links below to quickly find the information you need.
-
- Read this document to understand the project's high-level architecture, services, technologies, and the data flow between them.
-
- Look here for a detailed description of the database tables, columns, relationships, and the ERD.
-
➡️ API Reference and Endpoint Details
- Markdown files containing technical details, request/response formats, and usage examples for all API endpoints are collected here.
-
➡️ Frequently Asked Questions (FAQ)
- Review this document for quick answers on setting up, running the project, API usage, and common issues.
-
➡️ Roles and Permissions Matrix
- Use this document to understand the user roles in the system (
User,Admin, etc.) and their permissions on the API.
- Use this document to understand the user roles in the system (
FinTrack is not just a financial tracking tool but a holistic ecosystem aimed at enhancing the financial well-being of its users. With its solid technical foundation, modern microservices architecture, and innovative features, it is ready to meet market needs. The future vision includes mobile applications (iOS & Android), advanced AI features (anomaly detection, proactive budget optimization), and third-party integrations.
- License: This project is licensed under the GPL license. See the LICENSE file for details.
- Project Owner: Enes Efe Tokta
- Contact: enesefetokta@gmail.com
- LinkedIn: https://www.linkedin.com/in/enes-efe-tokta/
- Project Link: https://github.com/EnesEfeTokta/FinTrackWebApi
