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.

PsycheIT is composed of two independent Node.js projects — an Express backend that handles authentication, intent classification, and translation, and a Vite-powered React frontend. This guide walks you through cloning the repository and running both services locally so you can develop and test the full application on your machine.

Prerequisites

Before you begin, make sure the following tools are installed:
  • Node.js ≥ 18
  • npm ≥ 9
  • Git
Node.js 18 or higher is required because the backend uses ES modules ("type": "module" in server/package.json), which have been stable since Node 12 but are best supported from Node 18 onward. Run node -v and npm -v to confirm your versions before proceeding.

Clone the Repository

1

Clone from GitHub

git clone https://github.com/Nandini-13/PsycheIT.git
2

Enter the project directory

cd PsycheIT

Start the Backend

The backend is a plain Node.js process. It must be started before the frontend.
1

Navigate to the server directory

cd server
2

Install dependencies

npm install
This installs Express 5, natural (Naive Bayes classifier), bcryptjs, jsonwebtoken, cors, body-parser, dotenv, and @vitalets/google-translate-api.
3

Start the server

node server.js
On success, the console prints:
Server running on http://localhost:5000
The server listens on port 5000 by default (configurable via the PORT environment variable).

Start the Frontend

Open a new terminal window or tab — the backend process must keep running in the first terminal.
1

Navigate to the frontend directory

cd frontend
2

Install dependencies

npm install
This installs React 19, react-router-dom 7, react-markdown 10, Tailwind CSS 4, and Vite 7.
3

Start the Vite dev server

npm run dev
Vite will print output similar to:
  VITE v7.x.x  ready in Xms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
Open http://localhost:5173 in your browser to use the application.

Verify the Setup

With both services running, confirm the backend is accepting requests by sending a test message to the /classify endpoint:
curl -s -X POST http://localhost:5000/classify \
  -H "Content-Type: application/json" \
  -d '{"message": "I feel anxious and cannot sleep"}'
Expected response:
{
  "intent": "anxiety",
  "classifications": [
    { "label": "anxiety", "value": 0.15 },
    { "label": "sleep", "value": 0.12 },
    { "label": "depression", "value": 0.10 }
  ]
}
The intent field holds the top-level category detected by the Naive Bayes classifier trained in server.js. The classifications array lists the top three scored categories.

Project Structure

Here is the top-level layout of the repository:
PsycheIT/
├── server/          # Express backend
│   ├── server.js    # Entry point
│   ├── package.json
│   └── users.json   # Created automatically on first login
└── frontend/        # Vite + React app
    ├── src/
    │   ├── App.jsx
    │   ├── pages/
    │   ├── features/
    │   └── ...
    └── package.json
Both projects are self-contained — they have separate package.json files, separate node_modules/ directories, and are started independently.
The backend must be running before you open the frontend in your browser. The chatbot page (/chatbot) immediately attempts to reach http://localhost:5000/classify on load. If the backend is not up, the chatbot will silently fail to respond.

Build docs developers (and LLMs) love