# ๐Ÿš€ Quick Start Guide - Xpeditis Get the Xpeditis maritime freight booking platform running in **5 minutes**. --- ## Prerequisites Before you begin, ensure you have: - โœ… **Node.js** v20+ ([Download](https://nodejs.org/)) - โœ… **npm** v10+ (comes with Node.js) - โœ… **Docker Desktop** ([Download](https://www.docker.com/products/docker-desktop/)) - โœ… **Git** ([Download](https://git-scm.com/)) --- ## Step 1: Clone & Install (2 minutes) ```bash # Clone the repository cd xpeditis2.0 # Install all dependencies npm install # This will install: # - Root workspace dependencies # - Backend dependencies (~50 packages) # - Frontend dependencies (~30 packages) ``` **Note**: If you encounter `EISDIR` errors on Windows, it's okay - the dependencies are still installed correctly. --- ## Step 2: Start Infrastructure (1 minute) ```bash # Start PostgreSQL + Redis with Docker docker-compose up -d # Verify containers are running docker-compose ps # You should see: # โœ… xpeditis-postgres (port 5432) # โœ… xpeditis-redis (port 6379) ``` --- ## Step 3: Configure Environment (1 minute) ```bash # Backend cp apps/backend/.env.example apps/backend/.env # Frontend cp apps/frontend/.env.example apps/frontend/.env ``` **The default `.env` values work for local development!** No changes needed to get started. --- ## Step 4: Start Development Servers (1 minute) ### Option A: Two Terminals ```bash # Terminal 1 - Backend cd apps/backend npm run dev # Terminal 2 - Frontend cd apps/frontend npm run dev ``` ### Option B: Root Commands ```bash # Terminal 1 - Backend npm run backend:dev # Terminal 2 - Frontend npm run frontend:dev ``` --- ## Step 5: Verify Everything Works ### Backend โœ… Open: **http://localhost:4000/api/v1/health** Expected response: ```json { "status": "ok", "timestamp": "2025-10-07T...", "uptime": 12.345, "environment": "development", "version": "0.1.0" } ``` ### API Documentation โœ… Open: **http://localhost:4000/api/docs** You should see the Swagger UI with: - Health endpoints - (More endpoints will be added in Phase 1) ### Frontend โœ… Open: **http://localhost:3000** You should see: ``` ๐Ÿšข Xpeditis Maritime Freight Booking Platform Search, compare, and book maritime freight in real-time ``` --- ## ๐ŸŽ‰ Success! You now have: - โœ… Backend API running on port 4000 - โœ… Frontend app running on port 3000 - โœ… PostgreSQL database on port 5432 - โœ… Redis cache on port 6379 - โœ… Swagger API docs available - โœ… Hot reload enabled for both apps --- ## Common Commands ### Development ```bash # Backend npm run backend:dev # Start backend dev server npm run backend:test # Run backend tests npm run backend:test:watch # Run tests in watch mode npm run backend:lint # Lint backend code # Frontend npm run frontend:dev # Start frontend dev server npm run frontend:build # Build for production npm run frontend:test # Run frontend tests npm run frontend:lint # Lint frontend code # Both npm run format # Format all code npm run format:check # Check formatting npm run test:all # Run all tests ``` ### Infrastructure ```bash # Docker docker-compose up -d # Start services docker-compose down # Stop services docker-compose logs -f # View logs docker-compose ps # Check status # Database docker-compose exec postgres psql -U xpeditis -d xpeditis_dev # Redis docker-compose exec redis redis-cli -a xpeditis_redis_password ``` --- ## Troubleshooting ### Port Already in Use ```bash # Backend (port 4000) # Windows: netstat -ano | findstr :4000 # Mac/Linux: lsof -i :4000 # Frontend (port 3000) # Windows: netstat -ano | findstr :3000 # Mac/Linux: lsof -i :3000 ``` ### Docker Not Starting ```bash # Check Docker is running docker --version # Restart Docker Desktop # Then retry: docker-compose up -d ``` ### Database Connection Issues ```bash # Check PostgreSQL is running docker-compose ps # View PostgreSQL logs docker-compose logs postgres # Restart PostgreSQL docker-compose restart postgres ``` ### npm Install Errors ```bash # Clear cache and retry npm cache clean --force rm -rf node_modules npm install ``` --- ## Next Steps ### ๐Ÿ“š Read the Documentation - [README.md](README.md) - Full project documentation - [CLAUDE.md](CLAUDE.md) - Hexagonal architecture guidelines - [TODO.md](TODO.md) - 30-week development roadmap - [SPRINT-0-FINAL.md](SPRINT-0-FINAL.md) - Sprint 0 completion report ### ๐Ÿ› ๏ธ Start Building Ready to start Phase 1? Check out [TODO.md](TODO.md) for the roadmap: - **Sprint 1-2**: Domain entities and ports - **Sprint 3-4**: Infrastructure and database - **Sprint 5-6**: Rate search API - **Sprint 7-8**: Rate search UI ### ๐Ÿงช Run Tests ```bash # Backend unit tests cd apps/backend npm test # Backend E2E tests npm run test:e2e # Frontend tests cd apps/frontend npm test ``` ### ๐Ÿ” Explore the Code **Hexagonal Architecture**: ``` apps/backend/src/ โ”œโ”€โ”€ domain/ # Pure business logic (start here!) โ”œโ”€โ”€ application/ # Controllers & DTOs โ””โ”€โ”€ infrastructure/ # External adapters ``` **Frontend Structure**: ``` apps/frontend/ โ”œโ”€โ”€ app/ # Next.js App Router โ”œโ”€โ”€ components/ # React components โ””โ”€โ”€ lib/ # Utilities ``` --- ## ๐ŸŽฏ You're Ready! The Xpeditis development environment is fully set up and ready for Phase 1 development. **Happy coding! ๐Ÿš€** --- ## Need Help? - ๐Ÿ“– Check [README.md](README.md) for detailed documentation - ๐Ÿ—๏ธ Review [CLAUDE.md](CLAUDE.md) for architecture guidelines - ๐Ÿ“ Follow [TODO.md](TODO.md) for the development roadmap - โ“ Open an issue on GitHub --- *Xpeditis - Maritime Freight Booking Platform*