CalmAlert is a wakeword detection system that utilizes Django for the backend and a React-based frontend. The system processes audio inputs to detect specific wakewords and classify emotions based on audio recordings.
Ensure you have the following installed:
- Python 3.9+
- pip (Python package manager)
- virtualenv (recommended for dependency management)
- Redis (for WebSocket channels)
- PostgreSQL/MySQL (if not using SQLite in production)
-
Clone the repository:
git clone https://github.com/yourusername/CalmAlert.git cd CalmAlert/backend/wakeword -
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On macOS/Linux .venv\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
Create a .env file in the backend/wakeword/ directory:
DJANGO_SECRET_KEY=your_secret_key
DJANGO_DEBUG=True
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1
TWILIO_SID=your_twilio_sid
TWILIO_TOKEN=your_twilio_auth_token
REDIS_URL=redis://127.0.0.1:6379-
Apply database migrations:
python manage.py migrate
-
Create a superuser (optional, for Django admin panel):
python manage.py createsuperuser
-
Run the server:
python manage.py runserver
The backend will be accessible at
http://127.0.0.1:8000/
Ensure you have the following installed:
- Node.js (16+ recommended)
- npm or yarn
-
Navigate to the frontend directory:
cd CalmAlert/frontend -
Install dependencies:
npm install # or yarn install
- Start the development server:
The frontend will be accessible at
npm start # or yarn starthttp://localhost:3000/
POST /api/detect/- Upload an audio file for wakeword detectionGET /api/status/- Check system statusPOST /api/emotion/- Classify emotion from an audio file
Run:
pip install djangorestframeworkRun:
pip install django-cors-headersAdd 'corsheaders' to INSTALLED_APPS and 'corsheaders.middleware.CorsMiddleware' to MIDDLEWARE.
Ensure Redis is running:
redis-serverFeel free to fork and submit pull requests!
MIT License