A financial management application built with a microservices architecture using NestJS.
This project consists of the following microservices:
- API Gateway: Entry point for client applications
- Auth Service: Handles user authentication and authorization
- Transaction Service: Manages financial transactions
- Budget Service: Handles budget creation and tracking
- Analytics Service: Provides financial analytics and reporting
- AI Insights Service: Offers AI-powered financial insights
All microservices communicate with each other via NATS message broker.
graph TD
Client[Client Applications] --> Gateway[API Gateway]
Gateway --> Auth[Auth Service]
Gateway --> Transaction[Transaction Service]
Gateway --> Budget[Budget Service]
Gateway --> Analytics[Analytics Service]
Gateway --> AI[AI Insights Service]
%% Database connections
Auth --> AuthDB[(Auth DB)]
Transaction --> TransactionDB[(Transaction DB)]
Budget --> BudgetDB[(Budget DB)]
%% NATS Message Broker
NATS{NATS Message Broker}
Auth <--> NATS
Transaction <--> NATS
Budget <--> NATS
Analytics <--> NATS
AI <--> NATS
Gateway <--> NATS
%% Service interactions
Transaction -- "Uses auth data" --> Auth
Budget -- "Uses auth data" --> Auth
Analytics -- "Uses transaction data" --> Transaction
Analytics -- "Uses budget data" --> Budget
AI -- "Uses transaction data" --> Transaction
AI -- "Uses budget data" --> Budget
%% Styling
classDef gateway fill:#f9f,stroke:#333,stroke-width:2px
classDef service fill:#bbf,stroke:#333,stroke-width:1px
classDef database fill:#fda,stroke:#333,stroke-width:1px
classDef broker fill:#bfb,stroke:#333,stroke-width:2px
class Gateway gateway
class Auth,Transaction,Budget,Analytics,AI service
class AuthDB,TransactionDB,BudgetDB database
class NATS broker
- Purpose: Single entry point for all client applications
- Responsibilities:
- Route API requests to appropriate microservices
- Handle authentication and authorization via JWT
- Provide unified API documentation with Swagger
- Perform request validation
- Technologies: NestJS, Passport.js, Swagger
- Purpose: Manage user authentication and authorization
- Responsibilities:
- User registration and login
- Password encryption and verification
- JWT token generation and validation
- User profile management
- Technologies: NestJS, bcrypt, JWT, MongoDB
- Purpose: Handle financial transaction management
- Responsibilities:
- Create, read, update, and delete transactions
- Categorize transactions (income, expense)
- Store transaction metadata (date, category, description)
- Upload and store transaction receipts
- Technologies: NestJS, MongoDB
- Purpose: Manage budget creation and tracking
- Responsibilities:
- Create and manage budget plans
- Track spending against budget limits
- Provide budget utilization statistics
- Support recurring budgets
- Technologies: NestJS, MongoDB
- Purpose: Provide financial analytics and reporting
- Responsibilities:
- Calculate spending patterns
- Generate financial summaries
- Provide trend analysis
- Create visualizable data for dashboards
- Technologies: NestJS
- Purpose: Provide AI-powered financial insights
- Responsibilities:
- Generate savings recommendations
- Identify spending patterns
- Predict future expenses
- Suggest budget optimizations
- Technologies: NestJS, Machine Learning libraries
- Purpose: Enable asynchronous communication between microservices
- Responsibilities:
- Message routing
- Event broadcasting
- Service discovery
- Load balancing
- Node.js (v16 or higher) - only for local development
- Yarn or npm - only for local development
git clone <repository-url>
cd money-wise/microservicesTo run the app locally:
cd api-gateway && yarn install
cd ../auth-service && yarn install
cd ../transaction-service && yarn install
cd ../budget-service && yarn install
cd ../analytics-service && yarn install
cd ../ai-insights-service && yarn install- Install Mongodb GUI
- Create appropriate dbs locally ie auth-db, budget-db, transaction-db
# API Gateway
cd api-gateway && yarn run start:dev
# Auth Service
cd auth-service && yarn run start:dev
# Transaction Service
cd transaction-service && yarn run start:dev
# Budget Service
cd budget-service && yarn run start:dev
# Analytics Service
cd analytics-service && yarn run start:dev
# AI Insights Service
cd ai-insights-service && yarn run start:dev- macOS
# Install Homebrew if you don't have it
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install NATS server
brew install nats-server
# Start NATS server
nats-server- Windows
# Install Chocolatey if you don't have it
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Install NATS server
choco install nats-server
# Start NATS server
nats-server- Ubuntu/Debian
# Download and install the latest release
curl -L https://github.com/nats-io/nats-server/releases/download/v2.10.11/nats-server-v2.10.11-linux-amd64.tar.gz -o nats-server.tar.gz
tar -xzf nats-server.tar.gz
cd nats-server-v2.10.11-linux-amd64
sudo cp nats-server /usr/local/bin
# Start NATS server
nats-server- API Gateway: 3000
- Auth Service: Uses NATS (no direct HTTP port)
- Transaction Service: Uses NATS (no direct HTTP port)
- Budget Service: Uses NATS (no direct HTTP port)
- Analytics Service: Uses NATS (no direct HTTP port)
- AI Insights Service: Uses NATS (no direct HTTP port)
The Money Wise API is fully documented using Swagger (OpenAPI). After starting the application, you can access the interactive API documentation at: http://localhost:3000/api/docs
- Interactive Interface: Test API endpoints directly from your browser
- Request/Response Models: View detailed schema information for all DTOs
- Authentication Support: Test secured endpoints with JWT authentication
- Categorized Endpoints: Endpoints are grouped by domain (auth, transactions, budgets, etc.)
- Use the
/api/docs/auth/loginendpoint to obtain an access token. Copy the user id as well and have it somewhere. - Click the "Authorize" button at the top of the page
- Enter your token.
- All subsequent requests will include your authentication token
Below are screenshots of the Money Wise application interfaces:



