Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧬 BioTechAI

An AI-powered full-stack learning platform for biotechnology students. BioTechAI helps users learn through an AI tutor chatbot, generate personalized learning roadmaps, take AI-generated quizzes, and track their progress — all in one place.


✨ Features

  • 🤖 AI Tutor Chat — Ask any biotechnology question and get concise, structured answers powered by Groq's LLaMA 3.1
  • 🗺️ Learning Roadmap Generator — Input your goal and experience level to get a personalized roadmap covering subjects, tools, certifications, projects, and career paths
  • 📝 AI Quiz Generator — Generate multiple-choice quizzes on any biotech topic with configurable difficulty and number of questions
  • 📊 Quiz Result Tracking — Save quiz scores and review past performance from your personal dashboard
  • 🔐 User Authentication — Secure register/login with bcrypt password hashing and JWT token-based sessions
  • 👤 User Profile & Account Management — View profile, delete account, and manage personal data

🛠️ Tech Stack

Backend (main.py)

  • FastAPI — REST API framework
  • Groq SDK — LLaMA 3.1-8b-instant model for AI features
  • MongoDB — User data and quiz results storage
  • PyMongo — MongoDB driver
  • Pydantic — Request/response data validation
  • python-jose — JWT token creation and verification
  • passlib + bcrypt — Secure password hashing
  • python-dotenv — Environment variable management

Frontend (src/)

  • JavaScript — 83.9% of codebase
  • React-based UI connecting to the FastAPI backend

📁 Project Structure

BioTechAI/
├── main.py          # FastAPI app — all routes and business logic
├── models.py        # Pydantic models (UserRegister, UserLogin, SaveQuizResult)
├── database.py      # MongoDB connection and collections
├── src/             # Frontend (React/JS)
└── .env             # Environment variables (not committed)

🔌 API Endpoints

Method Endpoint Auth Required Description
POST /register Register a new user
POST /login Login and receive JWT token
GET /me Get current user profile
DELETE /delete-account Delete user and all their data
POST /chat Ask the AI biotech tutor a question
POST /roadmap Generate a personalized learning roadmap
POST /question Generate AI quiz questions
POST /save-result Save a completed quiz result
GET /my-results Retrieve all past quiz results

🚀 Getting Started

Prerequisites

  • Python 3.9+
  • MongoDB (local or Atlas)
  • Groq API key — get one at console.groq.com

1. Clone the repository

git clone https://github.com/Sashriya/BioTechAI.git
cd BioTechAI

2. Install backend dependencies

pip install fastapi uvicorn groq python-dotenv passlib[bcrypt] python-jose[cryptography] pymongo pydantic[email]

3. Set up environment variables

Create a .env file in the root:

GROQ_API_KEY=your_groq_api_key_here
JWT_SECRET=your_jwt_secret_here
MONGO_URI=your_mongodb_connection_string

4. Run the backend

uvicorn main:app --reload

API runs at http://localhost:8000

5. Run the frontend

cd src
npm install
npm start

🔐 Authentication Flow

  1. User registers with name, email, and password
  2. Password is truncated to 72 bytes and hashed with bcrypt before storage
  3. On login, the password is verified and a JWT token (2-hour expiry) is returned
  4. Protected routes require the token as a Bearer header: Authorization: Bearer <token>
  5. The verify_token dependency decodes the JWT and extracts the user's email for use in handlers

🧠 AI Features

All AI features use Groq's LLaMA 3.1-8b-instant model for fast inference.

  • Chat — System-prompted as a biotech tutor, responses kept to 20-30 lines
  • Roadmap — Structured prompt requesting subjects, skills, tools, certifications, projects, and careers
  • Quiz — Strict JSON-only prompt with regex fallback parsing to reliably extract MCQ arrays

🔮 Future Improvements

  • Streamed AI responses for faster perceived performance
  • Leaderboard across users for quiz scores
  • Topic-based progress tracking and learning streaks
  • PDF export of roadmaps
  • Refresh token support for longer sessions

👤 Author

Sashriyagithub.com/Sashriya Shakthivishwagithub.com/SHAKTHImsv

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages