Skip to content

[API] Flask REST API + PostgreSQL database schema #3

@Vishnu2707

Description

@Vishnu2707

Objective

Build the Flask REST API and PostgreSQL database layer that serves
findings data to the frontend dashboard.

Tasks

  • api/app.py — Flask app factory, blueprints, CORS, JWT middleware
  • api/models/finding.py — Finding model + DatabaseManager class
  • api/routes/findings.py — GET /api/findings, GET /api/findings/
  • api/routes/scans.py — GET /api/scans, POST /api/scans/trigger
  • api/routes/score.py — GET /api/score
  • api/routes/compliance.py — GET /api/compliance/
  • Deploy to Render free tier (render.com)
  • Connect to PostgreSQL via Render free PostgreSQL instance

Database schema

findings (id, rule_id, severity, resource_id, resource_name, created_at, status)
rules (rule_id, name, severity, category, description, frameworks)
scans (id, subscription_id, started_at, completed_at, finding_count)

Acceptance Criteria

  • All API routes return correct JSON
  • JWT authentication working
  • Deployed live on Render free tier
  • Connected to PostgreSQL

Branch

feat/flask-api

Depends on

Issue #1 must be merged to dev first

Metadata

Metadata

Assignees

Labels

coreCore team ownership not for students

Type

No type
No fields configured for issues without a type.

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions