Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Nandini-13/PsycheIT/llms.txt

Use this file to discover all available pages before exploring further.

This guide takes you from zero to a fully running PsycheIT instance on your local machine. By the end you will have the Express backend and Vite development server both running, a verified chatbot response from the NLP classifier, and a working JWT auth token — all in under five minutes.

Prerequisites

Before you begin, make sure the following tools are installed on your machine:
  • Node.js ≥ 18 — nodejs.org
  • npm ≥ 9 — bundled with Node 18+; verify with npm --version
  • Gitgit-scm.com
PsycheIT uses ES Modules ("type": "module") in both the server and the frontend build toolchain. Node 18+ is required for full ESM compatibility and the fetch global used by certain dependencies.

Steps

1

Clone the repository

Clone the PsycheIT monorepo from GitHub and enter the project root.
git clone https://github.com/Nandini-13/PsycheIT.git && cd PsycheIT
The repository contains two top-level directories: server/ (Express backend) and frontend/ (Vite + React app).
2

Install and start the backend

Move into the server/ directory, install dependencies, and start the Express server.
cd server && npm install && node server.js
You should see the following confirmation in your terminal:
Server running on http://localhost:5000
The server also trains the Naive Bayes classifier at startup — this happens synchronously and takes less than a second. Leave this terminal running and open a new one for the next step.
3

Install and start the frontend

From a new terminal tab, move into the frontend/ directory, install dependencies, and launch the Vite dev server.
cd ../frontend && npm install && npm run dev
Vite will print a local URL:
VITE v7.x.x  ready in Xms

➜  Local:   http://localhost:5173/
Open http://localhost:5173 in your browser to see the PsycheIT home page.
4

Test the chatbot API

With the backend running on port 5000, send a message to the /classify endpoint to confirm the NLP classifier is working.
curl -X POST http://localhost:5000/classify \
  -H "Content-Type: application/json" \
  -d '{"message": "I feel anxious before exams"}'
Expected response:
{
  "intent": "anxiety",
  "classifications": [
    { "label": "anxiety", "value": 0.18 },
    { "label": "academic", "value": 0.14 },
    { "label": "general", "value": 0.11 }
  ]
}
The intent field is the top-scoring label. The classifications array contains the top three scored labels with their normalised probability values.
5

Sign up for an anonymous account

PsycheIT uses a college-code-based sign-up flow. Pass your college’s short code and receive a generated userId and a random 8-character password.
curl -X POST http://localhost:5000/signup \
  -H "Content-Type: application/json" \
  -d '{"collegeCode": "SRMIST"}'
Expected response:
{
  "userId": "SRMIST_1712345678901",
  "password": "ab3xk9zq"
}
The /signup endpoint only generates credentials — it does not persist them. The user record is created the first time /login is called with those credentials. Save the userId and password from this response before proceeding.
6

Log in and retrieve your JWT

Use the credentials from the previous step to log in. The server hashes and stores the password on first login, then issues a JSON Web Token valid for one hour.
curl -X POST http://localhost:5000/login \
  -H "Content-Type: application/json" \
  -d '{"userId": "SRMIST_1712345678901", "password": "ab3xk9zq"}'
Expected response:
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJTUk1JU1RfMTcxMjM0NTY3ODkwMSIsImlhdCI6MTcxMjM0NTY3OSwiZXhwIjoxNzEyMzQ5Mjc5fQ.eyJ..."
}
Store this token in localStorage under the key token (which is what the React frontend expects) or include it as a Bearer token in the Authorization header for any protected API requests.

What’s Next

Now that you have PsycheIT running locally, explore the full feature set and the backend API reference.

SHANTI Chatbot

Learn how the Naive Bayes classifier handles all ten intents, how the chatbot responds to high-risk signals, and how to extend the training data.

API Overview

Full reference for the three backend endpoints — /classify, /signup, and /login — including request schemas, response shapes, and error codes.

Build docs developers (and LLMs) love