{"id":45475869,"url":"https://github.com/G1Joshi/Booking-App","last_synced_at":"2026-03-07T17:00:45.005Z","repository":{"id":64499157,"uuid":"571426847","full_name":"G1Joshi/Booking-App","owner":"G1Joshi","description":"Full-Stack Dart Application using Flutter and Dart-Frog","archived":false,"fork":false,"pushed_at":"2026-02-07T16:30:15.000Z","size":1867,"stargazers_count":29,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-08T00:54:18.661Z","etag":null,"topics":["backend","dart","dart-frog","flutter","frontend","full-stack","postgres"],"latest_commit_sha":null,"homepage":"http://g1joshi.dev/Booking-App/","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/G1Joshi.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-28T05:16:55.000Z","updated_at":"2026-02-07T16:30:19.000Z","dependencies_parsed_at":"2023-02-09T18:45:32.840Z","dependency_job_id":null,"html_url":"https://github.com/G1Joshi/Booking-App","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/G1Joshi/Booking-App","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/G1Joshi%2FBooking-App","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/G1Joshi%2FBooking-App/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/G1Joshi%2FBooking-App/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/G1Joshi%2FBooking-App/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/G1Joshi","download_url":"https://codeload.github.com/G1Joshi/Booking-App/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/G1Joshi%2FBooking-App/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30222338,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T14:02:48.375Z","status":"ssl_error","status_checked_at":"2026-03-07T14:02:43.192Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","dart","dart-frog","flutter","frontend","full-stack","postgres"],"created_at":"2026-02-22T15:00:21.455Z","updated_at":"2026-03-07T17:00:44.986Z","avatar_url":"https://github.com/G1Joshi.png","language":"Dart","funding_links":[],"categories":["Projects"],"sub_categories":["Open source repos"],"readme":"# 🏨 Booking App\n\n[![Web App](https://github.com/G1Joshi/Booking-App/actions/workflows/main.yml/badge.svg)](https://github.com/G1Joshi/Booking-App/actions/workflows/main.yml)\n[![Melos](https://img.shields.io/badge/maintained%20with-melos-f700ff)](https://melos.invertase.dev/)\n\nA full-stack hotel booking application built with **Flutter** (Frontend) and **Dart Frog** (Backend) with **PostgreSQL** database. This application allows users to search for hotels, view details, make bookings, and leave reviews.\n\n[![Flutter](https://img.shields.io/badge/Flutter-02569B?logo=flutter\u0026logoColor=white)](https://flutter.dev)\n[![Dart](https://img.shields.io/badge/Dart-0175C2?logo=dart\u0026logoColor=white)](https://dart.dev)\n[![Docker](https://img.shields.io/badge/Docker-2496ED?logo=docker\u0026logoColor=white)](https://docs.docker.com/)\n[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-336791?logo=postgresql\u0026logoColor=white)](https://www.postgresql.org)\n\n---\n\n## 📑 Table of Contents\n\n- [Features](#-features)\n- [Architecture](#-architecture)\n- [Database Schema](#-database-schema-er-diagram)\n- [Prerequisites](#-prerequisites)\n- [Installation \u0026 Setup](#-installation--setup)\n  - [Initialize Workspace](#1-initialize-workspace)\n  - [Backend Setup](#2-backend-setup)\n- [Running the Application](#-running-the-application)\n- [Technologies Used](#-technologies-used)\n- [Troubleshooting](#-troubleshooting)\n\n---\n\n## ✨ Features\n\n### User Features\n\n- 🔍 **Hotel Search** - Search hotels by location with radius-based filtering\n- 🏨 **Hotel Listings** - Browse hotels with detailed information\n- 🛏️ **Room Categories** - View different room types and availability\n- 📅 **Booking System** - Book rooms with check-in/check-out dates\n- ⭐ **Reviews \u0026 Ratings** - Read and write hotel reviews\n- 🎯 **Advanced Filters** - Filter by star rating, property type, price, and more\n- 📱 **Multi-Platform** - Runs on iOS, Android, Web, and Windows\n\n### Admin Features\n\n- 🏗️ **Hotel Management** - Add, update, and delete hotels\n- 📊 **Data Seeding** - Generate fake data for testing (1000+ hotels)\n- 🔑 **API Secret Key** - Admin operations protected by secret key\n\n---\n\n## 🏗️ Architecture\n\nThis application follows a **3-tier architecture**:\n\n```\n┌───────────────────────────────────────────────────────────────┐\n│                        PRESENTATION LAYER                     │\n│  ┌─────────────────────────────────────────────────────────┐  │\n│  │              Flutter Frontend (BLoC Pattern)            │  │\n│  │  ┌────────────┐  ┌────────────┐  ┌──────────────────┐   │  │\n│  │  │  Auth Page │  │ Hotel List │  │  Hotel Details   │   │  │\n│  │  └────────────┘  └────────────┘  └──────────────────┘   │  │\n│  │  ┌────────────┐  ┌────────────┐  ┌──────────────────┐   │  │\n│  │  │  Auth Bloc │  │ Hotel Bloc │  │ Repositories     │   │  │\n│  │  └────────────┘  └────────────┘  └──────────────────┘   │  │\n│  └─────────────────────────────────────────────────────────┘  │\n└───────────────────────────────────────────────────────────────┘\n                              ▼ HTTP/REST API\n┌────────────────────────────────────────────────────────────────┐\n│                       APPLICATION LAYER                        │\n│  ┌──────────────────────────────────────────────────────────┐  │\n│  │           Dart Frog Backend (RESTful API)                │  │\n│  │  ┌────────────────────────────────────────────────────┐  │  │\n│  │  │              API Routes (v1)                       │  │  │\n│  │  │  /auth/signup  /auth/signin  /hotels  /search      │  │  │\n│  │  │  /hotels/:id/room  /hotels/:id/review              │  │  │\n│  │  │  /hotels/:id/room/:id/booking                      │  │  │\n│  │  └────────────────────────────────────────────────────┘  │  │\n│  │  ┌────────────────────────────────────────────────────┐  │  │\n│  │  │              Middleware Layer                      │  │  │\n│  │  │  Auth  │  DB Connection  │  Services  │  Logging   │  │  │\n│  │  └────────────────────────────────────────────────────┘  │  │\n│  │  ┌────────────────────────────────────────────────────┐  │  │\n│  │  │              Controllers \u0026 Services                │  │  │\n│  │  │  AuthController  HotelController  BookingService   │  │  │\n│  │  └────────────────────────────────────────────────────┘  │  │\n│  └──────────────────────────────────────────────────────────┘  │\n└────────────────────────────────────────────────────────────────┘\n                              ▼ SQL Queries\n┌────────────────────────────────────────────────────────────────┐\n│                          DATA LAYER                            │\n│  ┌──────────────────────────────────────────────────────────┐  │\n│  │              PostgreSQL Database                         │  │\n│  │  ┌──────┐  ┌───────┐  ┌──────┐  ┌─────────┐  ┌───────┐   │  │\n│  │  │Users │  │Hotels │  │Rooms │  │Bookings │  │Reviews│   │  │\n│  │  └──────┘  └───────┘  └──────┘  └─────────┘  └───────┘   │  │\n│  │  ┌────────┐  ┌────────┐  ┌────────┐  ┌────────────┐      │  │\n│  │  │Address │  │Contact │  │Details │  │Localities  │      │  │\n│  │  └────────┘  └────────┘  └────────┘  └────────────┘      │  │\n│  │                                                          │  │\n│  │  Triggers: Auto-update hotel ratings                     │  │\n│  │  Functions: Distance calculation (geolocation)           │  │\n│  └──────────────────────────────────────────────────────────┘  │\n└────────────────────────────────────────────────────────────────┘\n```\n\n### Frontend Architecture (Flutter BLoC)\n\n```\napps/frontend/\n├── lib/\n│   ├── app/\n│   │   ├── \u003cfeature\u003e/     # Feature-based organization\n│   │   │   ├── bloc/      # State management (BLoC)\n│   │   │   └── view/      # UI components \u0026 pages\n│   ├── data/\n│   │   ├── client/        # HTTP clients (e.g., Dio)\n│   │   ├── model/         # Data models\n│   │   └── repository/    # Data repositories\n│   ├── config/            # App configuration (routes, theme)\n│   └── l10n/              # Internationalization\n```\n\n### Backend Architecture (Dart Frog)\n\n```\napps/backend/\n├── routes/\n│   ├── api/v1/\n│   │   ├── \u003cresource\u003e/     # Resource endpoints\n│   │   │   ├── index.dart  # GET / POST\n│   │   │   └── [id].dart   # Dynamic routes\n│   └── index.dart          # Root endpoint\n├── lib/\n│   ├── controller/         # Request handlers \u0026 validation\n│   ├── service/            # Business logic\n│   ├── middleware/         # Auth, logging, injection\n│   ├── models/             # Re-exports from shared packages\n│   └── database/\n│       ├── extensions/     # *Db classes (HotelDb, UserDb, etc.)\n│       └── tables.dart     # Table name constants\n```\n\n### Shared Packages\n\n```\npackages/\n├── models/                 # booking_models: Shared DTOs (Hotel, User, Booking, etc.)\n│   └── lib/src/            # common model files\n└── utils/                  # booking_utils: Shared utilities \u0026 API constants\n    └── lib/src/\n        ├── endpoints.dart  # API endpoint constants\n        └── rating_utils.dart\n```\n\n---\n\n## 🗄️ Database Schema (ER Diagram)\n\n```mermaid\nerDiagram\n    users ||--o{ bookings : makes\n    users ||--o{ reviews : writes\n    hotels ||--o{ rooms : contains\n    hotels ||--o{ reviews : receives\n    hotels ||--|| address : has\n    hotels ||--|| contact : has\n    hotels ||--|| details : has\n    rooms ||--o{ bookings : has\n\n    users {\n        varchar id PK\n        varchar name\n        varchar email\n        varchar password\n        varchar access_token\n        varchar profile_image\n        bigint phone\n        date date_of_birth\n        varchar city\n        varchar state\n        varchar country\n        bigint pincode\n    }\n\n    hotels {\n        integer id PK\n        varchar name\n        text description\n        varchar property_type\n        varchar chain\n        integer star\n        real rating\n        integer rooms_starting_price\n        varchar cover_image\n    }\n\n    address {\n        serial id PK\n        varchar street\n        varchar city\n        varchar state\n        varchar country\n        bigint pincode\n        real latitude\n        real longitude\n        integer hotel_id FK\n    }\n\n    contact {\n        serial id PK\n        bigint phone\n        varchar email\n        varchar website\n        integer hotel_id FK\n    }\n\n    details {\n        serial id PK\n        text[] amenities\n        text[] rules\n        text[] preferences\n        text[] hotel_images\n        integer hotel_id FK\n    }\n\n    rooms {\n        serial id PK\n        varchar category\n        text description\n        integer price\n        integer count\n        integer capacity\n        text[] amenities\n        text[] room_images\n        integer hotel_id FK\n    }\n\n    bookings {\n        serial id PK\n        varchar status\n        date booking_date\n        date checkin\n        date checkout\n        integer rooms\n        integer guests\n        integer room_id FK\n        varchar user_id FK\n    }\n\n    reviews {\n        serial id PK\n        real rating\n        text review\n        text[] guest_images\n        integer hotel_id FK\n        varchar user_id FK\n    }\n\n    localities {\n        serial id PK\n        text name\n        real latitude\n        real longitude\n    }\n```\n\n### Key Relationships\n\n- **Users** can make multiple **Bookings** and write multiple **Reviews**\n- **Hotels** have one **Address**, one **Contact**, and one **Details** record\n- **Hotels** contain multiple **Rooms** and receive multiple **Reviews**\n- **Rooms** can have multiple **Bookings**\n- **Localities** are used for geolocation-based search\n\n### Database Functions \u0026 Triggers\n\n- **`distance()`** - Calculates distance between two coordinates (geolocation search)\n- **`update_hotel_rating()`** - Automatically updates hotel rating when a review is added\n\n---\n\n## 📋 Prerequisites\n\nBefore you begin, ensure you have the following installed:\n\n- **Flutter SDK**: \u003e= 3.35.0\n- **Dart SDK**: \u003e= 3.9.0 (comes with Flutter)\n- **PostgreSQL**: \u003e= 15.x\n- **Docker \u0026 Docker Compose**: (Optional, for containerized setup)\n- **Melos**: Install with `dart pub global activate melos`\n- **Dart Frog CLI**: Install with `dart pub global activate dart_frog_cli`\n- **Very Good CLI**: Install with `dart pub global activate very_good_cli`\n\n### System Requirements\n\n- **OS**: macOS, Linux, or Windows\n- **RAM**: Minimum 8GB recommended\n- **Storage**: 5GB free space\n\n---\n\n## 🚀 Installation \u0026 Setup\n\n### 1. Initialize Workspace\n\n#### Step 1.1: Clone the Repository\n\n```bash\ngit clone https://github.com/G1Joshi/Booking-App.git\ncd Booking-App\n```\n\n#### Step 1.2: Bootstrap Workspace\n\nThis command installs dependencies for all packages and links them.\n\n```bash\nmelos run install\n```\n\n### 2. Backend Setup\n\n#### Step 2.1: Initialize Database Schema\n\nTo initialize the database, you first need to start the backend services (which includes the database container).\n\n1.  **Start Backend**: Follow the instructions in [Running the Application](#-running-the-application) to start the backend.\n2.  **Initialize Schema**: Once the backend is running, run the following SQL scripts in order:\n\n```\napps/backend/queries/\n├── drop/\n├── tables/\n├── functions/\n├── triggers/\n└── seed/\n```\n\n---\n\n## 🎮 Running the Application\n\nThis project uses **Melos** to manage scripts. You can run the backend and frontend using the following commands from the root of the project.\n\n### Start Backend Server\n\n```bash\nmelos run run:backend\n```\n\nThis command will:\n\n1. Start the Docker containers (PostgreSQL).\n2. Start the Dart Frog development server on port `8090`.\n\nServer will start at: `http://localhost:8090`\n\n### Start Frontend Application\n\n```bash\nmelos run run:frontend\n```\n\nThis command will run the frontend in Chrome (Web) with the development flavor.\n\n---\n\n## 🛠️ Technologies Used\n\n### Frontend\n\n| Technology                                                        | Purpose                        |\n| ----------------------------------------------------------------- | ------------------------------ |\n| [Flutter](https://flutter.dev)                                    | Cross-platform UI framework    |\n| [Dart](https://dart.dev)                                          | Programming language           |\n| [flutter_bloc](https://pub.dev/packages/flutter_bloc)             | State management (BLoC)        |\n| [Dio](https://pub.dev/packages/dio)                               | HTTP client for API calls      |\n| [shared_preferences](https://pub.dev/packages/shared_preferences) | Local storage for tokens       |\n| [flutter_rating_bar](https://pub.dev/packages/flutter_rating_bar) | Rating UI component            |\n| [shimmer](https://pub.dev/packages/shimmer)                       | Loading shimmer animations     |\n| [equatable](https://pub.dev/packages/equatable)                   | Value equality for BLoC        |\n| [intl](https://pub.dev/packages/intl)                             | Internationalization \u0026 formats |\n\n### Backend\n\n| Technology                                    | Purpose                             |\n| --------------------------------------------- | ----------------------------------- |\n| [Dart Frog](https://dart-frog.dev)            | Backend REST API framework          |\n| [Dart](https://dart.dev)                      | Programming language                |\n| [PostgreSQL](https://www.postgresql.org)      | Relational database                 |\n| [postgres](https://pub.dev/packages/postgres) | PostgreSQL driver for Dart          |\n| [uuid](https://pub.dev/packages/uuid)         | UUID v4 for access token generation |\n\n### DevOps\n\n| Technology                                         | Purpose                       |\n| -------------------------------------------------- | ----------------------------- |\n| [Docker](https://www.docker.com)                   | Containerization              |\n| [Docker Compose](https://docs.docker.com/compose/) | Multi-container orchestration |\n| [Adminer](https://www.adminer.org)                 | Database management tool      |\n| [Melos](https://melos.invertase.dev)               | Monorepo management           |\n\n---\n\n## 🧪 Testing\n\n### Backend Tests\n\n```bash\nmelos run test:backend\n```\n\n### Frontend Tests\n\n```bash\nmelos run test:frontend\n```\n\n### Shared Models Tests\n\n```bash\nmelos run test:models\n```\n\n### Shared Utils Tests\n\n```bash\nmelos run test:utils\n```\n\n---\n\n## 🐛 Troubleshooting\n\n### Backend Issues\n\n**Issue: Database connection failed**\n\n```\nSolution:\n1. Check if PostgreSQL is running: pg_isready\n3. Ensure database exists: psql -l\n```\n\n### Frontend Issues\n\n**Issue: Cannot connect to backend**\n\n```\nSolution:\n1. Verify backend is running on localhost:8080\n2. Check API_URL in lib/config/apis.dart\n3. For physical devices, use network IP instead of localhost\n```\n\n---\n\n## 👨‍💻 Author\n\n**Jeevan Joshi** ([@G1Joshi](https://github.com/G1Joshi))\n\n---\n\n## 🙏 Acknowledgments\n\n- [Very Good Ventures](https://verygood.ventures) for Flutter best practices\n- [Dart Frog Team](https://dart-frog.dev) for the amazing backend framework\n- [Invertase](https://invertase.io) for `Melos` to manage monorepo\n- [Flutter Community](https://flutter.dev/community) for continuous support\n\n---\n\n**Happy Coding! 🚀**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FG1Joshi%2FBooking-App","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FG1Joshi%2FBooking-App","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FG1Joshi%2FBooking-App/lists"}