A voice-enabled salon booking assistant that helps customers schedule appointments and check service availability.
- Python 3.8 or higher
- PostgreSQL 12 or higher
- psql command-line tool
- Clone the repository:
git clone <repository-url>
cd salon
- Create and activate a virtual environment:
python -m venv venv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
- Install Python dependencies:
pip install -r requirements.txt
- Start PostgreSQL service:
# On macOS
brew services start postgresql
# On Ubuntu/Debian
sudo service postgresql start
# On Windows
# Start PostgreSQL service from Services application
- Create the database:
psql -U postgres
CREATE DATABASE salon;
\q
- Seed the database with initial data:
# From project root
python scripts/seed_database.py
- Create a
.env
file in the root directory or copy from .env.example:
# Database Settings
DATABASE_URL=postgresql://{username}:{password}@localhost:5432/salon
# Voice Service Settingsa
WHISPER_MODEL=tiny # Options: tiny, base, small, medium, large
TTS_LANGUAGE=en
TTS_PROVIDER=gtts # Options: gtts, google_cloud
STT_PROVIDER=whisper # Options: whisper, google_cloud
# Optional Google Cloud Settings
GOOGLE_CLOUD_CREDENTIALS=path/to/credentials.json # Only if using Google Cloud services
You'll need to run three components: the FastAPI server, the Rasa server, and the Rasa Action server.
- Ensure PostgreSQL is running:
# Check PostgreSQL status
# On macOS
brew services list | grep postgresql
# On Ubuntu/Debian
sudo service postgresql status
# On Windows
# Check Services application
- Start the FastAPI server:
# From the project root
uvicorn app.main:app --reload --port 8000
- Start the Rasa server:
# From the rasa directory
rasa run --enable-api --cors "*" --port 5005 --model stable-model.tar.gz
- Start the Rasa Action server (in a new terminal):
# From the rasa directory
rasa run actions --port 5055
After making changes to the rasa config files you will need to re-train
# From the rasa directory
rasa train
You can then start the model
# From the rasa directory
rasa run --enable-api --cors "*" --port 5005 --model route/to/model
- Run the test suite:
# From the project root
pytest
- Access the voice interface:
- Open your browser and navigate to:
http://localhost:8000/static/voice.html
- Click "Start Recording" and allow microphone access
- Speak your request (e.g., "I want to book a haircut")
- Click "Stop Recording" to process your request
The assistant can help with:
- Booking appointments for:
- Haircuts
- Massages
- Facials
- Manicures
- Pedicures
- Hair coloring
- Styling
- Checking service availability
- Canceling appointments
salon/
├── app/
│ ├── api/ # API endpoints
│ ├── core/ # Core functionality
│ ├── db/ # Database models and migrations
│ ├── services/ # Business logic
│ └── utils/ # Utility functions
├── tests/ # Test files
├── scripts/ # Utility scripts
├── .env.example # Example environment variables
├── requirements.txt # Project dependencies
└── README.md # This file
Once the server is running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
MIT License