Skip to content

Commit bda529b

Browse files
committed
Implement updates for better performance
1 parent 66218ff commit bda529b

26 files changed

Lines changed: 59 additions & 91 deletions

File tree

‎code/backend/.npmrc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# Hoist all packages to root node_modules — single install for all services
1+
# Hoist all packages to root node_modules - single install for all services
22
legacy-peer-deps=true

‎code/backend/README.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# FinFlow Backend — Monorepo
1+
# FinFlow Backend - Monorepo
22

33
A Node.js/TypeScript + Python microservices backend for the FinFlow financial platform.
44

@@ -79,11 +79,11 @@ cp .env.example .env
7979

8080
Key variables:
8181

82-
- `JWT_SECRET` — JWT signing secret
83-
- `DATABASE_URL` — PostgreSQL connection string
84-
- `REDIS_HOST` / `REDIS_PORT` — Redis connection
85-
- `KAFKA_BROKERS` — Kafka broker addresses
86-
- `STRIPE_SECRET` / `STRIPE_WEBHOOK_SECRET` — Stripe credentials
82+
- `JWT_SECRET` - JWT signing secret
83+
- `DATABASE_URL` - PostgreSQL connection string
84+
- `REDIS_HOST` / `REDIS_PORT` - Redis connection
85+
- `KAFKA_BROKERS` - Kafka broker addresses
86+
- `STRIPE_SECRET` / `STRIPE_WEBHOOK_SECRET` - Stripe credentials
8787

8888
## Docker
8989

‎code/backend/__mocks__/mime.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22
/**
3-
* __mocks__/mime.js — Combined mime v1 + v2 polyfill for Jest
3+
* __mocks__/mime.js - Combined mime v1 + v2 polyfill for Jest
44
*
55
* WHY THIS EXISTS
66
* ───────────────
@@ -76,7 +76,7 @@ for (const [ext, type] of Object.entries(EXT_TO_TYPE)) {
7676
if (!TYPE_TO_EXT[type]) TYPE_TO_EXT[type] = ext;
7777
}
7878

79-
// Charsets for text types — used by express/send
79+
// Charsets for text types - used by express/send
8080
const CHARSET_MAP = {
8181
"text/html": "UTF-8",
8282
"text/plain": "UTF-8",
@@ -158,7 +158,7 @@ const charsets = {
158158
},
159159
};
160160

161-
// ─── Export — all four entry points ──────────────────────────────────────────
161+
// ─── Export - all four entry points ──────────────────────────────────────────
162162
const mime = {
163163
// v2
164164
define,

‎code/backend/analytics-service/tests/analytics.integration.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jest.mock("../src/forecast.model");
1919
jest.mock("../../common/kafka", () => ({
2020
sendMessage: jest.fn().mockResolvedValue(undefined),
2121
}));
22-
// Explicit factory mock — more reliable than jest.mock("jsonwebtoken") + mockReturnValue
22+
// Explicit factory mock - more reliable than jest.mock("jsonwebtoken") + mockReturnValue
2323
// because clearMocks:true in jest.config.js would wipe auto-mock return values between tests.
2424
jest.mock("jsonwebtoken", () => ({
2525
verify: jest.fn().mockReturnValue({ sub: "user_123", role: "user" }),

‎code/backend/docker-compose.override.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: "3.9"
22

33
# ============================================================
4-
# Development overrides — hot reload, exposed ports, debug
4+
# Development overrides - hot reload, exposed ports, debug
55
# ============================================================
66

77
services:

‎code/backend/nginx.conf‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ http {
8888
add_header Content-Type application/json;
8989
}
9090

91-
# Auth routes — tighter rate limit
91+
# Auth routes - tighter rate limit
9292
location /api/auth/ {
9393
limit_req zone=auth burst=10 nodelay;
9494
proxy_pass http://auth_service;
@@ -182,7 +182,7 @@ http {
182182
proxy_read_timeout 30s;
183183
}
184184

185-
# Default — 404
185+
# Default - 404
186186
location / {
187187
return 404 '{"error":"Route not found"}';
188188
add_header Content-Type application/json;

‎code/backend/payments-service/src/interfaces/payment-processor.interface.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export type ProcessorMetadata = Record<
44
string | number | boolean | null | undefined
55
>;
66

7-
/** Generic processor response — processors return different shapes; callers should narrow */
7+
/** Generic processor response - processors return different shapes; callers should narrow */
88
export interface ProcessorResult {
99
id: string;
1010
status: string;

‎code/backend/payments-service/src/payment.service.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class PaymentService {
6464
}
6565

6666
/**
67-
* Process a payment — validates details then charges via the processor.
67+
* Process a payment - validates details then charges via the processor.
6868
* This is the method integration and unit tests expect.
6969
*/
7070
async processPayment(paymentDetails: {

‎code/backend/run/nginx.local.conf‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ http {
8888
add_header Content-Type application/json;
8989
}
9090

91-
# Auth routes — tighter rate limit
91+
# Auth routes - tighter rate limit
9292
location /api/auth/ {
9393
limit_req zone=auth burst=10 nodelay;
9494
proxy_pass http://auth_service;
@@ -182,7 +182,7 @@ http {
182182
proxy_read_timeout 30s;
183183
}
184184

185-
# Default — 404
185+
# Default - 404
186186
location / {
187187
return 404 '{"error":"Route not found"}';
188188
add_header Content-Type application/json;

‎code/ml-services/ai-features-service/src/services/cash_flow_service.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"""
1111

1212
import logging
13-
1413
# --- Inline dependency stubs ---
1514
from datetime import datetime, timedelta
1615
from typing import Any, Dict, List
@@ -19,7 +18,6 @@
1918
import pandas as pd
2019

2120

22-
2321
async def get_database():
2422
"""Stub: replace with real async DB client."""
2523

@@ -120,7 +118,8 @@ class CashFlowPredictionResponse:
120118
Prophet = None # type: ignore
121119

122120
try:
123-
from sklearn.ensemble import GradientBoostingRegressor, RandomForestRegressor
121+
from sklearn.ensemble import (GradientBoostingRegressor,
122+
RandomForestRegressor)
124123
from sklearn.linear_model import Ridge
125124
from sklearn.preprocessing import MinMaxScaler, StandardScaler
126125
except ImportError:

0 commit comments

Comments
 (0)