lsdn/
├── README.md # Main project documentation
├── docker-compose.yml # Development environment
├── docker-compose.prod.yml # Production environment
├── .gitignore # Git ignore rules
├── .env.example # Environment variables template
├── backend/ # Backend API server
│ ├── package.json # Backend dependencies
│ ├── tsconfig.json # TypeScript configuration
│ ├── src/
│ │ ├── index.ts # Server entry point
│ │ ├── config/ # Configuration files
│ │ ├── controllers/ # API controllers
│ │ ├── middleware/ # Express middleware
│ │ ├── models/ # Database models
│ │ ├── routes/ # API routes
│ │ ├── services/ # Business logic
│ │ ├── utils/ # Utility functions
│ │ └── types/ # TypeScript type definitions
│ └── migrations/ # Database migrations
├── frontend/ # React frontend application
│ ├── package.json # Frontend dependencies
│ ├── vite.config.ts # Vite configuration
│ ├── tsconfig.json # TypeScript configuration
│ ├── index.html # HTML entry point
│ ├── src/
│ │ ├── main.tsx # React entry point
│ │ ├── App.tsx # Main App component
│ │ ├── components/ # Reusable components
│ │ ├── pages/ # Page components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── services/ # API service functions
│ │ ├── types/ # TypeScript type definitions
│ │ ├── utils/ # Utility functions
│ │ ├── styles/ # Global styles
│ │ └── assets/ # Static assets
├── partner-portal/ # Restaurant partner portal
│ ├── package.json # Partner portal dependencies
│ ├── vite.config.ts # Vite configuration
│ ├── src/
│ │ ├── main.tsx # Partner portal entry
│ │ ├── App.tsx # Partner portal App
│ │ ├── components/ # Partner components
│ │ ├── pages/ # Partner pages
│ │ └── services/ # Partner API services
├── scripts/ # Deployment and utility scripts
│ ├── setup.sh # Setup script
│ ├── deploy.sh # Deployment script
│ └── seed-data.sql # Sample data
└── docs/ # Documentation
├── API.md # API documentation
├── DEPLOYMENT.md # Deployment guide
└── TESTING.md # Testing strategy
- Node.js 18+ - Runtime environment
- Express.js - Web framework
- TypeScript - Type-safe JavaScript
- PostgreSQL - Primary database
- Redis - Caching and sessions
- bcrypt - Password hashing
- jsonwebtoken - JWT authentication
- pg - PostgreSQL client
- redis - Redis client
- stripe - Payment processing
- nodemailer - Email sending
- joi - Validation library
- cors - Cross-origin resource sharing
- helmet - Security headers
- morgan - HTTP request logging
- React 18 - UI library
- TypeScript - Type-safe JavaScript
- Vite - Build tool and dev server
- Tailwind CSS - CSS framework
- React Query - Server state management
- React Hook Form - Form handling
- Zod - Schema validation
- React Router - Client-side routing
- Axios - HTTP client
- Lucide React - Icon library
- React Icons - Additional icons
- date-fns - Date manipulation
- Docker - Containerization
- Docker Compose - Multi-container orchestration
- ESLint - Code linting
- Prettier - Code formatting
- Husky - Git hooks
- lint-staged - Pre-commit hooks
- Render.com - Easy cloud deployment
- Railway - Alternative cloud deployment
- Vercel - Frontend deployment
- Railway - Backend deployment
- Node.js 18+ installed
- Docker and Docker Compose installed
- PostgreSQL (can use Docker)
-
Clone and setup:
git clone <repository-url> cd lsdn cp .env.example .env
-
Start development environment:
docker-compose up -d
-
Install dependencies:
cd backend && npm install cd ../frontend && npm install cd ../partner-portal && npm install
-
Run migrations:
cd backend npm run migrate -
Start development servers:
# Terminal 1: Backend cd backend && npm run dev # Terminal 2: Frontend cd frontend && npm run dev # Terminal 3: Partner Portal cd partner-portal && npm run dev
Required environment variables (copy from .env.example):
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/lsdn"
REDIS_URL="redis://localhost:6379"
# Authentication
JWT_SECRET="your-jwt-secret-key"
JWT_EXPIRES_IN="7d"
# Email
SMTP_HOST="smtp.gmail.com"
SMTP_PORT=587
SMTP_USER="your-email@gmail.com"
SMTP_PASS="your-app-password"
# Stripe
STRIPE_SECRET_KEY="sk_test_your_stripe_secret"
STRIPE_WEBHOOK_SECRET="whsec_your_webhook_secret"
# Cloudinary (for image uploads)
CLOUDINARY_CLOUD_NAME="your-cloud-name"
CLOUDINARY_API_KEY="your-api-key"
CLOUDINARY_API_SECRET="your-api-secret"
# Application
PORT=3001
FRONTEND_URL="http://localhost:5173"
PARTNER_URL="http://localhost:3002"POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/verify- Email verificationPOST /api/auth/forgot-password- Password reset
GET /api/users/profile- Get user profilePUT /api/users/profile- Update user profileGET /api/users/packages- Get user packagesPOST /api/users/packages- Purchase package
GET /api/restaurants- List restaurantsGET /api/restaurants/:id- Get restaurant detailsGET /api/restaurants/:id/slots- Get available slots
POST /api/matches/commit- Commit to time windowGET /api/matches/available- Get available candidatesPOST /api/matches/ask- Send invitationPOST /api/matches/:id/respond- Accept/declineGET /api/bookings- Get user bookings
POST /api/partners/register- Restaurant registrationGET /api/partners/dashboard- Partner dashboardPOST /api/partners/slots- Manage time slotsPOST /api/partners/vouchers/redeem- Redeem voucher
The database uses PostgreSQL with the following main tables:
users- User profiles and preferencesrestaurants- Partner restaurant informationpackages- Dinner package definitionsuser_packages- User package purchases (wallet)time_slots- Restaurant availabilitybookings- Date bookings and vouchersmatches- Match requests and responses
- Home - Landing page with value proposition
- Register/Login - Authentication pages
- Profile - User profile management
- Discover - Restaurant discovery and browsing
- Packages - Package purchase and management
- Matches - Matching interface and invitations
- Bookings - Booking history and management
- Messages - Post-booking messaging
- Login - Partner authentication
- Dashboard - Overview of bookings and performance
- Menu Management - Package and menu management
- Slot Management - Time slot configuration
- Voucher Redemption - QR code scanning and redemption
- Reports - Analytics and reporting
- Unit Tests - Individual function testing with Jest
- Integration Tests - API endpoint testing
- Database Tests - Database operation testing
- E2E Tests - Full workflow testing
- Component Tests - React component testing with React Testing Library
- Integration Tests - User flow testing
- E2E Tests - Full application testing with Playwright
# Run all tests
npm run test
# Run tests with coverage
npm run test:coverage
# Run specific test suite
npm run test:backend
npm run test:frontend# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down- Set up environment variables
- Deploy to cloud platform (Render.com recommended)
- Run database migrations
- Configure SSL and domain
- Set up monitoring and logging
See docs/DEPLOYMENT.md for detailed deployment instructions.
- Fork the repository
- Create a feature branch
- Make changes with tests
- Submit a pull request
This project is licensed under the MIT License.