# Xpeditis - Maritime Freight Booking Platform **Xpeditis** is a B2B SaaS platform for freight forwarders to search, compare, and book maritime freight in real-time. --- ## โญ **[START HERE](START-HERE.md)** โญ **New to the project?** Read **[START-HERE.md](START-HERE.md)** - Get running in 10 minutes! --- ## ๐Ÿš€ Quick Start ### Prerequisites - Node.js >= 20.0.0 - npm >= 10.0.0 - Docker & Docker Compose - PostgreSQL 15+ - Redis 7+ ### Installation ```bash # Install dependencies npm install # Start infrastructure (PostgreSQL + Redis) docker-compose up -d # Setup environment variables cp apps/backend/.env.example apps/backend/.env cp apps/frontend/.env.example apps/frontend/.env # Run database migrations npm run backend:migrate # Start backend (development) npm run backend:dev # Start frontend (development) npm run frontend:dev ``` ### Access Points - **Frontend**: http://localhost:3000 - **Backend API**: http://localhost:4000 - **API Documentation**: http://localhost:4000/api/docs ## ๐Ÿ“ Project Structure ``` xpeditis/ โ”œโ”€โ”€ apps/ โ”‚ โ”œโ”€โ”€ backend/ # NestJS API (Hexagonal Architecture) โ”‚ โ”‚ โ””โ”€โ”€ src/ โ”‚ โ”‚ โ”œโ”€โ”€ domain/ # Pure business logic โ”‚ โ”‚ โ”œโ”€โ”€ application/ # Controllers & DTOs โ”‚ โ”‚ โ””โ”€โ”€ infrastructure/ # External adapters โ”‚ โ””โ”€โ”€ frontend/ # Next.js 14 App Router โ”œโ”€โ”€ packages/ โ”‚ โ”œโ”€โ”€ shared-types/ # Shared TypeScript types โ”‚ โ””โ”€โ”€ domain/ # Shared domain logic โ””โ”€โ”€ infra/ # Infrastructure configs ``` ## ๐Ÿ—๏ธ Architecture This project follows **Hexagonal Architecture** (Ports & Adapters) principles: - **Domain Layer**: Pure business logic, no external dependencies - **Application Layer**: Use cases, controllers, DTOs - **Infrastructure Layer**: Database, external APIs, cache, email, storage See [CLAUDE.md](CLAUDE.md) for detailed architecture guidelines. ## ๐Ÿ› ๏ธ Development ### Backend ```bash npm run backend:dev # Start dev server npm run backend:test # Run tests npm run backend:test:watch # Run tests in watch mode npm run backend:test:cov # Generate coverage report npm run backend:lint # Lint code npm run backend:build # Build for production ``` ### Frontend ```bash npm run frontend:dev # Start dev server npm run frontend:build # Build for production npm run frontend:test # Run tests npm run frontend:lint # Lint code ``` ## ๐Ÿ“š Documentation ### Getting Started - **[QUICK-START.md](QUICK-START.md)** โšก - Get running in 5 minutes - **[INSTALLATION-STEPS.md](INSTALLATION-STEPS.md)** ๐Ÿ“ฆ - Detailed installation guide - **[NEXT-STEPS.md](NEXT-STEPS.md)** ๐Ÿš€ - What to do after setup ### Architecture & Guidelines - **[CLAUDE.md](CLAUDE.md)** ๐Ÿ—๏ธ - Hexagonal architecture guidelines (complete) - **[apps/backend/README.md](apps/backend/README.md)** - Backend documentation - **[apps/frontend/README.md](apps/frontend/README.md)** - Frontend documentation ### Project Planning - **[PRD.md](PRD.md)** ๐Ÿ“‹ - Product Requirements Document - **[TODO.md](TODO.md)** ๐Ÿ“… - 30-week development roadmap - **[SPRINT-0-FINAL.md](SPRINT-0-FINAL.md)** โœ… - Sprint 0 completion report - **[SPRINT-0-SUMMARY.md](SPRINT-0-SUMMARY.md)** ๐Ÿ“Š - Executive summary ### API Documentation - **[API Docs](http://localhost:4000/api/docs)** ๐Ÿ“– - OpenAPI/Swagger (when running) ## ๐Ÿงช Testing ```bash # Run all tests npm run test:all # Run backend tests npm run backend:test # Run frontend tests npm run frontend:test # E2E tests (after implementation) npm run test:e2e ``` ## ๐Ÿ”’ Security - All passwords hashed with bcrypt (12 rounds minimum) - JWT tokens (access: 15min, refresh: 7 days) - HTTPS/TLS 1.2+ enforced - OWASP Top 10 protection - Rate limiting on all endpoints - CSRF protection ## ๐Ÿ“Š Tech Stack ### Backend - **Framework**: NestJS 10+ - **Language**: TypeScript 5+ - **Database**: PostgreSQL 15+ - **Cache**: Redis 7+ - **ORM**: TypeORM - **Testing**: Jest, Supertest - **API Docs**: Swagger/OpenAPI ### Frontend - **Framework**: Next.js 14+ (App Router) - **Language**: TypeScript 5+ - **Styling**: Tailwind CSS - **UI Components**: shadcn/ui - **State**: React Query (TanStack Query) - **Forms**: React Hook Form + Zod - **Testing**: Jest, React Testing Library, Playwright ## ๐Ÿšข Carrier Integrations MVP supports the following maritime carriers: - โœ… Maersk - โœ… MSC - โœ… CMA CGM - โœ… Hapag-Lloyd - โœ… ONE (Ocean Network Express) ## ๐Ÿ“ˆ Monitoring & Logging - **Logging**: Winston / Pino - **Error Tracking**: Sentry - **APM**: Application Performance Monitoring - **Metrics**: Prometheus (planned) ## ๐Ÿ”ง Environment Variables See `.env.example` files in each app for required environment variables. ## ๐Ÿค Contributing 1. Create a feature branch 2. Make your changes 3. Write tests 4. Run linting and formatting 5. Submit a pull request ## ๐Ÿ“ License Proprietary - All rights reserved ## ๐Ÿ‘ฅ Team Built with โค๏ธ by the Xpeditis team --- For detailed implementation guidelines, see [CLAUDE.md](CLAUDE.md).