Skip to content

waymbers/AITA

Repository files navigation

AITA

This repository contains a React frontend (Vite + Tailwind) and a small Node/Express proxy to securely call the Gemini API.

Structure

  • / - React app (Vite) — frontend
  • /gemini-proxy - Node/Express backend proxy that forwards client requests to the Gemini API

Quick local run (frontend)

  1. cd into the frontend and install dependencies:

    cd E:/aita-pro npm install

  2. Start the dev server:

    npm run dev

Quick local run (proxy)

  1. cd into the proxy folder and install dependencies:

    cd E:/aita-pro/gemini-proxy npm install

  2. Create a .env file with your Gemini key:

    GEMINI_API_KEY=your_key_here

  3. Start the proxy:

    npm start

Deployment notes (Render)

  • Option A: Deploy the gemini-proxy folder as a service using the "Deploy from a subdirectory" option in Render. Set the start command to:

    cd gemini-proxy && npm install && npm start

Render (detailed)

  1. Create a new Web Service in Render and connect your GitHub repo waymbers/AITA.

  2. In the Service settings set:

    • Branch: main
    • Root Directory: gemini-proxy (important)
    • Build Command: npm install
    • Start Command: npm start
    • Environment: set GEMINI_API_KEY to your Gemini secret (do NOT commit this to GitHub)
    • Port: leave default (Render will set PORT env var); the proxy reads process.env.PORT automatically.
  3. Deploy. If you prefer not to use Root Directory, set these instead:

    • Build Command: cd gemini-proxy && npm install
    • Start Command: cd gemini-proxy && npm start
  4. Once deployed, note the service URL (e.g. https://<your-service>.onrender.com). Use this in the frontend production env:

    VITE_GEMINI_PROXY=https://.onrender.com/api/gemini

    If you enabled PROXY_SECRET on the proxy (recommended), the frontend must send the same secret in the header x-proxy-key. Set the frontend build environment variable to:

     VITE_PROXY_KEY=<your-proxy-secret>
    

    Do NOT commit VITE_PROXY_KEY to git; set it only in your hosting provider's environment configuration (e.g. Vercel / Netlify / Render).

Troubleshooting

  • If Render logs show MODULE_NOT_FOUND, it means Render ran npm start in the wrong directory or node_modules weren't installed in the gemini-proxy folder. Use the Root Directory option or the cd gemini-proxy && ... commands above.

  • If you see Missing GEMINI_API_KEY errors, confirm the environment variable is set in Render.

  • Option B: Deploy the gemini-proxy as its own repository (recommended) and set the start command to npm install && npm start.

Security

  • Never store API keys in the frontend. Use the proxy to keep secrets server-side.

If you want, I can add a small README inside gemini-proxy with exact start commands and a Render-ready start script.

About

Am I The Asshole can settle the dispute and present compelling metrics and stats all from a single conversations/arguments to determine "AITA

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages