Skip to content

starter-coder-123/SR

Repository files navigation

Shree Rathnam — Hotel AI Voice Assistant (AVA)

This is a Next.js application that provides a voice-first ordering assistant for the Shree Rathnam hotel. It features a full menu dashboard, real-time item availability management, and a GenAI-powered voice assistant for taking orders.

Features

  • Menu Dashboard: View the entire restaurant menu, filter by category, and toggle item availability in real-time.
  • Unavailable Items Management: A dedicated page to review and permanently remove unavailable items from the menu.
  • AI Voice Assistant: A voice-activated assistant to take customer orders conversationally. It supports multiple languages (English, Hindi, Kannada).
  • Settings: Configure the voice assistant's language.
  • Real-time Sync: Menu data is synchronized in real-time with a Firestore database.

Tech Stack

  • Framework: Next.js (App Router)
  • UI: React, TypeScript, Tailwind CSS, Shadcn/UI
  • AI: Google Genkit
  • Database: Google Firestore
  • Platform: Firebase

Getting Started

Prerequisites

  • Node.js (v18 or later)
  • npm or yarn
  • A Firebase project with Firestore enabled.

1. Clone the repository

git clone <repository-url>
cd <repository-name>

2. Install dependencies

npm install

3. Set up Environment Variables

Create a .env.local file in the root of the project by copying the example file:

cp .env.local.example .env.local

Now, fill in the values in .env.local:

  • NEXT_PUBLIC_FIREBASE_API_KEY: Your Firebase project's API key.
  • NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: Your Firebase project's auth domain.
  • NEXT_PUBLIC_FIREBASE_PROJECT_ID: Your Firebase project's ID.
  • NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: Your Firebase project's storage bucket.
  • NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: Your Firebase project's messaging sender ID.
  • NEXT_PUBLIC_FIREBASE_APP_ID: Your Firebase project's app ID.
  • GOOGLE_API_KEY: Your Google AI API key for Genkit.

4. Set up Firebase Admin SDK (for seeding data)

  1. In your Firebase project console, go to Project settings > Service accounts.
  2. Click Generate new private key and save the downloaded JSON file.
  3. IMPORTANT: Rename the file to serviceAccountKey.json and place it in the root of your project.
  4. DO NOT COMMIT THIS FILE TO GIT. The .gitignore file is already configured to ignore it.

5. Seed the Firestore Database

The application requires menu data to be present in Firestore. A script is provided to seed the database from src/lib/menu_sample.json.

Run the following command:

npm run seed:firestore

This will create a menu collection in your Firestore database and populate it with the sample menu items.

Firestore Index Recommendation

For optimal query performance, create a composite index in your Firestore database for the menu collection with the following fields:

  1. category (Ascending)
  2. name_lower (Ascending)
  3. available (Ascending)

6. Run the Development Server

You can now start the Next.js development server:

npm run dev

The application will be available at http://localhost:9002.

Deployment

This application is configured for deployment on Firebase App Hosting.

  1. Ensure the Firebase CLI is installed and you are logged in.
  2. Initialize Firebase App Hosting in your project.
  3. Set the required environment variables (from .env.local) as secrets in your App Hosting backend. Refer to the Firebase documentation for instructions on how to do this.
  4. Deploy the application:
firebase deploy --only apphosting

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published