3 Commits
master ... dev

Author SHA1 Message Date
kirby.is.austin9@gmail.com
9cd5e2e124 Added enviroment variables. 2025-06-18 09:05:44 +02:00
kirby.is.austin9@gmail.com
5c1dc5cd15 Dockerized the application. 2025-06-18 09:02:57 +02:00
kirby.is.austin9@gmail.com
1570c4dc7a Fixed requirements. 2025-06-17 13:16:15 +02:00
12 changed files with 4290 additions and 736 deletions

4
.env Normal file
View File

@@ -0,0 +1,4 @@
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=postgres
POSTGRES_HOST=postgres

27
backend/Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
FROM python:3.13-slim
RUN apt-get update && apt-get install -y \
gcc \
g++ \
python3-dev \
curl \
libmagic1 \
build-essential \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application code
COPY . .
RUN adduser --disabled-password --no-create-home appuser
USER appuser
ENV PYTHONUNBUFFERED=1
EXPOSE 5000
CMD ["python", "app.py"]

View File

@@ -1,10 +1,11 @@
flask==3.0.0 flask==3.0.0
flask-cors==4.0.0 flask-cors==4.0.0
uvicorn==0.34.0
python-dotenv==1.0.0 python-dotenv==1.0.0
pandas==2.1.3 pandas==2.3.0
requests==2.31.0 requests==2.31.0
werkzeug==3.0.1 python-magic==0.4.27; sys_platform != 'win32'
python-magic==0.4.27 python-magic-bin==0.4.14; sys_platform == 'win32'
validators==0.22.0 validators==0.22.0
celery==5.3.4 celery==5.3.4
redis==5.0.1 redis==5.0.1

47
docker-compose.yml Normal file
View File

@@ -0,0 +1,47 @@
version: '3.8'
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: backend
env_file:
- .env
ports:
- "5000:5000"
volumes:
- ./backend:/app
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: frontend
env_file:
- .env
ports:
- "80:80"
volumes:
- ./frontend:/app
depends_on:
- backend
postgres:
image: postgres:15
ports:
- "5432:5432"
container_name: postgres
env_file:
- .env
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres-data:/var/lib/postgresql/data
volumes:
postgres-data:
driver: local

2
frontend/.dockerignore Normal file
View File

@@ -0,0 +1,2 @@
node_modules
dist

37
frontend/Dockerfile Normal file
View File

@@ -0,0 +1,37 @@
# Stage 1: Build the React app
FROM node:18-alpine AS build
WORKDIR /app
# Leverage caching by installing dependencies first
COPY package.json package-lock.json ./
RUN npm install --frozen-lockfile --include=dev
# Copy the rest of the application code and build for production
COPY . ./
RUN npm run build
# Stage 2: Development environment
FROM node:18-alpine AS development
WORKDIR /app
# Install dependencies again for development
COPY package.json package-lock.json ./
RUN npm install --frozen-lockfile --include=dev
# Copy the full source code
COPY . ./
# Expose port for the Vite development server
EXPOSE 5173
CMD ["npm", "run", "dev"]
# Stage 3: Production environment
FROM nginx:alpine AS production
# Copy the production build artifacts from the build stage
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose the default NGINX port
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

17
frontend/nginx.conf Normal file
View File

@@ -0,0 +1,17 @@
server {
listen 80;
location /api {
proxy_pass http://backend:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -11,23 +11,33 @@
"test": "vitest" "test": "vitest"
}, },
"dependencies": { "dependencies": {
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@fontsource/roboto": "^5.2.5",
"@mui/icons-material": "^6.4.8",
"@mui/x-data-grid": "^7.1.0",
"@mui/material": "^6.4.8",
"react": "^18.3.1", "react": "^18.3.1",
"react-dom": "^18.3.1", "react-dom": "^18.3.1",
"react-dropzone": "^14.3.8",
"react-router-dom": "^6.26.1", "react-router-dom": "^6.26.1",
"lucide-react": "^0.515.0", "lucide-react": "^0.515.0",
"tailwindcss": "^4.1.10",
"@tailwindcss/vite": "^4.1.10",
"react-router": "^7.6.0",
"axios": "^1.7.2" "axios": "^1.7.2"
}, },
"devDependencies": { "devDependencies": {
"@types/react": "^18.3.3", "@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0", "@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1", "@vitejs/plugin-react": "^4.3.1",
"esbuild": "^0.25.5",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.3", "eslint-plugin-react": "^7.34.3",
"eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7", "eslint-plugin-react-refresh": "^0.4.7",
"vite": "^5.3.4", "vite": "^5.3.4",
"vitest": "^1.6.0", "vitest": "^1.6.0",
"tailwindcss": "^3.4.4",
"autoprefixer": "^10.4.19", "autoprefixer": "^10.4.19",
"postcss": "^8.4.39" "postcss": "^8.4.39"
} }

View File

@@ -1,9 +1,5 @@
@import "tailwindcss"; @import "tailwindcss";
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base { @layer base {
body { body {
@apply bg-zinc-900 text-white font-sans; @apply bg-zinc-900 text-white font-sans;

View File

6
package-lock.json generated Normal file
View File

@@ -0,0 +1,6 @@
{
"name": "ThreatHunt",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}