Skip to content

Add React + Flask full-stack scaffold#1

Open
Copilot wants to merge 9 commits into
mainfrom
copilot/setup-flask-api-backend
Open

Add React + Flask full-stack scaffold#1
Copilot wants to merge 9 commits into
mainfrom
copilot/setup-flask-api-backend

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 13, 2026

Bootstraps a full-stack app with a React (Vite) frontend and a Flask API backend.

Backend (backend/)

  • Flask API with in-memory item store and four endpoints: GET /api/health, GET /api/items, POST /api/items, DELETE /api/items/:id
  • CORS enabled via flask-cors
  • FLASK_DEBUG env var gates debug mode (off by default)

Frontend (frontend/)

  • Vite-scaffolded React app; Vite dev server proxies /apihttp://localhost:5000
  • App.jsx — list, add, and delete items via the Flask API

Tests

  • Backend: 6 pytest tests covering all endpoints and error cases
  • Frontend: 5 Vitest + React Testing Library tests covering fetch, add, delete, and error state

API

GET    /api/health
GET    /api/items
POST   /api/items        { "name": "..." }
DELETE /api/items/:id

Screenshot

App

Original prompt

React app with a
flask api handling backend calls.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add Flask API to handle backend calls Add React + Flask full-stack scaffold Mar 13, 2026
Copilot AI requested a review from lloydmckie-lang March 13, 2026 01:58
Copy link
Copy Markdown
Owner

@lloydmckie-lang lloydmckie-lang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Work to do , /grumpy

Comment thread backend/app.py
@@ -0,0 +1,54 @@
import os
from flask import Flask, jsonify, request
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/grumpy

@lloydmckie-lang lloydmckie-lang marked this pull request as ready for review March 21, 2026 02:02
Copy link
Copy Markdown
Owner

@lloydmckie-lang lloydmckie-lang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/grumpy

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions github-actions Bot added the spam label Mar 21, 2026
@lloydmckie-lang
Copy link
Copy Markdown
Owner

/repo-ask How does the authentication system work in this project?

@github-actions
Copy link
Copy Markdown

Authentication System in This Project

Short answer: there is no authentication system.

This project is a simple demo app consisting of a Flask API (backend/app.py) and a React UI (frontend/src/App.jsx). After a full search of the codebase, there are no authentication mechanisms present anywhere — no JWT, no sessions, no login/logout, no passwords, no tokens, no role-based access control.

What the API actually does

All endpoints are publicly accessible with no auth checks:

Endpoint Method Description
/api/health GET Health check
/api/items GET List all items
/api/items POST Create an item
/api/items/(id) DELETE Delete an item

Notable security details

  • CORS is enabled globally (CORS(app)) with no origin restrictions, meaning any domain can make requests.
  • State is in-memory only — data resets on server restart and there are no users or credentials stored anywhere.
  • The frontend makes raw fetch() calls with no auth headers or tokens.

If you need to add authentication

Since this is a Flask + React app, common approaches would be:

  • Session-based auth: use Flask-Login + Flask-Session
  • Token-based auth (JWT): use Flask-JWT-Extended on the backend, store the token in localStorage or an httpOnly cookie on the frontend

Currently, none of these patterns are implemented in the project.

Generated by Question Answering Researcher for issue #1 ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-ask.md@d88ca0e8ee2b080fcba4490ac5b657c98a0eb26b

@lloydmckie-lang
Copy link
Copy Markdown
Owner

/grumpy

@lloydmckie-lang
Copy link
Copy Markdown
Owner

/nit

@lloydmckie-lang
Copy link
Copy Markdown
Owner

/pr-fix build backend

@github-actions
Copy link
Copy Markdown

Backend Build CI Fix

In response to /pr-fix build backend, I've prepared changes to add a backend build and test job to the CI workflow.

What was added

A new build-backend job in .github/workflows/build-deploy.yml that:

  • Sets up Python 3.12
  • Installs dependencies from backend/requirements.txt (Flask, flask-cors, pytest)
  • Runs python -m pytest test_app.py -v against the 6 existing backend tests

Diff applied

--- a/.github/workflows/build-deploy.yml
+++ b/.github/workflows/build-deploy.yml
@@ -11,6 +11,30 @@ jobs:
+  build-backend:
+    runs-on: ubuntu-latest
+
+    defaults:
+      run:
+        working-directory: backend
+
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v4
+
+      - name: Set up Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: '3.12'
+          cache: 'pip'
+          cache-dependency-path: backend/requirements.txt
+
+      - name: Install dependencies
+        run: pip install -r requirements.txt
+
+      - name: Run tests
+        run: python -m pytest test_app.py -v
+
   build:

Note: The changes are committed locally to branch copilot/setup-flask-api-backend but could not be pushed automatically due to a missing GITHUB_TOKEN in this workflow run. The diff above can be applied manually to .github/workflows/build-deploy.yml.

Generated by PR Fix for issue #1 ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/pr-fix.md@d88ca0e8ee2b080fcba4490ac5b657c98a0eb26b

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • pypi.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "pypi.org"

See Network Configuration for more information.

@lloydmckie-lang
Copy link
Copy Markdown
Owner

/repo-ask tell me about the endpoints

@github-actions
Copy link
Copy Markdown

API Endpoints

The backend (backend/app.py) exposes four REST endpoints, all prefixed with /api:

Method Path Description
GET /api/health Health check — returns {"status": "ok"}
GET /api/items Fetch all items — returns an array of {id, name} objects
POST /api/items Create an item — requires JSON body {"name": "..."}, returns the new {id, name} with status 201; returns 400 if name is missing
DELETE /api/items/(id) Delete an item by integer ID — returns {"deleted": (id)} or 404 if not found

Notes:

  • State is in-memory only — data resets on server restart (seeded with "Item One" and "Item Two").
  • The frontend calls these via relative /api/* paths; Vite proxies them to `(localhost/redacted) in dev.

Generated by Question Answering Researcher for issue #1 ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-ask.md@d88ca0e8ee2b080fcba4490ac5b657c98a0eb26b

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown

👋 Thanks for the detailed write-up and the included tests — the PR itself is well-structured!

However, this contribution doesn't align with the purpose of this repository. github-agentic-workflows is focused on GitHub agentic workflow definitions; adding a generic React + Flask full-stack scaffold is out of scope for this project.

If you're looking to contribute a new agentic workflow or improvements to the existing UI in src/ui, we'd love to see that — feel free to open an issue to discuss before opening a new PR. 🙏

Generated by Contribution Check ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/contribution-check.md@d88ca0e8ee2b080fcba4490ac5b657c98a0eb26b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants