Skip to content

About

Talking to yourself in the future

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

28 Commits

Folders and files

Repository files navigation

MyBigBrother

MyBigBrother is a lightweight web app for talking to a future, older-brother-style version of yourself through a simple chat experience.

Live Demo

Production app:

https://mybigbrother.onrender.com

Features

  • 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

Tech Stack

  • Node.js
  • Express
  • JavaScript
  • HTML
  • Tailwind CSS
  • OpenAI API

Project Structure

  • app/pages Static HTML entry points for the app, questionnaire, and score pages
  • app/scripts Frontend JavaScript for chat, questionnaire flow, and UI logic
  • app/styles Tailwind source and compiled CSS files
  • index.js Express server entry point
  • wrapper.js OpenAI wrapper used by the backend routes

Local Development

  1. Clone the repository.

  2. Install dependencies:

    npm install
  3. Create a local .env file from .env.example:

    cp .env.example .env
  4. Add your OpenAI API key to .env:

    OPENAI_API_KEY=your_real_key_here
  5. Build the frontend styles:

    npm run build
  6. Start the app:

    npm start
  7. Open the local app:

    http://localhost:3001
    

Environment Variables

  • OPENAI_API_KEY Required for Bernard chat replies and trait score analysis.
  • PORT Optional. Defaults to 3001 when not set.

Do not commit .env. Secrets should stay local in development and be configured through the hosting platform in production.

Available Scripts

  • npm run build Builds the frontend CSS output.
  • npm run build:css Compiles app/styles/tailwind.css into app/styles/main.css.
  • npm run dev:css Watches and rebuilds Tailwind styles during development.
  • npm run start Starts the Express server.
  • npm run dev Starts the Express server with nodemon.

API Endpoints

POST /api/chat

Accepts JSON like:

{
  "message": "I feel stuck right now."
}

Returns:

{
  "reply": "..."
}

POST /api/trait-scores

Accepts JSON like:

{
  "answers": [4, 5, 3, 2]
}

Returns:

{
  "scores": {}
}

Deployment

  • The app is currently hosted on Render.
  • Production URL: https://mybigbrother.onrender.com
  • Configure environment variables such as OPENAI_API_KEY in Render rather than in tracked files.
  • The server binds to process.env.PORT || 3001 so Render can provide its own port in production.

Security

  • Never commit secrets or real API keys.
  • Keep .env local and out of version control.
  • If a credential is ever exposed, rotate it immediately.

About

Talking to yourself in the future

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages