Skip to content

soaravant/IntelliQ

Repository files navigation

IntelliQ - Intelligent Questionnaire System

A modern web application for creating and managing intelligent questionnaires, built with React and Node.js, deployed on Vercel.

Features

  • 📝 Create and manage questionnaires
  • 🎯 Dynamic question flow based on answers
  • 📊 Session tracking and answer collection
  • 🎨 Modern, responsive UI
  • ☁️ Serverless deployment on Vercel

Project Structure

IntelliQ/
├── api/                          # Vercel serverless functions
│   ├── questionnaire/            # Questionnaire endpoints
│   ├── question/                 # Question endpoints
│   ├── doanswer/                 # Answer submission endpoints
│   ├── getsessionanswers/        # Session answer retrieval
│   ├── getquestionanswers/       # Question answer retrieval
│   └── questionnaires.js         # List all questionnaires
├── frontend/                     # React frontend application
│   ├── src/
│   │   └── components/           # React components
│   ├── public/                   # Static assets
│   └── package.json
├── api-backend/                  # Original Express backend (for reference)
├── database/                     # Database schema and setup
├── vercel.json                   # Vercel deployment configuration
└── package.json                  # Root package configuration

Deployment on Vercel

Prerequisites

  1. A Vercel account
  2. A MySQL database (can use PlanetScale, Railway, or any MySQL provider)
  3. Git repository with this code

Environment Variables

Set these environment variables in your Vercel project:

DB_HOST=your-database-host
DB_USER=your-database-username
DB_PASSWORD=your-database-password
DB_NAME=intelliq
NODE_ENV=production

Database Setup

  1. Create a MySQL database named intelliq
  2. Import the SQL schema from database/intelliq .sql
  3. Update the environment variables with your database credentials

Deployment Steps

  1. Fork or clone this repository

    git clone <your-repo-url>
    cd IntelliQ
  2. Install dependencies

    npm run install:all
  3. Deploy to Vercel

    # Install Vercel CLI
    npm i -g vercel
    
    # Deploy
    vercel
  4. Set environment variables in Vercel dashboard

    • Go to your project settings
    • Add the database environment variables
    • Redeploy if necessary

Local Development

  1. Install dependencies

    npm run install:all
  2. Set up local database

    • Install MySQL locally
    • Create database intelliq
    • Import database/intelliq .sql
  3. Start development servers

    npm run dev

API Endpoints

Questionnaires

  • GET /api/questionnaires - Get all questionnaires
  • GET /api/questionnaire/[questionnaireID] - Get questionnaire details

Questions

  • GET /api/question/[questionnaireID]/[questionID] - Get question details

Answers

  • POST /api/doanswer/[questionnaireID]/[questionID]/[session] - Create new session
  • POST /api/doanswer/[questionnaireID]/[questionID]/[session]/[optionID] - Submit answer

Analytics

  • GET /api/getsessionanswers/[questionnaireID]/[session] - Get session answers
  • GET /api/getquestionanswers/[questionnaireID]/[questionID] - Get question statistics

Technology Stack

  • Frontend: React 18, React Router, Axios
  • Backend: Vercel Serverless Functions, Node.js
  • Database: MySQL
  • Deployment: Vercel
  • Styling: Custom CSS

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

MIT License - see LICENSE file for details

About

IntelliQ questionnaire application

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors