diff --git a/.gitignore b/.gitignore
index 3557e5d..06125d6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -189,3 +189,4 @@ gradle-app.setting
/.vs/
node_modules/
+.env
diff --git a/GroupFive/__init__.py b/GroupFive/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/GroupFive/admin.py b/GroupFive/admin.py
new file mode 100644
index 0000000..8c38f3f
--- /dev/null
+++ b/GroupFive/admin.py
@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.
diff --git a/GroupFive/apps.py b/GroupFive/apps.py
new file mode 100644
index 0000000..8220433
--- /dev/null
+++ b/GroupFive/apps.py
@@ -0,0 +1,6 @@
+from django.apps import AppConfig
+
+
+class OurApplicationConfig(AppConfig):
+ default_auto_field = 'django.db.models.BigAutoField'
+ name = 'GroupFive'
diff --git a/GroupFive/dummy_analysis.py b/GroupFive/dummy_analysis.py
new file mode 100644
index 0000000..992ba89
--- /dev/null
+++ b/GroupFive/dummy_analysis.py
@@ -0,0 +1,13 @@
+
+def run_dummy(code, language):
+
+ return {
+ "summary" : "this dummy code is better than yours",
+ "findings" : [
+ {
+ "severity" : "Minimal",
+ "description" : "Bad code",
+ "fix" : "Figure it Out"
+ }
+ ]
+ }
\ No newline at end of file
diff --git a/GroupFive/migrations/0001_initial.py b/GroupFive/migrations/0001_initial.py
new file mode 100644
index 0000000..b8f9b01
--- /dev/null
+++ b/GroupFive/migrations/0001_initial.py
@@ -0,0 +1,30 @@
+# Generated by Django 5.0.3 on 2026-02-18 09:51
+
+import django.db.models.deletion
+import uuid
+from django.conf import settings
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='AnalysisTask',
+ fields=[
+ ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
+ ('input_code', models.TextField()),
+ ('language', models.CharField(max_length=50)),
+ ('status', models.CharField(choices=[('QUEUED', 'Queued'), ('RUNNING', 'Running'), ('COMPLETED', 'Completed'), ('FAILED', 'Failed')], max_length=20)),
+ ('results', models.JSONField(blank=True, null=True)),
+ ('created_at', models.DateTimeField(auto_now_add=True)),
+ ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
+ ],
+ ),
+ ]
diff --git a/GroupFive/migrations/__init__.py b/GroupFive/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/GroupFive/models.py b/GroupFive/models.py
new file mode 100644
index 0000000..f6f0ea7
--- /dev/null
+++ b/GroupFive/models.py
@@ -0,0 +1,21 @@
+#all id related lines are noted and can be deleted or changed if user id is skipped or substituted
+import uuid #for user ID
+from django.db import models
+from django.contrib.auth.models import User
+
+class AnalysisTask(models.Model):
+ #potential review request statuses
+ STATUS_OPT = [
+ ("QUEUED", "Queued"),
+ ("RUNNING", "Running"),
+ ("COMPLETED", "Completed"),
+ ("FAILED", "Failed")
+ ]
+
+ id = models.UUIDField(primary_key=True, default=uuid.uuid4) #more user id
+ user = models.ForeignKey(User, on_delete=models.CASCADE) #user id/user
+ input_code = models.TextField() #user provided code
+ language = models.CharField(max_length=50) #language of user provided code
+ status = models.CharField(max_length=20, choices=STATUS_OPT) #status of review request
+ results = models.JSONField(null=True, blank=True) #results of review
+ created_at = models.DateTimeField(auto_now_add=True) #creation timestamp
diff --git a/GroupFive/serializers.py b/GroupFive/serializers.py
new file mode 100644
index 0000000..255c15e
--- /dev/null
+++ b/GroupFive/serializers.py
@@ -0,0 +1,7 @@
+#this file uses serializers to define what information we add to our AnalysisTask model from user
+from rest_framework import serializers
+
+class AnalysisRequestSerializer(serializers.Serializer):
+ code = serializers.CharField() #for input code
+ #language definition of input code, can be commented out if language distinction added later
+ language = serializers.CharField()
diff --git a/GroupFive/tasks.py b/GroupFive/tasks.py
new file mode 100644
index 0000000..24c186e
--- /dev/null
+++ b/GroupFive/tasks.py
@@ -0,0 +1,22 @@
+#from celery import shared_task #task queue to handle simultaneous requests, making testing annoying for now can readd later when necessary
+from GroupFive.models import AnalysisTask
+from .dummy_analysis import run_dummy
+
+#@shared_task --from celery, readd later
+def run_analysis_async(task_id):
+
+ #instance of analysisTask
+ task = AnalysisTask.objects.get(id=task_id)
+ task.status = "RUNNING" #update status
+ task.save() #save instance task
+
+ try:
+ #call ai api rather than dummy
+ results = run_dummy(task.input_code, task.language)
+
+ task.results = results #store results
+ task.status = "COMPLETED" #update status
+ except Exception(BaseException) as e:
+ task.status = "FAILED"
+
+ task.save()
\ No newline at end of file
diff --git a/GroupFive/tests.py b/GroupFive/tests.py
new file mode 100644
index 0000000..5f5da37
--- /dev/null
+++ b/GroupFive/tests.py
@@ -0,0 +1,60 @@
+from rest_framework.test import APITestCase
+from django.contrib.auth.models import User
+from rest_framework import status
+from .models import *
+from uuid import uuid4
+
+
+class InitialAnalysisTests(APITestCase):
+
+ def setUp(self):
+ #create user
+ self.User = User.objects.create_user(
+ username="username",
+ password="password"
+ )
+ self.client.login(username="username", password="password")
+
+ def test_create_analysisTask(self):
+
+ response = self.client.post("/api/GroupFive/",{
+ "code" : "print('Hello World')", #code to analyze
+ "language" : "Python" #language of code
+ }, format="json")
+
+ self.assertEqual(response.status_code, status.HTTP_200_OK)
+ self.assertIn("task_id", response.data) #task_id in data
+ self.assertEqual(response.data["status"], "QUEUED")
+
+class InitialWorkflowTest(APITestCase):
+
+ def setUp(self):
+ #create user
+ self.User = User.objects.create_user(
+ username="username",
+ password="password"
+ )
+ self.client.login(username="username", password="password")
+
+ def test_initial_workflow(self):
+ response = self.client.post("/api/GroupFive/",{
+ "code" : "print('Hello Again')", #code to analyze
+ "language" : "Python" #language of code
+ }, format="json")
+
+ self.assertEqual(response.status_code, status.HTTP_200_OK)
+
+ task_id = response.data["task_id"]
+
+ task = AnalysisTask.objects.get(id=task_id)
+
+ #confirm that dummy ran
+ self.assertEqual(task.status, "COMPLETED")
+
+ result_response = self.client.get(f"/api/GroupFive/{task_id}")
+
+ #ensure task endpoint
+ self.assertEqual(result_response.status_code, 200)
+
+
+
diff --git a/GroupFive/views.py b/GroupFive/views.py
new file mode 100644
index 0000000..01cfa8e
--- /dev/null
+++ b/GroupFive/views.py
@@ -0,0 +1,42 @@
+#all id related lines are noted and can be deleted or changed if user id is skipped or substituted
+from rest_framework.views import APIView
+from rest_framework.response import Response
+from rest_framework.permissions import IsAuthenticated #for user id
+from GroupFive.models import AnalysisTask
+from GroupFive.serializers import AnalysisRequestSerializer
+from .tasks import run_analysis_async
+
+
+#analysis task endpoint
+class AnalysisView(APIView):
+ permission_classes = [IsAuthenticated]
+
+ def post(self, request):
+ serializer = AnalysisRequestSerializer(data=request.data)
+ serializer.is_valid(raise_exception=True) #deserialize, check correct input and format, raises 400 Bad Request on fail
+
+ task = AnalysisTask.objects.create(
+ user=request.user, #user
+ input_code=serializer.validated_data["code"],
+ language=serializer.validated_data["language"],
+ status="QUEUED"
+ )
+
+ run_analysis_async(str(task.id))
+
+ return Response({
+ "task_id": str(task.id),
+ "status": task.status
+ })
+
+#status endpoint
+class StatusView(APIView):
+ permission_classes = [IsAuthenticated]
+
+ def get(self, request, task_id):
+ task = AnalysisTask.objects.get(id=task_id, user=request.user) #user
+
+ return Response({
+ "status": task.status,
+ "summary": task.results if task.status == "COMPLETED" else None
+ })
\ No newline at end of file
diff --git a/ai_payload.json b/ai_payload.json
new file mode 100644
index 0000000..92b3004
--- /dev/null
+++ b/ai_payload.json
@@ -0,0 +1,103 @@
+{
+ "schema": "ai_payload_v1",
+ "project_id": "121d4d1ff944c1642e8901fe9689b26811561e8437fe55d499cf4a9708c67e7d",
+ "input_path": "/Users/zhangtingen/Downloads/V/testquery.py",
+ "input_type": "file",
+ "pipeline_version": "1.0.0",
+ "normalized_findings": [
+ {
+ "finding_id": "F-001",
+ "issue_type": "database_access_heuristic",
+ "title": "Database Access Pattern Detected",
+ "severity": "low",
+ "confidence": "low",
+ "finding_status": "review_needed",
+ "source_file": "testquery.py",
+ "evidence": [
+ {
+ "line": 0,
+ "category": "database_access",
+ "snippet": "heuristic"
+ }
+ ],
+ "analysis_limitations": [
+ "Heuristic only; line may be 0 when matched on whole file."
+ ]
+ },
+ {
+ "finding_id": "F-002",
+ "issue_type": "sql_execution_review",
+ "title": "SQL Execution Present — Review for Injection / Unsafe Queries",
+ "severity": "medium",
+ "confidence": "medium",
+ "finding_status": "review_needed",
+ "source_file": "testquery.py",
+ "evidence": [
+ {
+ "line": 7,
+ "category": "sql_execution",
+ "snippet": "result = conn.execute(text(\"SELECT NOW();\"))"
+ },
+ {
+ "line": 13,
+ "category": "sql_execution",
+ "snippet": "#conn.execute(text(\"INSERT INTO users(email, password_hash) VALUES ('test2@example.com', '1A2B3C');\"))"
+ },
+ {
+ "line": 14,
+ "category": "sql_execution",
+ "snippet": "result = conn.execute(text(\"SELECT * FROM users;\"))"
+ }
+ ]
+ },
+ {
+ "finding_id": "F-003",
+ "issue_type": "potential_sensitive_data_exposure_via_debug_output",
+ "title": "Potential Sensitive Data Exposure via Debug Output",
+ "severity": "medium",
+ "confidence": "medium",
+ "finding_status": "review_needed",
+ "source_file": "testquery.py",
+ "evidence": [
+ {
+ "line": 8,
+ "category": "debug_output",
+ "snippet": "print(\"Connected! Server time:\", result.fetchone()[0])"
+ },
+ {
+ "line": 10,
+ "category": "debug_output",
+ "snippet": "print(\"Connection failed:\", e)"
+ },
+ {
+ "line": 15,
+ "category": "debug_output",
+ "snippet": "print(result.fetchall())"
+ }
+ ],
+ "analysis_limitations": [
+ "Cannot determine if printed data contains sensitive fields without data flow analysis."
+ ]
+ },
+ {
+ "finding_id": "F-004",
+ "issue_type": "broad_exception_handling",
+ "title": "Broad Exception Handling",
+ "severity": "low",
+ "confidence": "medium",
+ "finding_status": "review_needed",
+ "source_file": "testquery.py",
+ "evidence": [
+ {
+ "line": 9,
+ "category": "broad_except",
+ "snippet": "except Exception as e:"
+ }
+ ]
+ }
+ ],
+ "meta": {
+ "finding_count": 4,
+ "note": "Full source lives in preprocess output only; fetch by file_id/chunk_id if needed."
+ }
+}
\ No newline at end of file
diff --git a/config/__init__.py b/config/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/config/asgi.py b/config/asgi.py
new file mode 100644
index 0000000..39149a0
--- /dev/null
+++ b/config/asgi.py
@@ -0,0 +1,16 @@
+"""
+ASGI config for config project.
+
+It exposes the ASGI callable as a module-level variable named ``application``.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/
+"""
+
+import os
+
+from django.core.asgi import get_asgi_application
+
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
+
+application = get_asgi_application()
diff --git a/config/settings.py b/config/settings.py
new file mode 100644
index 0000000..4a3bd85
--- /dev/null
+++ b/config/settings.py
@@ -0,0 +1,125 @@
+"""
+Django settings for config project.
+
+Generated by 'django-admin startproject' using Django 5.0.3.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/5.0/topics/settings/
+
+For the full list of settings and their values, see
+https://docs.djangoproject.com/en/5.0/ref/settings/
+"""
+
+from pathlib import Path
+
+# Build paths inside the project like this: BASE_DIR / 'subdir'.
+BASE_DIR = Path(__file__).resolve().parent.parent
+
+
+# Quick-start development settings - unsuitable for production
+# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
+
+# SECURITY WARNING: keep the secret key used in production secret!
+SECRET_KEY = 'django-insecure-y+j3zht6sr%!!2fg0&-ek^21&)yc+y+5a*-ly+@16$8$px)a$@'
+
+# SECURITY WARNING: don't run with debug turned on in production!
+DEBUG = True
+
+ALLOWED_HOSTS = []
+
+
+# Application definition
+
+INSTALLED_APPS = [
+ 'django.contrib.admin',
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.messages',
+ 'django.contrib.staticfiles',
+ 'GroupFive',
+ 'rest_framework'
+]
+
+MIDDLEWARE = [
+ 'django.middleware.security.SecurityMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.common.CommonMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',
+]
+
+ROOT_URLCONF = 'config.urls'
+
+TEMPLATES = [
+ {
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ 'DIRS': [],
+ 'APP_DIRS': True,
+ 'OPTIONS': {
+ 'context_processors': [
+ 'django.template.context_processors.debug',
+ 'django.template.context_processors.request',
+ 'django.contrib.auth.context_processors.auth',
+ 'django.contrib.messages.context_processors.messages',
+ ],
+ },
+ },
+]
+
+WSGI_APPLICATION = 'config.wsgi.application'
+
+
+# Database
+# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': BASE_DIR / 'db.sqlite3',
+ }
+}
+
+
+# Password validation
+# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
+
+AUTH_PASSWORD_VALIDATORS = [
+ {
+ 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
+ },
+]
+
+
+# Internationalization
+# https://docs.djangoproject.com/en/5.0/topics/i18n/
+
+LANGUAGE_CODE = 'en-us'
+
+TIME_ZONE = 'UTC'
+
+USE_I18N = True
+
+USE_TZ = True
+
+
+# Static files (CSS, JavaScript, Images)
+# https://docs.djangoproject.com/en/5.0/howto/static-files/
+
+STATIC_URL = 'static/'
+
+# Default primary key field type
+# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
+
+DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
diff --git a/config/urls.py b/config/urls.py
new file mode 100644
index 0000000..a770eb4
--- /dev/null
+++ b/config/urls.py
@@ -0,0 +1,26 @@
+"""
+URL configuration for config project.
+
+The `urlpatterns` list routes URLs to views. For more information please see:
+ https://docs.djangoproject.com/en/5.0/topics/http/urls/
+Examples:
+Function views
+ 1. Add an import: from my_app import views
+ 2. Add a URL to urlpatterns: path('', views.home, name='home')
+Class-based views
+ 1. Add an import: from other_app.views import Home
+ 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
+Including another URLconf
+ 1. Import the include() function: from django.urls import include, path
+ 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
+"""
+from django.contrib import admin
+from django.urls import path
+
+from GroupFive.views import AnalysisView
+
+urlpatterns = [
+ path('admin/', admin.site.urls),
+ path('api/GroupFive/', AnalysisView.as_view(), name='GroupFive'),
+ path('api/GroupFive/', )
+]
diff --git a/config/wsgi.py b/config/wsgi.py
new file mode 100644
index 0000000..c0a9631
--- /dev/null
+++ b/config/wsgi.py
@@ -0,0 +1,16 @@
+"""
+WSGI config for config project.
+
+It exposes the WSGI callable as a module-level variable named ``application``.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/
+"""
+
+import os
+
+from django.core.wsgi import get_wsgi_application
+
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
+
+application = get_wsgi_application()
diff --git a/db.py b/db.py
new file mode 100644
index 0000000..5afc09b
--- /dev/null
+++ b/db.py
@@ -0,0 +1,21 @@
+import os
+from sqlalchemy import create_engine
+from sqlalchemy.orm import sessionmaker
+from dotenv import load_dotenv
+
+load_dotenv()
+
+DB_URL = f"postgresql://" \
+ f"{os.getenv('DB_USER')}:" \
+ f"{os.getenv('DB_PASS')}@" \
+ f"{os.getenv('DB_HOST')}:" \
+ f"{os.getenv('DB_PORT')}/" \
+ f"{os.getenv('DB_NAME')}"
+
+engine = create_engine(
+ DB_URL,
+ echo=True,
+ connect_args={"sslmode": "require"}
+)
+
+SessionLocal = sessionmaker(bind=engine)
\ No newline at end of file
diff --git a/front-end/db_queries.html b/front-end/db_queries.html
new file mode 100644
index 0000000..f840170
--- /dev/null
+++ b/front-end/db_queries.html
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+ Hello World!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/front-end/index.html b/front-end/index.html
index 3a3ade3..f824cb1 100644
--- a/front-end/index.html
+++ b/front-end/index.html
@@ -1,25 +1,116 @@
-
-
+ AutoPen Dashboard
+
+
+
+
Hello World!
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
Critical Vulnerabilities
+
12
+
+
+
Medium Vulnerabilities
+
34
+
+
+
Low Vulnerabilities
+
56
+
+
-
\ No newline at end of file
+
+
+
+
Upload Code for Analysis
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Recent Scan Results
+
+
+
+ | Target |
+ Date |
+ Risk Level |
+ Status |
+
+
+
+
+ | example.com |
+ 02/14/2026 |
+ Critical |
+ Completed |
+
+
+ | test-server.net |
+ 02/12/2026 |
+ Low |
+ Completed |
+
+
+
+
+
+
+