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’s backend is a lightweight Express server that powers the core intelligence and identity features of the platform. It exposes three REST endpoints: one for classifying free-text student messages into mental health intents using a Naive Bayes NLP classifier, and two for anonymous authentication — letting students create and verify credentials without revealing any personally identifiable information.

Base URL

During local development the server runs on:
http://localhost:5000
In production, the base URL depends on where the server is deployed. Replace http://localhost:5000 with your deployment origin in all examples below.

Content Type

Every request must include the Content-Type: application/json header, and every response body is JSON.

Authentication

The /classify endpoint requires no authentication. Both /signup and /login are public endpoints. /login returns a signed JWT token which the PsycheIT frontend stores in localStorage and uses to protect client-side routes. The API itself does not validate the JWT on any endpoint in the current implementation — token verification is handled entirely on the client side.

Endpoints Summary

MethodPathAuth RequiredDescription
POST/classifyNoClassify a text message into a mental health intent
POST/signupNoGenerate an anonymous userId and password
POST/loginNoVerify credentials and return a JWT token

Error Format

All error responses return HTTP 4xx status codes with a JSON body containing a single error field:
{ "error": "Description of the error" }

Explore the Endpoints

POST /classify

Detect a student’s mental health intent from free-text input using the onboard Naive Bayes classifier.

Auth Endpoints

Generate anonymous credentials with /signup and obtain a JWT session token with /login.

Build docs developers (and LLMs) love