Skip to content

A comprehensive full-stack application for conducting technical assessments with MCQ and coding questions, powered by AI-generated content.

License

Notifications You must be signed in to change notification settings

AmolMagar2000/Candidate-Assessment-Agentic-Platform

Repository files navigation

🎯 Candidate Assessment Platform

A comprehensive full-stack application for conducting technical assessments with MCQ and coding questions, powered by AI-generated content.

πŸ“‹ Features

For Candidates

  • πŸ” Secure email-based authentication
  • ⏱️ Timed assessments (60 minutes)
  • πŸ“ Multiple choice questions (MCQs)
  • πŸ’» Live code execution (Python & Java)
  • πŸ“Š Real-time progress tracking
  • βœ… Instant submission and scoring

For Administrators

  • πŸ‘₯ External candidate synchronization
  • πŸ€– AI-powered question generation using Mistral LLM
  • πŸ“š Role-specific question banks (Apex, React, Java, OIC, Backend)
  • πŸ” Question preview and verification
  • πŸ“ˆ Detailed results and analytics
  • πŸ“œ Generation logs for debugging
  • πŸ”„ System reset capabilities

πŸ—οΈ Architecture

Backend (FastAPI)

  • Framework: FastAPI with SQLAlchemy ORM
  • Database: SQLite (easily switchable to PostgreSQL/MySQL)
  • LLM Integration: Mistral AI for question generation
  • Code Execution: Sandboxed code executor for Python/Java
  • API Documentation: Auto-generated at /docs

Frontend (Streamlit)

  • Framework: Streamlit for rapid UI development
  • Features: Multi-page navigation, real-time updates, responsive design
  • Components: Candidate portal + Admin dashboard

πŸš€ Getting Started

Prerequisites

  • Python 3.8+
  • Mistral AI server (or compatible LLM endpoint)
  • Git

Installation

  1. Clone the repository
git clone https://github.com/AmolMagar2000/Candidate-Assessment-Agentic-Platform.git
cd candidate-assessment
  1. Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies
pip install -r requirements.txt
  1. Configure environment variables

Create a .env file in the root directory:

# LLM Configuration
MISTRAL_API_URL=http://localhost:11434
MISTRAL_MODEL=mistral:latest
LLM_TIMEOUT=360

# External API for candidate sync
EXTERNAL_API_URL=https://your-external-api.com/candidates

# Database (optional, defaults to SQLite)
# DATABASE_URL=postgresql://user:password@localhost/dbname
  1. Set up reference topics

Create a reference_topics/ directory with topic files:

  • apex_mcq_topics.txt
  • apex_coding_topics.txt
  • react_mcq_topics.txt
  • react_coding_topics.txt
  • java_mcq_topics.txt
  • java_coding_topics.txt
  • oic_mcq_topics.txt
  • oic_coding_topics.txt

Example content for java_mcq_topics.txt:

Java Collections Framework
Multithreading and Concurrency
Stream API and Functional Programming
Exception Handling
Spring Boot REST APIs
JPA and Hibernate

Running the Application

  1. Start the backend server
uvicorn app:app --reload --port 8000
  1. Start the frontend (in a new terminal)
streamlit run streamlit_app.py
  1. Access the application

πŸ“ Project Structure

candidate-assessment/
β”œβ”€β”€ app.py                      # FastAPI backend
β”œβ”€β”€ streamlit_app.py           # Streamlit frontend
β”œβ”€β”€ llm.py                     # LLM integration & question generation
β”œβ”€β”€ code_executor.py           # Code execution engine
β”œβ”€β”€ models.py                  # Database models
β”œβ”€β”€ schemas.py                 # Pydantic schemas
β”œβ”€β”€ db.py                      # Database configuration
β”œβ”€β”€ .env                       # Environment variables (not in repo)
β”œβ”€β”€ .gitignore                 # Git ignore rules
β”œβ”€β”€ requirements.txt           # Python dependencies
β”œβ”€β”€ README.md                  # This file
β”œβ”€β”€ reference_topics/          # Topic files for question generation
β”‚   β”œβ”€β”€ apex_mcq_topics.txt
β”‚   β”œβ”€β”€ java_coding_topics.txt
β”‚   └── ...
└── llm_generation.log        # LLM generation logs (auto-generated)

πŸ”§ Configuration

Supported Roles

  • apex - Salesforce Apex
  • react - React.js
  • java - Java Development
  • oic - Oracle Integration Cloud
  • backend - General Backend (default)

Question Limits

  • MCQ per test: 10 questions
  • Coding per test: 3 questions

Modify in app.py:

MCQ_LIMIT = 10
CODING_LIMIT = 3

πŸ“Š Database Schema

Tables

  • Candidate: User information, authorization status
  • Question: Question bank with role-based filtering
  • Test: Test sessions with timestamps
  • Answer: Candidate responses with correctness flags

πŸ”’ Security Considerations

⚠️ Important: This is a development version. For production:

  1. Enable HTTPS/TLS
  2. Implement proper authentication (JWT, OAuth)
  3. Add rate limiting
  4. Sanitize all user inputs
  5. Use proper database credentials
  6. Enable CORS restrictions
  7. Implement API key authentication
  8. Add session management
  9. Use environment-specific configs

πŸ§ͺ Testing

Test the backend

pytest tests/  # (if tests are implemented)

Manual API testing

# Sync candidates
curl -X GET http://localhost:8000/admin/sync-external-candidates

# Generate MCQs
curl -X POST http://localhost:8000/admin/generate-mcq \
  -H "Content-Type: application/json" \
  -d '{"role": "java", "mcq_count": 15}'

πŸ“ API Endpoints

Admin Endpoints

  • GET /admin/sync-external-candidates - Sync candidates
  • GET /admin/candidates - List all candidates
  • POST /admin/authorize - Authorize candidate
  • POST /admin/generate-mcq - Generate MCQ questions
  • POST /admin/generate-coding - Generate coding questions
  • GET /admin/results - View test results
  • GET /admin/logs - View generation logs
  • DELETE /admin/reset - Reset all data

Candidate Endpoints

  • POST /start-test - Start assessment
  • POST /run-code - Execute code snippet
  • POST /submit-answers - Submit test answers

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

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

πŸ› Known Issues

  • Code execution timeout handling needs improvement
  • PDF export for results not yet implemented
  • Email notifications pending
  • Need to add pagination for large candidate lists

πŸ—ΊοΈ Roadmap

  • Add user authentication with JWT
  • Implement email notifications
  • Add PDF report generation
  • Support for more programming languages
  • Advanced analytics dashboard
  • Question difficulty auto-adjustment
  • Proctoring features (webcam, screen monitoring)
  • Mobile responsive design improvements

πŸ“ž Support

For issues and questions:

πŸ™ Acknowledgments

  • FastAPI for the excellent web framework
  • Streamlit for rapid UI development
  • Mistral AI for LLM capabilities
  • SQLAlchemy for ORM functionality

Made with ❀️ for better technical assessments

About

A comprehensive full-stack application for conducting technical assessments with MCQ and coding questions, powered by AI-generated content.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published