MyBigBrother is a lightweight web app for talking to a future, older-brother-style version of yourself through a simple chat experience.
Production app:
https://mybigbrother.onrender.com
- Chat with Bernard, a future-self guide
- Bernard replies through an OpenAI-backed backend wrapper
- Questionnaire-driven trait, emotion, and score analysis
- Tailwind-based frontend styling with plain HTML, CSS, and JavaScript
- Express backend serving both the frontend and API routes
- Node.js
- Express
- JavaScript
- HTML
- Tailwind CSS
- OpenAI API
app/pagesStatic HTML entry points for the app, questionnaire, and score pagesapp/scriptsFrontend JavaScript for chat, questionnaire flow, and UI logicapp/stylesTailwind source and compiled CSS filesindex.jsExpress server entry pointwrapper.jsOpenAI wrapper used by the backend routes
-
Clone the repository.
-
Install dependencies:
npm install
-
Create a local
.envfile from.env.example:cp .env.example .env
-
Add your OpenAI API key to
.env:OPENAI_API_KEY=your_real_key_here
-
Build the frontend styles:
npm run build
-
Start the app:
npm start
-
Open the local app:
http://localhost:3001
OPENAI_API_KEYRequired for Bernard chat replies and trait score analysis.PORTOptional. Defaults to3001when not set.
Do not commit .env. Secrets should stay local in development and be configured through the hosting platform in production.
npm run buildBuilds the frontend CSS output.npm run build:cssCompilesapp/styles/tailwind.cssintoapp/styles/main.css.npm run dev:cssWatches and rebuilds Tailwind styles during development.npm run startStarts the Express server.npm run devStarts the Express server withnodemon.
Accepts JSON like:
{
"message": "I feel stuck right now."
}Returns:
{
"reply": "..."
}Accepts JSON like:
{
"answers": [4, 5, 3, 2]
}Returns:
{
"scores": {}
}- The app is currently hosted on Render.
- Production URL: https://mybigbrother.onrender.com
- Configure environment variables such as
OPENAI_API_KEYin Render rather than in tracked files. - The server binds to
process.env.PORT || 3001so Render can provide its own port in production.
- Never commit secrets or real API keys.
- Keep
.envlocal and out of version control. - If a credential is ever exposed, rotate it immediately.