A sophisticated AI Research Agent demonstrating enterprise-level engineering practices with advanced async patterns, robust observability, and production-ready architecture.
Frontend (Next.js/TS) → API Gateway → Background Jobs → External APIs → Database
↓
Observability Stack (Logs/Metrics/Traces)
- Framework: Express.js with TypeScript
- Database: PostgreSQL with Prisma ORM
- Job Queue: Bull.js with Redis for async processing
- Observability: Winston logging + structured logging
- Validation: Zod for type-safe validation
- Security: Helmet, CORS, rate limiting
- Framework: Next.js 14 with App Router
- UI: Tailwind CSS with modern dark theme
- State Management: React hooks with custom API client
- Real-time: Polling for job status updates
- Containerization: Docker with multi-stage builds
- Database: PostgreSQL with connection pooling
- Cache/Queue: Redis for job queue
- Reverse Proxy: Nginx for load balancing
- Node.js 20+
- Docker and Docker Compose
- PostgreSQL (if running locally)
- Redis (if running locally)
git clone <repository-url>
cd ai-research-agent
npm installBackend environment:
cd backend
cp .env.example .envEdit .env with your configuration:
DATABASE_URL="postgresql://postgres:password@localhost:5432/ai_research_agent"
REDIS_URL="redis://localhost:6379"
JWT_SECRET="your-super-secret-jwt-key-change-in-production"
PORT=3001
# Optional: External API Keys
OPENAI_API_KEY="your-openai-key"
NEWS_API_KEY="your-news-api-key"cd backend
npm run db:generate
npm run db:migrateOption A: With Docker (Recommended)
docker-compose up --buildOption B: Local Development
Terminal 1 - Start services:
docker-compose up postgres redisTerminal 2 - Backend:
cd backend
npm run devTerminal 3 - Frontend:
cd frontend
npm run dev