Skip to content

Commit 4dab169

Browse files
Merge pull request #8 from abdulraheemnohri/initial-aiphsd-skeleton-and-blueprint-v1-7007966996010148688
feat: phase 8 universal polyglot sentinel
2 parents b199a2d + 100df3c commit 4dab169

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+475
-36
lines changed

.github/workflows/go-release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Release // Go Module & Binary
2+
on:
3+
workflow_dispatch:
4+
push:
5+
tags: ['v*']
6+
jobs:
7+
build-go:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Set up Go
12+
uses: actions/setup-go@v4
13+
with:
14+
go-version: '1.21'
15+
- name: Build Binary
16+
run: |
17+
cd backend/go
18+
go build -o aiphsd-go cmd/main.go
19+
- name: Upload Artifact
20+
uses: actions/upload-artifact@v3
21+
with:
22+
name: aiphsd-go-binary
23+
path: backend/go/aiphsd-go
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release // Node.js Package (NPM/GHCR)
2+
on:
3+
workflow_dispatch:
4+
push:
5+
tags: ['v*']
6+
jobs:
7+
build-node:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Set up Node
12+
uses: actions/setup-node@v3
13+
with:
14+
node-version: '18'
15+
- name: Build and Publish
16+
run: |
17+
cd backend/nodejs
18+
npm install
19+
# npm publish # Actual publish
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release // Python Package (PyPI/GHCR)
2+
on:
3+
workflow_dispatch:
4+
push:
5+
tags: ['v*']
6+
jobs:
7+
build-python:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Set up Python
12+
uses: actions/setup-python@v4
13+
with:
14+
python-version: '3.12'
15+
- name: Build and Publish
16+
run: |
17+
cd backend/python
18+
python setup.py sdist bdist_wheel
19+
# twine upload dist/* # Actual publish

.github/workflows/rust-release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release // Rust Crate & Binary
2+
on:
3+
workflow_dispatch:
4+
push:
5+
tags: ['v*']
6+
jobs:
7+
build-rust:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Set up Rust
12+
uses: dtolnay/rust-toolchain@stable
13+
- name: Build
14+
run: |
15+
cd backend/rust_server
16+
cargo build --release
17+
- name: Upload Artifact
18+
uses: actions/upload-artifact@v3
19+
with:
20+
name: aiphsd-rust-binary
21+
path: backend/rust_server/target/release/aiphsd-backend-rust

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
dist/
6+
build/
7+
*.egg-info/
8+
9+
# Node.js
10+
node_modules/
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
.next/
15+
out/
16+
17+
# Go
18+
bin/
19+
aiphsd-go
20+
21+
# Rust
22+
target/
23+
**/*.rs.bk
24+
25+
# Misc
26+
.DS_Store
27+
*.log
28+
audit_log.txt
29+
maintenance.log

README.md

Lines changed: 33 additions & 36 deletions

backend/go/cmd/main.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package main
2+
3+
import (
4+
"github.com/gin-gonic/gin"
5+
"net/http"
6+
)
7+
8+
func main() {
9+
r := gin.Default()
10+
11+
api := r.Group("/api")
12+
{
13+
api.GET("/threats", func(c *gin.Context) {
14+
c.JSON(http.StatusOK, []gin.H{
15+
{"id": 301, "name": "Go-Exploit-Delta", "risk_score": 88.2, "type": "exploit"},
16+
})
17+
})
18+
api.GET("/alerts", func(c *gin.Context) {
19+
c.JSON(http.StatusOK, []gin.H{
20+
{"id": 401, "title": "Go Alert: Kernel Anomaly", "severity": "critical"},
21+
})
22+
})
23+
}
24+
25+
r.GET("/", func(c *gin.Context) {
26+
c.JSON(http.StatusOK, gin.H{"message": "AIP-HSD Go Universal API is live."})
27+
})
28+
29+
r.Run(":8000")
30+
}

backend/go/go.mod

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module github.com/yourusername/aiphsd-backend-go
2+
3+
go 1.21
4+
5+
require (
6+
github.com/gin-gonic/gin v1.9.1
7+
github.com/google/uuid v1.3.0
8+
)

backend/nodejs/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "aiphsd-backend-nodejs",
3+
"version": "1.0.0",
4+
"main": "src/index.js",
5+
"scripts": {
6+
"start": "node src/index.js"
7+
},
8+
"dependencies": {
9+
"express": "^4.18.2",
10+
"cors": "^2.8.5",
11+
"jsonwebtoken": "^9.0.1",
12+
"bcryptjs": "^2.4.3",
13+
"dotenv": "^16.3.1"
14+
}
15+
}

backend/nodejs/src/index.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const express = require('express');
2+
const cors = require('cors');
3+
const threatsRouter = require('./routes/threats');
4+
const alertsRouter = require('./routes/alerts');
5+
const complianceRouter = require('./routes/compliance');
6+
const aiRouter = require('./routes/ai');
7+
8+
const app = express();
9+
app.use(cors());
10+
app.use(express.json());
11+
12+
app.use('/api/threats', threatsRouter);
13+
app.use('/api/alerts', alertsRouter);
14+
app.use('/api/compliance', complianceRouter);
15+
app.use('/api/ai', aiRouter);
16+
17+
app.get('/', (req, res) => {
18+
res.json({ message: "AIP-HSD Node.js Universal API is live." });
19+
});
20+
21+
const PORT = process.env.PORT || 8000;
22+
app.listen(PORT, () => {
23+
console.log(\`Node.js Backend running on port \${PORT}\`);
24+
});

0 commit comments

Comments
 (0)