A comprehensive travel planning application built with modern technologies, designed to help groups plan and organize their trips together.
Backend:
- NestJS - Scalable Node.js framework with TypeScript support
- TypeScript - Type-safe development
- PostgreSQL - Reliable relational database
- TypeORM - Object-relational mapping with excellent TypeScript support
- Redis - In-memory data store for sessions and caching
Frontend:
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe development
- TailwindCSS - Utility-first CSS framework
- shadcn/ui - Beautiful and accessible UI components
- Zustand - Lightweight state management
Monorepo:
- Turbo - High-performance build system for monorepos
junta-tribo/
โโโ apps/
โ โโโ api/ # NestJS Backend API
โ โ โโโ src/
โ โ โ โโโ auth/ # Authentication module
โ โ โ โโโ users/ # User management module
โ โ โ โโโ trips/ # Trip management module
โ โ โ โโโ config/ # Configuration services
โ โ โ โโโ database/ # Database migrations
โ โ โโโ package.json
โ โโโ web/ # Next.js Frontend
โ โโโ src/
โ โ โโโ app/ # App Router pages
โ โ โโโ components/ # React components
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ lib/ # Utility libraries
โ โ โโโ store/ # State management
โ โโโ package.json
โโโ packages/
โ โโโ shared/ # Shared types and utilities
โ โ โโโ src/
โ โ โโโ types.ts # TypeScript interfaces
โ โ โโโ constants.ts # Shared constants
โ โโโ ui/ # Shared UI components (future)
โโโ docker-compose.yml # Development services
โโโ turbo.json # Turbo configuration
โโโ package.json # Root package.json
- JWT-based authentication with secure token storage
- Session management with Redis for token validation
- Password hashing using bcryptjs
- Protected routes - All user-specific endpoints require authentication
- User ownership validation - Users can only access their own data
- CORS configuration for frontend-backend communication
- Input validation using class-validator decorators
- Error handling with proper HTTP status codes
- Request/Response interceptors for consistent API behavior
- Registration & Login with email/password
- Profile management (update name, avatar)
- Account deactivation option
- User session tracking with Redis
- Create trips with detailed information:
- Title, description, destination
- Start/end dates with validation
- Budget tracking
- Participant management
- Custom itinerary support
- Read trips with filtering and sorting:
- View all user trips
- Filter by status (planning, confirmed, in-progress, completed, cancelled)
- Upcoming trips view
- Trip statistics dashboard
- Update trips with partial updates supported
- Delete trips with proper authorization
- Planning - Initial trip creation phase
- Confirmed - Trip details finalized
- In Progress - Currently traveling
- Completed - Trip finished
- Cancelled - Trip cancelled
- Node.js 18+
- PostgreSQL 15+
- Redis 7+
- npm or yarn
The project uses a single consolidated .env file at the root level that contains all environment variables for both frontend and backend applications. This simplifies configuration management and ensures consistency across the monorepo.
- Clone and install dependencies:
git clone <repository-url>
cd junta-tribo
npm install- Start development services:
# Start PostgreSQL and Redis
docker-compose up -d
# Start development servers
npm run dev- Environment setup:
# Manually: cp env.example .env
# Update .env with your configuration (database credentials, JWT secret, etc.)# Development
npm run dev # Start all apps in development mode
npm run build # Build all apps for production
npm run lint # Run linting across all packages
npm run type-check # Type checking across all packages
# Database (run from apps/api directory)
npm run migration:generate # Generate new migration
npm run migration:run # Run pending migrationsPOST /auth/register- User registrationPOST /auth/login- User loginPOST /auth/logout- User logoutGET /auth/me- Get current user profile
GET /users- Get all users (protected)GET /users/:id- Get user by ID (protected)PATCH /users/me- Update current user profile (protected)DELETE /users/me- Deactivate current user (protected)
GET /trips- Get all user trips (protected)GET /trips/upcoming- Get upcoming trips (protected)GET /trips/:id- Get trip by ID (protected)POST /trips- Create new trip (protected)PATCH /trips/:id- Update trip (protected)DELETE /trips/:id- Delete trip (protected)
- Swagger documentation available at
/api/docswhen running the backend - Interactive API testing and documentation
- Mobile-first approach with TailwindCSS
- Responsive layouts that work on all device sizes
- Touch-friendly interfaces for mobile users
- Modern UI with shadcn/ui components
- Loading states and error handling
- Toast notifications for user feedback
- Form validation with real-time feedback
- Dashboard with statistics and trip overview
- Zustand store for authentication state
- Persistent storage for user sessions
- Optimistic updates for better UX
id(UUID, Primary Key)email(Unique, Not Null)firstName(String, Not Null)lastName(String, Not Null)password(Hashed, Not Null)avatar(String, Optional)isActive(Boolean, Default: true)createdAt(Timestamp)updatedAt(Timestamp)
id(UUID, Primary Key)title(String, Not Null)description(Text, Optional)destination(String, Not Null)startDate(Date, Not Null)endDate(Date, Not Null)status(Enum: planning, confirmed, in_progress, completed, cancelled)budget(Decimal, Optional)participants(JSON Array, Optional)itinerary(JSON Array, Optional)ownerId(UUID, Foreign Key to Users)createdAt(Timestamp)updatedAt(Timestamp)
The root .env file is organized into sections:
- Backend API Configuration: Server port, database, Redis, JWT settings
- Frontend Web Configuration: API URL and other client-side variables
- Development Services: URLs and ports for development tools
- Copy
env.exampleto.envand configure production values - Database migrations in production
- Redis cluster setup for scaling
- SSL/TLS certificates
- Load balancing considerations
- Monitoring and logging setup
- Horizontal scaling with multiple API instances
- Database read replicas for improved performance
- Redis clustering for session management
- CDN integration for static assets
- Caching strategies for frequently accessed data
- Real-time collaboration with WebSocket support
- File upload for trip photos and documents
- Trip sharing with public links
- Email notifications for trip updates
- Mobile app with React Native
- Third-party integrations (Google Maps, weather APIs)
- Advanced trip planning with AI suggestions
- GraphQL API for more flexible data fetching
- Microservices architecture for better scalability
- Event-driven architecture with message queues
- Advanced caching strategies
- Performance monitoring and analytics
- Automated testing suite expansion
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
JuntaTribo - Making travel planning collaborative and fun! ๐