Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
aaacb50
Merge pull request #1 from Project-Code-UVA/main
KazerL Nov 14, 2024
86a15b4
Delete .github directory
KazerL Nov 14, 2024
f40ff1d
Create superlinter.yml
KazerL Nov 14, 2024
8dd10fd
Update superlinter.yml
KazerL Nov 14, 2024
bb6897b
Create src Directory
KazerL Nov 14, 2024
123d072
Create tests Directory
KazerL Nov 14, 2024
815771e
Create scripts Directory
KazerL Nov 14, 2024
b99d4bf
Create requirements.txt
KazerL Nov 14, 2024
66f6cca
Create package.json
KazerL Nov 14, 2024
a1906af
Create python-node-ci.yml
KazerL Nov 14, 2024
f8a4fa2
Create integration-tests.yml
KazerL Nov 14, 2024
3b0bc12
Create test_example.py
KazerL Nov 14, 2024
3e935ee
Update package.json
KazerL Nov 14, 2024
af4eaa7
Update package.json
KazerL Nov 14, 2024
e13e9bf
Update CI workflow to trigger on any branch push or pull request
KazerL Nov 14, 2024
a7e32ce
Create build script
KazerL Nov 14, 2024
93e7bbc
Add React build process for full-stack deployment
KazerL Nov 14, 2024
6ef40c6
Fix quoting issue in deploy-staging.yml to pass shellcheck linting
KazerL Nov 14, 2024
63ba827
Initialize React app in client folder for frontend setup
KazerL Nov 14, 2024
84f5c1b
Add package.json for React frontend in client directory
KazerL Nov 14, 2024
77e4d23
Add missing index.html file to client/public for React build
KazerL Nov 15, 2024
bd6bcad
Delete client/index.html
KazerL Nov 15, 2024
bd1db19
Add index.html to client/public directory for React build
KazerL Nov 15, 2024
1a3c3d0
Add debugging step to deploy-staging.yml to verify directory structure
KazerL Nov 15, 2024
47abbf9
Add directory listing for client/public in deploy-staging.yml for deb…
KazerL Nov 15, 2024
ecd422a
Add E2E Cypress testing workflow (e2e-tests.yml)
KazerL Nov 15, 2024
48d8937
Add index.js entry point to client/src for React application
KazerL Nov 15, 2024
2540233
Add App.js component to client/src for React application structure
KazerL Nov 15, 2024
f77c690
Add automated documentation generation workflow (generate-docs.yml)
KazerL Nov 15, 2024
ad5c352
Add Sphinx configuration file (conf.py) for documentation setup
KazerL Nov 15, 2024
8bb1041
Add index.rst as the main entry point for Sphinx documentation
KazerL Nov 15, 2024
b00e653
Update generate-docs.yml to debug and verify docs directory
KazerL Nov 15, 2024
28a713d
Fix path recognition for docs directory in generate-docs.yml workflow
KazerL Nov 15, 2024
9c00a45
Add empty dist directory with .gitkeep for workflow compatibility
KazerL Nov 15, 2024
6a93294
Temporarily disable generate-docs.yml
KazerL Nov 15, 2024
19e2445
Disable Staging Deployment workflow temporarily
KazerL Nov 15, 2024
9fbf0e7
Disable End-to-End Testing workflow temporarily
KazerL Nov 15, 2024
a0b9cf5
Add Security Scanning workflow using CodeQL
KazerL Nov 15, 2024
a9e0e74
Fix and format conf.py for linter compliance
KazerL Nov 15, 2024
c7f4876
Delete .github/workflows/deploy-staging.yml
KazerL Apr 27, 2025
e2662d7
Delete .github/workflows/e2e-tests.yml
KazerL Apr 27, 2025
919fbdf
Update superlinter.yml
KazerL Apr 27, 2025
24f061e
Create unit-tests.yml
KazerL Apr 27, 2025
99312b8
Update integration-tests.yml
KazerL Apr 27, 2025
4e775d3
Create deploy-staging.yml
KazerL Apr 27, 2025
43dc85f
Create e2e-tests.yml
KazerL Apr 27, 2025
df587ba
Update generate-docs.yml
KazerL Apr 27, 2025
ac17a53
Update security-scan.yml
KazerL Apr 27, 2025
7c6657b
Delete .github/workflows/python-node-ci.yml
KazerL Apr 27, 2025
4038abc
Create deploy-production.yml
KazerL Apr 27, 2025
6264546
Create monitoring.yml
KazerL Apr 27, 2025
7235d6b
Update unit-tests.yml
KazerL Apr 27, 2025
b7c3eb6
Delete .github/workflows/e2e-tests.yml
KazerL Apr 27, 2025
9c408c9
Delete .github/workflows/generate-docs.yml
KazerL Apr 27, 2025
d87bd3f
Delete .github/workflows/monitoring.yml
KazerL Apr 27, 2025
868a5ee
Update superlinter.yml
KazerL Apr 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy Production

on:
push:
tags: ['v*.*.*'] # semantic-version tag triggers

jobs:
promote:
runs-on: ubuntu-latest
environment: production

steps:
- name: Pull exact containers built for same commit
run: |
docker pull ghcr.io/${{ github.repository }}:staging
docker tag ghcr.io/${{ github.repository }}:staging ghcr.io/${{ github.repository }}:prod

- name: Push prod tag
run: docker push ghcr.io/${{ github.repository }}:prod

- name: ECS update service
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: backend/taskdef.json # checked-in file
service: ai-eyes-prod
cluster: ai-eyes
wait-for-service-stability: true
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
41 changes: 41 additions & 0 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy Staging

on:
push:
branches: [main]

jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: staging # add env-level secrets if desired

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npx expo export --platform web --output-dir dist-web

- name: Build backend container
uses: docker/build-push-action@v5
with:
context: backend
push: true
tags: ghcr.io/${{ github.repository }}:staging

# Example: deploy to AWS Elastic Beanstalk
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v25
with:
application_name: ai-eyes-staging
environment_name: ai-eyes-staging-env
version_label: github-${{ github.sha }}
bucket_name: ${{ secrets.EB_S3_BUCKET }}
bucket_key: app-${{ github.sha }}.zip
region: us-east-1
deployment_package: backend/Dockerrun.aws.json
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
35 changes: 35 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Integration Tests

on:
pull_request:
workflow_run:
workflows: [Unit Tests]
types: [completed]

jobs:
integration:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: test
ports: ['5432:5432']
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 5s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- name: Start backend (FastAPI) in background
run: |
pip install -r backend/requirements.txt
uvicorn backend.app:app --host 0.0.0.0 --port 8000 &
- name: Run integration tests
run: npm run test:integration
10 changes: 10 additions & 0 deletions .github/workflows/security-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Security Scan

on:
pull_request:
schedule:
- cron: '0 4 * * 0' # weekly Sunday 04:00 UTC

jobs:
codeql:
uses: github/codeql-action/.github/workflows/codeql.yml@v3
22 changes: 22 additions & 0 deletions .github/workflows/superlinter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Super-Linter

on:
pull_request:
branches: ['application-implementation'] # Trigger on PRs to application-implementation branch
push:
branches: ['application-implementation'] # Trigger on pushes to application-implementation branch

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Super-Linter ships with rules for JS, TS, Python, Markdown, JSON…
- name: Code Lint
uses: github/super-linter/slim@v6
env:
DEFAULT_BRANCH: application-implementation # Update default branch to application-implementation
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Optional: turn off languages you don’t use
# DISABLE_LINTERS: 'RUBY,GO'
52 changes: 52 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Unit Tests

on:
pull_request:
push:
branches: ['**']

jobs:
test-js-py:
runs-on: ubuntu-latest

strategy:
matrix:
node: [18, 20]
python: ['3.10', '3.11']

steps:
- uses: actions/checkout@v4

# ───────────── JavaScript side ─────────────
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
# ⚠️ no cache line → setup-node won’t look for package-lock.json
# cache: 'npm'

- name: Install JS deps
run: |
if [ -f package-lock.json ]; then
echo "package-lock.json found → npm ci"
npm ci
else
echo "No lock-file → npm install"
npm install
fi

- name: Run JS unit tests (if any)
run: npm test -- --ci || echo "No JS tests"

# ───────────── Python side ─────────────
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'

- name: Install Python deps & run tests
run: |
pip install -r backend/requirements.txt
pip install pytest
pytest backend || echo "No Py tests"
File renamed without changes.
34 changes: 34 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "client",
"version": "1.0.0",
"private": true,
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
11 changes: 11 additions & 0 deletions client/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>React App</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
11 changes: 11 additions & 0 deletions client/src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

function App() {
return (
<div className="App">
<h1>Hello, World!</h1>
</div>
);
}

export default App;
10 changes: 10 additions & 0 deletions client/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
1 change: 1 addition & 0 deletions dist/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

27 changes: 27 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import os
import sys

# Add the project's source code directory to the system path
sys.path.insert(0, os.path.abspath("../src"))

# Project information
project: str = "AI Object Recognition"
author: str = "Your Name or Team"
release: str = "1.0.0"

# Sphinx extensions
extensions: list[str] = [
"sphinx.ext.autodoc", # Automatically generate documentation from docstrings
"sphinx.ext.napoleon", # Support for NumPy and Google style docstrings
"sphinx.ext.viewcode", # Add links to source code
]

# Templates and static files
templates_path: list[str] = ["_templates"]
html_static_path: list[str] = ["_static"]

# Files and patterns to exclude from the build
exclude_patterns: list[str] = []

# HTML theme
html_theme: str = "alabaster" # Replace with 'sphinx_rtd_theme' if you prefer ReadTheDocs style
18 changes: 18 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Welcome to AI Object Recognition's Documentation!
=================================================

Contents:
---------

.. toctree::
:maxdepth: 2
:caption: Modules:

modules # Add module documentation here if using `automodule`

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "ai-object-recognition",
"version": "1.0.0",
"description": "An AI-powered full-stack application",
"main": "index.js",
"scripts": {
"build": "cd client && npm install && npm run build",
"start": "node index.js",
"test": "echo \"No tests specified\" && exit 0"
},
"author": "Project Code Dev Team",
"license": "ISC"
}
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest
1 change: 1 addition & 0 deletions scripts/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

4 changes: 4 additions & 0 deletions scripts/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"scripts": {
"build": "webpack --config webpack.config.js", // or your framework’s specific build command
"test": "echo \"No tests specified\" && exit 0"
}
1 change: 1 addition & 0 deletions src/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions tests/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions tests/test_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# test_example.py
def test_addition():
assert 1 + 1 == 2
Loading