# Redirect Intelligence v2 A comprehensive URL redirect tracking and analysis platform built with Node.js, React, and PostgreSQL. ## ๐Ÿš€ Quick Start ### Prerequisites - Node.js 20+ - Docker & Docker Compose - Git ### Development Setup 1. **Clone and setup environment:** ```bash git clone cd redirect-intelligence-v2 cp .env.example .env ``` 2. **Start development environment:** ```bash npm run dev ``` This will start all services: - API: http://localhost:3333 - Web: http://localhost:3000 - PostgreSQL: localhost:5432 - Redis: localhost:6379 3. **Access the application:** - Main App: http://localhost:3000 - API Docs: http://localhost:3333/api/docs - Health Check: http://localhost:3333/health ## ๐Ÿ“‹ Project Structure ``` โ”œโ”€โ”€ apps/ โ”‚ โ”œโ”€โ”€ api/ # Express.js API server (TypeScript) โ”‚ โ”œโ”€โ”€ web/ # React frontend (Chakra UI) โ”‚ โ””โ”€โ”€ worker/ # BullMQ background worker โ”œโ”€โ”€ packages/ โ”‚ โ”œโ”€โ”€ database/ # Prisma schema & migrations โ”‚ โ””โ”€โ”€ shared/ # Shared types & utilities โ””โ”€โ”€ docker-compose.yml ``` ## ๐Ÿ”„ Backward Compatibility All existing API endpoints are preserved: - `POST /api/track` (legacy) - `POST /api/v1/track` - `GET /api/v1/track` Rate limiting: 100 requests/hour per IP (unchanged) ## ๐Ÿ› ๏ธ Development Commands ```bash # Start all services npm run dev # Individual services npm run dev:api npm run dev:web # Database operations npm run db:migrate npm run db:studio npm run db:seed # Build & test npm run build npm run test npm run lint ``` ## ๐Ÿ“– API Documentation Visit http://localhost:3333/api/docs for interactive API documentation. ## ๐Ÿ” Current Status **Phase 0: Complete** โœ… - Docker Compose setup - TypeScript migration - Monorepo structure - Backward compatibility preserved **Next: Phase 1** - PostgreSQL + Prisma + Authentication ## ๐Ÿงช Testing Test the backward compatibility: ```bash # Test legacy endpoint curl -X POST http://localhost:3333/api/track \ -H "Content-Type: application/json" \ -d '{"url": "github.com"}' # Test v1 endpoint curl -X POST http://localhost:3333/api/v1/track \ -H "Content-Type: application/json" \ -d '{"url": "github.com", "method": "GET"}' ``` ## ๐Ÿ“š Documentation - [Implementation Plan](./IMPLEMENTATION_PLAN.md) - Detailed phase-by-phase plan - [Original Plan](./redirect_intelligence_v2_plan.md) - High-level requirements ## ๐Ÿค Contributing See [IMPLEMENTATION_PLAN.md](./IMPLEMENTATION_PLAN.md) for development phases and guidelines.