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 keeps account creation frictionless and anonymous. All you need is your college code — no email, no personal details. In under a minute you will have a unique userId and password that unlocks the dashboard, AI chatbot, peer forum, and every other tool on the platform.

Signing Up

1

Navigate to the auth page

Open your browser and go to /auth. You will see the Create Account panel by default.
2

Enter your college code

Type your institution’s short code into the College Code field — for example SRMIST, IIT, or BITS. This is the only piece of information PsycheIT needs.
3

Generate your credentials

Click Generate Credentials. The server calls POST /signup, creates a userId in the format {collegeCode}_{timestamp} (e.g., SRMIST_1712345678901), and generates a random 8-character alphanumeric password. Both are returned to the browser and displayed on screen.
4

Save your userId and password immediately

Copy and store your credentials in a safe place before leaving this page. PsycheIT has no email-based recovery flow — if you lose your userId or password, the account cannot be recovered. A password manager or a secure note works well.

Logging In

1

Navigate to the auth page

Go to /auth directly, or you will be redirected there automatically when you try to visit any protected route such as /dashboard.
2

Switch to the login tab and enter your credentials

Click “Already have an account? Sign in” to switch to the login form. Enter the User ID and Password you saved during sign-up. If you just signed up, the form may have been auto-filled for you.
3

Click Sign In

Click Sign In. On your first login the server bcrypt-hashes your password and saves it alongside your userId. On subsequent logins it verifies your password against the stored hash. Either way, a successful authentication returns a JWT and you are redirected to /dashboard.

Token Lifecycle

After a successful login the server returns a JWT signed with { userId } in its payload, expiring in 1 hour. The frontend stores it in localStorage under the key token:
localStorage.setItem("token", data.token);
Once the token expires, the next time you navigate to a protected route the ProtectedRoute component will find no valid token and redirect you back to /auth. To read the userId from the token on the dashboard, the frontend decodes the payload directly in the browser:
const payload = JSON.parse(atob(token.split('.')[1]));
console.log(payload.userId); // e.g. "SRMIST_1712345678901"

Logging Out

The dashboard includes a Logout button. Clicking it removes the token from localStorage and redirects to /auth:
localStorage.removeItem('token');
navigate('/auth');
No server-side session is invalidated (tokens are stateless), so the token technically remains valid until its 1-hour expiry — another reason to keep the JWT secret strong and the expiry window short.

API Reference & curl Examples

Sign Up

curl -X POST http://localhost:5000/signup \
  -H "Content-Type: application/json" \
  -d '{"collegeCode": "SRMIST"}'
Expected response:
{
  "userId": "SRMIST_1712345678901",
  "password": "ab3xk9zq"
}
Returns 400 if collegeCode is missing:
{ "error": "College code required" }

Log In

curl -X POST http://localhost:5000/login \
  -H "Content-Type: application/json" \
  -d '{"userId": "SRMIST_1712345678901", "password": "ab3xk9zq"}'
Expected response:
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJTUk1JU1RfMTcxMjM0NTY3ODkwMSIsImlhdCI6MTcxMjM0NTY3OSwiZXhwIjoxNzEyMzQ5Mjc5fQ.example"
}
Returns 400 if either field is missing, and 401 if the password does not match:
{ "error": "Invalid password" }
There is no password-reset or account-recovery mechanism in PsycheIT. Store your userId and password in a password manager or another secure location as soon as they are generated — they cannot be retrieved or reissued.

Build docs developers (and LLMs) love