Skip to content

labyedh/CogniVoice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ CogniVoice

GitHub license

An intelligent full-stack for Early alzheimer detection application leveraging AI for advanced speech processing and interactive experiences.

πŸ“– Overview

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.

✨ Features

  • πŸŽ™οΈ 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.

πŸ–₯️ Screenshots

Screenshot of CogniVoice Dashboard CogniVoice Landing Page: Providing an overview of our solution.

Screenshot of CogniVoice Dashboard CogniVoice Dashboard: Providing an overview of user activity and voice sessions.

Screenshot of Voice Interaction Interface Voice Interaction: Demonstrating real-time speech processing and feedback.

πŸ› οΈ Tech Stack

Frontend

Technology Description
React Framework: A JavaScript library for building user interfaces, providing component-based architecture and fast rendering.
TypeScript Language: A typed superset of JavaScript that compiles to plain JavaScript.
Tailwind CSS Styling: A utility-first CSS framework for rapidly building modern, responsive designs.

Backend

Technology Description
Python Language: Python
Flask Framework: A lightweight and powerful Python web framework for building backend APIs
SQLite Database: SQLite for persistent storage of user data, sessions, and logs
JWT Bcrypt Authentication: JSON Web Tokens for secure authentication and bcrypt for password hashing

AI Model Service

Technology Description
Python FastAPI Runtime & Framework: High-performance Python web framework for building APIs.
PyTorch Transformers ML Frameworks: PyTorch for deep learning and Hugging Face Transformers for state-of-the-art NLP models.
Librosa Voice Library: Librosa for audio and music analysis.

πŸš€ Quick Start

CogniVoice is a monorepo containing three distinct services: frontend, cognivoice-backend, and cognivoice-aimodel. Each service has its own setup requirements.

Prerequisites

Ensure you have the following installed on your system:

  • Node.js: ^18.x or higher (for frontend and backend)
  • npm: ^9.x or higher (usually comes with Node.js)
  • Python: ^3.9 or higher (for the AI model service)
  • pip: ^23.x or higher (usually comes with Python)

Installation

  1. Clone the repository

    git clone https://github.com/labyedh/CogniVoice.git
    cd CogniVoice
  2. Setup the Frontend Navigate to the frontend directory:

    cd frontend

    Install dependencies:

    npm install # or yarn install or pnpm install

    Create and configure environment variables:

    # Open .env.local and set:
    VITE_REACT_APP_API_URL=http://127.0.0.1:5000

    Return to the root directory:

    cd ..
  3. Setup the Backend Navigate to the cognivoice-backend directory:

    cd cognivoice-backend

    Install 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 ..
  4. Setup the AI Model Service Navigate to the cognivoice-aimodel directory:

    cd cognivoice-aimodel

    Create 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 ..

Running the Application

You need to start all three services independently.

  1. 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
  2. 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
  3. 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
  4. Open your browser Visit http://localhost:3000 to access the application.

πŸ“ Project Structure

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)

🀝 Contributing

We welcome contributions to CogniVoice! Please refer to our Contributing Guide for details on how to get started, report bugs, or propose new features.

Development Setup for Contributors

Follow the "Quick Start" instructions above to set up all three services. Ensure your development environment is consistent with the project's requirements.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • 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.

πŸ“ž Support & Contact


⭐ Star this repo if you find it helpful!

Made with ❀️ by labyedh

About

An intelligent full-stack for Early alzheimer detection application leveraging AI for advanced speech processing and interactive experiences.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors