Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🤖 Virtual Assistant

Your Personal AI-Powered Assistant

An intelligent, full-stack virtual assistant built to make everyday interactions simpler through conversational AI and a modern web experience.

Built with React, Node.js, Express, MongoDB, and Google Gemini AI.


React Node.js Express MongoDB Gemini AI


Overview • Features • Tech Stack • Architecture • Installation • Roadmap


📌 Overview

Virtual Assistant is a full-stack application that integrates AI-powered assistance into an interactive web experience.

Built with React on the frontend and Node.js with Express on the backend, the project explores how modern web technologies can be combined with generative AI to create an intelligent personal assistant.

The application integrates Google Gemini AI and uses a backend architecture designed to support authentication, database operations, and external services.

The goal is to create a foundation for natural human-computer interaction while exploring the practical implementation of AI-powered applications.

🎯 Project Goals

  • Integrate generative AI into a full-stack web application.
  • Build an intuitive interface for interacting with an AI assistant.
  • Explore voice-driven interactions and conversational experiences.
  • Implement backend APIs and database connectivity.
  • Develop a modular architecture that supports additional assistant capabilities.
  • Apply practical concepts in authentication, API integration, and application development.

✨ Features

🧠 AI-Powered Conversations

Google Gemini AI integration provides the foundation for intelligent conversational interactions.

  • Natural-language interactions with an AI model.
  • AI-generated responses to user queries.
  • An extensible foundation for additional AI capabilities.

🎙️ Voice Interaction

Explore voice-driven interaction to make communication with the assistant more natural.

The application can be extended with speech recognition and text-to-speech functionality, depending on the browser APIs and services implemented.

⚛️ Modern User Interface

Built with React and Vite for a modern frontend development experience.

  • Component-based architecture.
  • Client-side navigation with React Router.
  • Utility-first styling using Tailwind CSS.
  • Icon integration with React Icons.
  • HTTP requests through Axios.

🔐 Authentication

The backend includes dependencies for authentication and account-related functionality.

  • JWT-based authentication.
  • Password hashing with bcrypt.
  • Cookie handling with cookie-parser.
  • Cross-origin request configuration using CORS.

The exact authentication flows depend on the implemented routes and middleware.

🗄️ Database Integration

MongoDB and Mongoose provide the foundation for persistent data storage.

The backend can define structured data models and interact with stored application data through database operations.

☁️ Cloud Integration

Cloudinary is included as a dependency for cloud-based media management.

This provides a foundation for integrating image uploads and other supported media operations.

🔌 Extensible Backend

The Express backend provides a foundation for:

  • REST API development.
  • Request and response handling.
  • Authentication middleware.
  • Database operations.
  • External API integration.
  • Additional AI-powered functionality.

🛠️ Tech Stack

Category Technologies
Frontend React 19, JavaScript
Build Tool Vite
Styling Tailwind CSS 4
Routing React Router
Icons React Icons
HTTP Client Axios
Backend Node.js, Express 5
Database MongoDB
ODM Mongoose
Authentication JWT, bcrypt
AI Integration Google Gemini AI
Media Services Cloudinary
Environment Configuration dotenv
Development Tools npm, Nodemon, ESLint

🏗️ Architecture

The application follows a frontend-backend architecture.

┌───────────────────────────────┐
│                               │
│         React Frontend        │
│                               │
│  User Interface               │
│  React Components             │
│  Client-side Routing          │
│  API Requests                 │
│                               │
└───────────────┬───────────────┘
                │
                │ HTTP / REST
                ▼
┌───────────────────────────────┐
│                               │
│        Express Backend        │
│                               │
│  API Routes                   │
│  Application Logic            │
│  Authentication               │
│                               │
└──────────┬───────────┬────────┘
           │           │
           ▼           ▼
┌──────────────┐  ┌──────────────┐
│              │  │              │
│   MongoDB    │  │   Gemini AI  │
│              │  │              │
└──────────────┘  └──────────────┘

Request Flow

  1. The user interacts with the React frontend.
  2. The frontend sends an HTTP request to the backend when required.
  3. Express processes the request and executes the relevant application logic.
  4. The backend communicates with MongoDB or an external service when necessary.
  5. The response is returned to the frontend.
  6. React updates the interface based on the response.

The diagram represents the high-level architecture. Actual request flows depend on the implemented routes and service integrations.


📂 Project Structure

The repository separates the frontend and backend into independent applications.

virtualAssistant/
│
├── frontend/
│   ├── src/
│   │   ├── components/       # Reusable UI components
│   │   ├── pages/             # Application pages
│   │   ├── assets/            # Static assets
│   │   ├── App.jsx            # Main application component
│   │   └── main.jsx           # Frontend entry point
│   │
│   ├── public/                # Public assets
│   ├── package.json
│   └── vite.config.js
│
├── backend/
│   ├── index.js               # Backend entry point
│   ├── package.json
│   └── ...                    # Routes, models and services
│
└── README.md

Adjust individual filenames and directories to match the actual repository structure.


🚀 Getting Started

Follow these steps to run the project locally.

Prerequisites

Ensure that you have the following installed:

  • Node.js
  • npm
  • MongoDB, if required by the application
  • A Google Gemini API key, if using the Gemini integration
  • A Cloudinary account, if using its media services

1. Clone the Repository

git clone https://github.com/siddharth07-code/virtualAssistant.git
cd virtualAssistant

2. Set Up the Backend

Navigate to the backend directory:

cd backend

Install the dependencies:

npm install

Create a .env file inside the backend directory.

Example configuration:

PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_secure_random_secret
GEMINI_API_KEY=your_gemini_api_key
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret

Important: These environment variable names are illustrative. Verify the actual variable names used in your source code and configure only the values your application requires.

Never commit API keys, database credentials, or other secrets to GitHub.

Start the backend:

npm start

The backend's start script uses Nodemon to execute index.js.

3. Set Up the Frontend

Open a new terminal and navigate to the frontend directory from the project root:

cd virtualAssistant/frontend

If you are already inside the project root, simply run:

cd frontend

Install the dependencies:

npm install

Start the development server:

npm run dev

Vite will display the local development URL in your terminal.

Open that URL in your browser to access the application.

4. Verify the Application

After starting both applications:

  1. Open the frontend in your browser.
  2. Confirm that the interface loads correctly.
  3. Test the implemented assistant features.
  4. Verify that frontend API requests reach the backend.
  5. Confirm that the database and external services are configured correctly.

If the frontend cannot communicate with the backend, check the API base URL, CORS configuration, server port, and browser console.


🔑 Environment Variables

Keep sensitive configuration outside your source code.

Variable Purpose
PORT Backend server port
MONGODB_URI MongoDB connection string
JWT_SECRET Secret used for JWT signing or verification
GEMINI_API_KEY Google Gemini API credential
CLOUDINARY_CLOUD_NAME Cloudinary account identifier
CLOUDINARY_API_KEY Cloudinary API credential
CLOUDINARY_API_SECRET Cloudinary API secret

Configure only the environment variables required by your implementation.

For production deployments, use your hosting provider's secret-management facilities.


🧪 Available Scripts

Frontend

Run these commands from the frontend directory.

Command Description
npm run dev Start the Vite development server
npm run build Generate a production build
npm run preview Preview the production build locally
npm run lint Run ESLint

Backend

Run these commands from the backend directory.

Command Description
npm start Start the backend using Nodemon

🔒 Security Considerations

Security is essential when building AI-powered applications.

  • Store API keys and database credentials in environment variables.
  • Use strong, randomly generated JWT secrets.
  • Hash passwords before storing them.
  • Validate and sanitize user input on the backend.
  • Restrict CORS to trusted frontend origins in production.
  • Avoid exposing sensitive server errors to clients.
  • Protect private endpoints with appropriate authentication and authorization.
  • Consider rate limiting AI endpoints to reduce abuse and unexpected API costs.

The actual security guarantees depend on the protections implemented in the application.


🗺️ Future Improvements

Potential directions for further development include:

  • Improve voice interaction and speech-response handling.
  • Add persistent conversation history.
  • Introduce contextual memory for longer conversations.
  • Expand assistant capabilities through modular tools.
  • Improve loading states and error handling.
  • Add automated tests for API endpoints and user flows.
  • Introduce rate limiting and AI usage monitoring.
  • Improve production deployment and configuration.
  • Add screenshots and a demonstration video.
  • Document API endpoints and application workflows.

These are potential improvements rather than claims about existing functionality.


🤝 Contributing

Contributions, suggestions, and bug reports are welcome.

How to Contribute

  1. Fork the repository.
  2. Create a branch for your changes.
  3. Implement and test your changes.
  4. Commit your changes with a descriptive message.
  5. Push the branch to your fork.
  6. Open a pull request explaining your contribution.

Example:

git checkout -b feat/improve-assistant
git add .
git commit -m "feat: improve assistant interaction"
git push origin feat/improve-assistant

Keep contributions focused and ensure that existing functionality continues to work as expected.


👨‍💻 Author

Siddharth Lal

Computer Science Engineering student interested in full-stack development, artificial intelligence, machine learning, and building practical AI-powered applications.

GitHub

View Repository


📄 License

The backend package declares the ISC license.

Before distributing the project, ensure that an appropriate root-level LICENSE file exists and that its terms accurately reflect the licensing of the complete application.


Building a more natural way to interact with AI.

If you find this project interesting, consider giving the repository a ⭐

Made with curiosity and a passion for building with AI.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages