A mental-health support chatbot web app. Users sign up, log in, and chat with an OpenAI-backed assistant tuned to offer supportive, non-judgmental conversation and point toward mental health resources.
Disclaimer: Buddy Support is a student project, not a medical or crisis service. It does not provide professional advice. If you are in crisis, contact your local emergency number or a crisis line such as 988 (Suicide & Crisis Lifeline, US).
- Chatbot interaction — chat with an assistant prompted to focus on mental health support (
gpt-3.5-turbo). - User accounts — sign up and log in, with passwords hashed using bcrypt.
- Resource pages — static pages linking to mental health information and contact details.
| Layer | Technology |
|---|---|
| Frontend | HTML, CSS, vanilla JS, EJS views |
| Backend | Node.js, Express |
| Database | MongoDB (via Mongoose) |
| AI | OpenAI API |
| Libraries | bcrypt, cors, dotenv, ejs |
The app currently runs as two separate Express processes plus a static frontend:
| Process | Port | Responsibility |
|---|---|---|
src/index.js |
5000 |
Signup/login, EJS views, MongoDB user storage |
server.js |
3000 (or $PORT) |
POST /api/chat proxy to the OpenAI API |
| Static HTML | 5501 |
index.html, chatbot.html, about.html, etc. |
server.js is configured to accept CORS requests from http://localhost:5501, which is the default port used by the VS Code Live Server extension.
- Node.js 18+
- A MongoDB database (local or Atlas)
- An OpenAI API key
-
Clone the repository
git clone https://github.com/gebrilfradj/BuddySupport.git cd BuddySupport -
Install dependencies
npm install
-
Add your OpenAI key
Create a
.envfile in the project root (it is already git-ignored):OPENAI_API_KEY=sk-your-key-here PORT=3000 -
Set your MongoDB connection
Update
MONGODB_URIinsrc/config.jswith your own connection string. -
Start both servers
npm start # chat API on http://localhost:3000 npm run start:auth # auth server on http://localhost:5000
-
Serve the frontend
Open the project in VS Code and start Live Server on port
5501, then browse tohttp://localhost:5501/index.html.
- Sign up or log in from the landing page.
- Open the chatbot page and type a message to talk with Buddy Support.
- Use the linked resources for further information and support.
- The auth server and chat server are not yet unified; a single entry point would simplify setup further.
- Sessions are not persisted after login, so the chatbot page is not gated behind authentication.
- Conversation history is not stored, each message is sent to OpenAI independently.
- Messages are sent to the OpenAI API and are subject to OpenAI's data policies.
No license has been specified yet. Consider adding one if you want others to be able to reuse this code.