A small project that analyzes GitHub profiles and (optionally) generates humorous "roasts" using a backend AI/ML service. The repository contains a Next.js frontend template under my-nextjs-template/ and some Python utilities for interacting with the GitHub API.
This README explains the repository layout, how to run the frontend locally, and how to provide or create the missing Flask backend that the frontend expects.
- Frontend:
my-nextjs-template/— Next.js (App Router), TypeScript, Tailwind CSS - Backend: expected under
my-nextjs-template/flask_backend/— Flask (Python). Note: the Flask application files are not checked into this repo; only avenv/folder is present. See "Backend — missing files" below. - Utilities:
main.pyandgithub_api.py— small Python scripts that use PyGithub to fetch GitHub profile data.
main.py— CLI example that fetches GitHub profile data (requiresGITHUB_TOKEN).github_api.py— alternative script to fetch GitHub data.my-nextjs-template/package.json— frontend package manifest and scripts (dev,build,start,lint).my-nextjs-template/PROJECT_SETUP.md— detailed project notes and setup instructions (read this when setting up the backend).my-nextjs-template/src/— Next.js app code (components, API routes, services).src/services/api.ts— client-side service that expects a Flask backend atNEXT_PUBLIC_FLASK_API_URL(defaulthttp://localhost:5000).src/app/api/roast/route.tsandsrc/app/api/health/route.ts— Next.js API routes that proxy to the Flask backend.
- The frontend code is present and runnable. It expects a Flask backend exposing endpoints like
/api/roast,/api/profile/:username, and/healthathttp://localhost:5000by default. - The expected
my-nextjs-template/flask_backend/folder in this repo does not contain the Flask app source files (there's only avenv/directory). That means the backend must be added or re-created before the full application (frontend+backend) can work.
These commands are for Windows PowerShell (your default shell). From the repository root:
cd .\my-nextjs-template
npm install
npm run devThe frontend will run on http://localhost:3000 by default.
Environment variables used by the frontend
- NEXT_PUBLIC_FLASK_API_URL — URL for the Flask backend (default:
http://localhost:5000).
You can create a .env.local file in my-nextjs-template/ with:
NEXT_PUBLIC_FLASK_API_URL=http://localhost:5000
The repository's documentation (PROJECT_SETUP.md) expects a Flask backend at my-nextjs-template/flask_backend/ with app.py and requirements.txt. However, those files are not present in the repository (only a venv/ folder exists). You have three options:
-
If you have the original backend elsewhere, copy the Flask app files into
my-nextjs-template/flask_backend/. -
Recreate a minimal Flask backend using the interface the frontend expects. Example minimal server outline (create
my-nextjs-template/flask_backend/app.py):
from flask import Flask, request, jsonify
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
@app.route('/health', methods=['GET'])
def health():
return jsonify({ 'status': 'ok', 'model_loaded': False, 'github_token_set': False })
@app.route('/api/roast', methods=['POST'])
def roast():
payload = request.get_json() or {}
username = payload.get('username')
# TODO: implement GitHub fetch + AI roast generation
return jsonify({ 'success': True, 'roast': f"(stub) Roast for {username}" })
@app.route('/api/profile/<username>', methods=['GET'])
def profile(username):
# TODO: return GitHub profile data
return jsonify({ 'success': True, 'profile': { 'username': username } })
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=True)- Use the
PROJECT_SETUP.mdinsidemy-nextjs-template/as guidance — it contains sample commands and notes about required Python packages (e.g., Flask, flask-cors, PyGithub, python-dotenv). Create arequirements.txtwith packages you need.
Example requirements.txt to start with:
Flask>=2.0
flask-cors
PyGithub
python-dotenv
Run the backend (PowerShell):
cd .\my-nextjs-template\flask_backend
python -m venv venv
. .\venv\Scripts\Activate.ps1
pip install -r requirements.txt
python app.pyNote: if app.py and requirements.txt are missing, create them (see option 2).
main.py and github_api.py are small scripts that use a GitHub personal access token. Set the token in your environment or in a .env file (use python-dotenv):
Environment variable name: GITHUB_TOKEN (or GH_TOKEN).
Run main.py from PowerShell:
python .\main.pyFollow the prompt to enter a GitHub username.
- The frontend proxies certain API routes to the Flask backend. If you don't run a backend, some front-end features (generate roast, view profile details) will show an error or fallback messaging.
- The repository contains helpful docs inside
my-nextjs-template/PROJECT_SETUP.mdand design notes inDESIGN_SYSTEM.mdandROAST_OPTIONS.md. Read them for implementation details. - The
my-nextjs-templatefrontend uses Next.js 15 and React 19 perpackage.json. - The Flask backend is intentionally minimal in the template; it's expected you will integrate your own AI model or call out to an external API (Gemini, OpenAI, etc.) to generate the roast.
- I inspected
main.py,github_api.py,my-nextjs-template/package.json,my-nextjs-template/PROJECT_SETUP.md, and key Next.js source files (src/app/layout.tsx,src/services/api.ts) to determine run scripts, expected endpoints, and environment variables. - I confirmed the frontend is runnable with
npm run devand that the backend files referenced in docs are not present in the repo.
- Add or restore the Flask backend source files to
my-nextjs-template/flask_backend/(app.py, requirements.txt, any model code). - Add a
flask_backend/README.mdexplaining backend endpoints and environment variables. - Consider adding a minimal automated test (frontend health check + backend stub) to simplify onboarding.
If you want, I can: create a minimal app.py and requirements.txt in my-nextjs-template/flask_backend/ (stub endpoints) and wire it up so the whole project runs end-to-end locally — tell me if you'd like that and I'll add the files and run quick validation.