08Software Engineering

AI Requirements Generator

A full-stack Software Engineering coursework project that automates requirements gathering using AI. FastAPI backend exposes a /generate-requirements endpoint; React/Vite frontend lets users input a system description and instantly generates SRS-ready functional requirements.

FastAPIPythonReactVitePydanticCORSJavaScript
View on GitHub
2
Stack Layers
REST
API Design
SRS
Output Format
type
Software Engineering
status
Completed
year
2024
role
Solo Developer
01

System Architecture · 3D View

02

Architecture Diagram

React UI
App.jsx · Vite · Port 5173
System Description
User Text Input
HTTP POST
fetch() · JSON body
CORS Middleware
FastAPI · Port 8000
/generate-reqs
POST endpoint
Pydantic Model
RequirementInput/Output
AI Generator
Requirements Engine
SRS Output
List[str] Requirements
03

Screenshots & Output

terminal
$ uvicorn main:app --reload --port 8000
INFO: Uvicorn running on http://127.0.0.1:8000
POST /generate-requirements HTTP/1.1
→ RequirementInput validated ✓
→ The system shall allow users to sign up.
→ The system shall allow users to log in.
→ The system shall generate requirements using AI.
200 OK · RequirementOutput: List[str] returned
API Terminal
FastAPI server and endpoint logs
Output Quality
API Design92%
Type Safety95%
SRS Compliance88%
CORS Setup100%
Frontend UI80%
Output Quality
Requirements generation metrics
Data Output
{
# POST /generate-requirements response
requirements: [
  The system shall allow users to sign up.,
  The system shall allow users to log in.,
  The system shall generate requirements using AI.
],
# Pydantic: input=str, output=List[str]
}
API Response
JSON requirements output
Project Structure
📁 ai-srs-generator/
├─ backend/
│ └─ main.py FastAPI · Pydantic · CORS
├─ frontend/
│ ├─ src/App.jsx React · useState
│ └─ vite.config.js Port 5173
└─ requirements.txt fastapi · uvicorn
Project Files
Full-stack file structure
04

What I Built

Built FastAPI backend (main.py) with a POST /generate-requirements endpoint accepting free-text system descriptions via Pydantic BaseModel validation.

Designed React/Vite frontend (App.jsx) that sends user input to the FastAPI backend and renders AI-generated SRS requirements in real-time.

Configured CORS middleware to enable local cross-origin communication between Vite dev server (port 5173) and FastAPI backend.

Structured response model (RequirementOutput) returning a typed List[str] of formal requirements following SRS conventions.

Applied Software Engineering principles: separation of concerns, typed API contracts, stateless REST design, and iterative requirement generation.

Built as coursework for Software Engineering subject — demonstrates understanding of full-stack architecture, API design, and AI-assisted SRS generation.

05

Project Insights

Personal Notes & Learnings
Markdown Editor
Live Preview

Course Context

Built for Software Engineering coursework at Lawrence Technological University. The goal was to apply SE principles — requirements engineering, API design, separation of concerns — in a working system.

Real Code Details

Backend (main.py — FastAPI)

  • RequirementInput: Pydantic model with single text: str field
  • RequirementOutput: Pydantic model with requirements: List[str]
  • POST /generate-requirements: accepts system description, returns SRS requirements
  • CORS configured for http://localhost:5173 (Vite default port)
  • GET / health check endpoint

Frontend (App.jsx — React + Vite)

  • React functional component with useState hook
  • Sends POST request to FastAPI with user text
  • Renders generated requirements as a formatted list

SE Principles Applied

  • Separation of concerns: backend handles logic, frontend handles UI
  • Typed contracts: Pydantic enforces input/output schema
  • Stateless REST: each request is independent
  • Iterative development: prototype → working API → UI integration
✓ Insights saved locally