An intelligent full-stack for Early alzheimer detection application leveraging AI for advanced speech processing and interactive experiences.
CogniVoice is a sophisticated full-stack web application designed for advanced voice analysis to support the early detection of Alzheimerβs disease. It integrates a modern web interface with a robust backend API and a dedicated AI model service, enabling functionalities like speech processing, natural language understanding, and real-time voice interactions. This project is structured as a monorepo, separating the frontend, backend, and AI model into distinct, yet interconnected, services.
- ποΈ AI-Powered Speech Processing: Leverages a dedicated AI model for sophisticated voice-to-text, sentiment analysis, or other speech-related tasks.
- π£οΈ Real-time Voice Interaction: Facilitates interactive voice experiences through WebSockets for seamless communication.
- π User Authentication & Authorization: Secure user management with JWT-based authentication and password hashing (bcryptjs).
- πΎ Persistent Data Storage: Utilizes SQLite to store user data, voice sessions, and application-specific information.
- π¨ Responsive & Modern UI: Built with React+ vite js and Tailwind CSS for a visually appealing and adaptive user experience across devices.
- β‘ Scalable Architecture: Modular design with separate frontend, backend, and AI services for enhanced performance and maintainability.
- π§© Component-Based UI: Developed using React components with Radix UI for accessible and customizable UI primitives.
CogniVoice Landing Page: Providing an overview of our solution.
CogniVoice Dashboard: Providing an overview of user activity and voice sessions.
Voice Interaction: Demonstrating real-time speech processing and feedback.
CogniVoice is a monorepo containing three distinct services: frontend, cognivoice-backend, and cognivoice-aimodel. Each service has its own setup requirements.
Ensure you have the following installed on your system:
- Node.js:
^18.xor higher (for frontend and backend) - npm:
^9.xor higher (usually comes with Node.js) - Python:
^3.9or higher (for the AI model service) - pip:
^23.xor higher (usually comes with Python)
-
Clone the repository
git clone https://github.com/labyedh/CogniVoice.git cd CogniVoice -
Setup the Frontend Navigate to the
frontenddirectory:cd frontendInstall dependencies:
npm install # or yarn install or pnpm installCreate and configure environment variables:
# Open .env.local and set: VITE_REACT_APP_API_URL=http://127.0.0.1:5000Return to the root directory:
cd .. -
Setup the Backend Navigate to the
cognivoice-backenddirectory:cd cognivoice-backendInstall dependencies:
pip install -r requirements.txt
Create and configure environment variables:
# Open .env and set: SECRET_KEY="1234" AI_SERVICE_URL=http://127.0.0.1:8000 INTERNAL_API_SECRET="1234" ADMIN_EMAIL=admin@cognivoice.com ADMIN_PASSWORD=AdminPass123! ADMIN_FIRST_NAME=Admin ADMIN_LAST_NAME=User
Return to the root directory:
cd .. -
Setup the AI Model Service Navigate to the
cognivoice-aimodeldirectory:cd cognivoice-aimodelCreate a Python virtual environment and activate it:
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
Install Python dependencies:
pip install -r requirements.txt
Create and configure environment variables:
.env_ai # Open .env_ai and set: INTERNAL_API_SECRET="1234" HF_AUTH_TOKEN=your_token FLASK_BACKEND_URL=http://127.0.0.1:5000
Return to the root directory:
cd ..
You need to start all three services independently.
-
Start the AI Model Service Open another new terminal, navigate to
cognivoice-aimodel, activate its virtual environment, and start the FastAPI server:cd cognivoice-aimodel source venv/bin/activate # Or `venv\Scripts\activate` on Windows uvicorn app:app --host 0.0.0.0 --port 8000 --reload # The AI model service will start on http://localhost:8000
-
Start the Backend Service Open a new terminal, navigate to
cognivoice-backend, and start the development server:cd cognivoice-backend python run.py # The backend will start on http://localhost:5000
-
Start the Frontend Application Open a final new terminal, navigate to
frontend, and start the Next.js development server:cd frontend npm run dev # The frontend will start on http://localhost:3000
-
Open your browser Visit
http://localhost:3000to access the application.
CogniVoice/
βββ .github/ # GitHub specific files (e.g., workflows, assets)
β βββ assets/ # Images for README, logos
βββ .gitignore # Specifies intentionally untracked files to ignore
βββ LICENSE # Project license
βββ README.md # This README file
βββ cognivoice-aimodel/ # Python FastAPI service for AI model inference
β βββ .env.example # Example environment variables for the AI service
β βββ app.py # FastAPI application entry point
β βββ data/ # Directory for model files or data
β βββ Dockerfile # Docker configuration for AI service
β βββ model.py # Core AI model loading and inference logic
β βββ requirements.txt # Python dependencies
βββ cognivoice-backend/ # Node.js Express API service
β βββ .env.example # Example environment variables for the backend
β βββ dist/ # Compiled JavaScript output
β βββ package.json # Node.js dependencies and scripts
β βββ src/ # Backend source code
β β βββ controllers/ # Handlers for API requests
β β βββ middleware/ # Express middleware (e.g., authentication)
β β βββ models/ # Mongoose schemas for database interaction
β β βββ routes/ # API endpoint definitions
β β βββ server.ts # Main Express server entry point
β βββ tsconfig.json # TypeScript configuration for backend
β βββ yarn.lock # Exact dependency versions (if yarn used)
βββ frontend/ # Next.js React application
βββ .env.example # Example environment variables for the frontend
βββ next.config.js # Next.js configuration
βββ package.json # Node.js dependencies and scripts
βββ public/ # Static assets (images, fonts, etc.)
βββ src/ # Frontend source code
β βββ app/ # Next.js App Router pages and layouts
β βββ components/ # Reusable UI components
β βββ styles/ # Global styles (e.g., Tailwind CSS base)
βββ tailwind.config.ts # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration for frontend
βββ yarn.lock # Exact dependency versions (if yarn used)
We welcome contributions to CogniVoice! Please refer to our Contributing Guide for details on how to get started, report bugs, or propose new features.
Follow the "Quick Start" instructions above to set up all three services. Ensure your development environment is consistent with the project's requirements.
This project is licensed under the MIT License - see the LICENSE file for details.
- React and the broader Typescript ecosystem for providing powerful tools for web development.
- Flask for a robust backend framework.
- Python, FastAPI, Pytorch, and Hugging Face Transformers for enabling advanced AI capabilities.
- The open-source community for countless libraries and tools that make this project possible.
- π§ Email: [yassine.labyed@fsb.ucar.tn]
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
β Star this repo if you find it helpful!
Made with β€οΈ by labyedh