Multi-service AI platform with microservices architecture built with Node.js, React, and TypeScript.
aura-ai/
βββ apps/
β βββ frontend/ # React + Vite frontend (Port 3000)
β βββ backend-finance/ # Finance service API (Port 4001)
β βββ backend-habit/ # Habit tracking API (Port 4002)
β βββ backend-health/ # Health metrics API (Port 4003)
βββ package.json # Root workspace configuration
- Node.js v18+ (Currently using v24.11.1)
- npm v8+ (Currently using v11.8.0)
Install all dependencies for all workspaces:
npm installRun all services in development mode:
npm run devOr run individual services:
# Frontend only
npm run dev:frontend
# Finance service
npm run dev:finance
# Habit service
npm run dev:habit
# Health service
npm run dev:healthBuild all projects:
npm run build- React 18 with TypeScript
- Vite for fast development
- Modern glassmorphism UI design
- Real-time service status monitoring
Finance Service (Port 4001)
- Transaction management
- Budget tracking
- Financial analytics
Habit Service (Port 4002)
- Habit tracking
- Streak monitoring
- Progress analytics
Health Service (Port 4003)
- Health metrics
- Wellness data
- Activity tracking
- Frontend: React, TypeScript, Vite, Axios
- Backend: Node.js, Express, TypeScript
- Dev Tools: tsx (TypeScript execution), rimraf (cleaning)
npm run dev- Run all services in developmentnpm run build- Build all projectsnpm run clean- Clean all build artifactsnpm run install:all- Install all dependencies
- β Monorepo architecture with npm workspaces
- β TypeScript throughout
- β Hot reload for all services
- β Modern UI with glassmorphism design
- β CORS-enabled APIs
- β Health check endpoints
- β API proxy configuration
This project uses npm workspaces for efficient monorepo management. Dependencies are hoisted to the root when possible.
- Create a feature branch
- Make your changes
- Test all services
- Submit a pull request
# Clone the repository
git clone <repository-url>
cd aura-ai
# Install all dependencies
npm install
# Start all services
npm run devTo add a new microservice, follow these steps:
cd apps
mkdir backend-yourservice
cd backend-yourserviceCreate package.json:
{
"name": "@aura-ai/backend-yourservice",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "tsx watch src/index.ts",
"build": "tsc",
"start": "node dist/index.js",
"clean": "rimraf dist node_modules"
},
"dependencies": {
"express": "^4.18.2",
"cors": "^2.8.5",
"dotenv": "^16.3.1"
},
"devDependencies": {
"@types/express": "^4.17.21",
"@types/cors": "^2.8.17",
"@types/node": "^20.10.5",
"typescript": "^5.3.3",
"tsx": "^4.7.0",
"rimraf": "^5.0.5"
}
}Create tsconfig.json:
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"lib": ["ES2020"],
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}Create src/index.ts:
import express, { Request, Response } from 'express';
import cors from 'cors';
import dotenv from 'dotenv';
dotenv.config();
const app = express();
const PORT = process.env.PORT || 4004; // Choose next available port
// Middleware
app.use(cors());
app.use(express.json());
// Health check endpoint (Required!)
app.get('/health', (req: Request, res: Response) => {
res.json({
status: 'ok',
service: 'yourservice',
timestamp: new Date().toISOString()
});
});
// Your API endpoints here
app.get('/api/yourservice/data', (req: Request, res: Response) => {
res.json({
message: 'Your service is working!'
});
});
app.listen(PORT, () => {
console.log(`π Your service running on http://localhost:${PORT}`);
});Add your service to package.json in the root directory:
"scripts": {
...
"dev:yourservice": "npm run dev -w apps/backend-yourservice"
}Add proxy to apps/frontend/vite.config.ts:
proxy: {
...
'/api/yourservice': {
target: 'http://localhost:4004',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/yourservice/, '')
}
}Add to apps/frontend/src/App.tsx:
// Add to state
const [services, setServices] = useState({
...
yourservice: null
});
// Add to endpoints
{ name: 'yourservice', url: '/api/yourservice/health' }
// Add ServiceCard component
<ServiceCard
title="π― Your Service"
status={services.yourservice}
description="Your service description"
/># From root directory
npm run dev:yourservice
# Or run all services
npm run dev- β
Always include a
/healthendpoint - β Use TypeScript for type safety
- β Enable CORS for frontend communication
- β Use environment variables for configuration
- β Follow the existing port numbering (4001, 4002, 4003, 4004...)
- β Add proper error handling
- β Use meaningful HTTP status codes
- β Document your API endpoints
- β Test your service before committing
- 3000: Frontend
- 4001: Finance Service
- 4002: Habit Service
- 4003: Health Service
- 4004+: Your new services
Create .env file in your service directory:
PORT=4004
NODE_ENV=developmentISC