The SkyGate application follows a modular architecture with clear separation between frontend and backend components. This document outlines the project structure, explaining the purpose and organization of directories and key files.
SkyGate/
├── backend/ # Backend application code
├── frontend/ # Frontend application code
├── docs/ # Project documentation
└── README.md # Project overview and quick start guide
backend/
├── src/ # Source code
│ ├── api/ # API endpoints and resources
│ │ ├── endpoints.py # API route definitions
│ │ └── resources.py # Resource classes for API endpoints
│ ├── detection/ # AI detection algorithms
│ │ └── detection_engine.py # Core detection functionality
│ ├── models/ # Database models
│ │ ├── postgresql_models.py # PostgreSQL database models
│ │ └── mongodb_models.py # MongoDB database models
│ ├── utils/ # Utility functions and helpers
│ │ ├── image_processing.py # Image processing utilities
│ │ └── metadata_analysis.py # Metadata analysis utilities
│ └── app.py # Main application entry point
├── requirements.txt # Python dependencies
└── run.py # Application runner script
The API module handles all HTTP requests and responses, implementing the RESTful API endpoints.
- endpoints.py: Defines the API routes and connects them to resource classes
- resources.py: Contains resource classes that implement the business logic for each endpoint
The detection module contains the core AI detection algorithms and processing logic.
- detection_engine.py: Implements the main detection engine that orchestrates different detection methods
The models module defines the database schemas and models for data persistence.
- postgresql_models.py: SQLAlchemy models for PostgreSQL database tables
- mongodb_models.py: PyMongo models for MongoDB collections
The utils module provides helper functions and utilities used throughout the application.
- image_processing.py: Utilities for image manipulation and analysis
- metadata_analysis.py: Functions for extracting and analyzing file metadata
- app.py: Configures and initializes the Flask application
- run.py: Entry point script for running the application
- requirements.txt: Lists all Python dependencies with version specifications
frontend/
├── public/ # Static files
│ ├── index.html # HTML entry point
│ ├── manifest.json # Web app manifest
│ └── assets/ # Static assets (images, icons)
├── src/ # Source code
│ ├── components/ # Reusable UI components
│ ├── contexts/ # React context providers
│ │ └── AuthContext.tsx # Authentication context
│ ├── layouts/ # Page layout components
│ │ ├── MainLayout.tsx # Main application layout
│ │ └── AuthLayout.tsx # Authentication pages layout
│ ├── pages/ # Page components
│ │ ├── Dashboard.tsx # Dashboard page
│ │ ├── Login.tsx # Login page
│ │ ├── Register.tsx # Registration page
│ │ ├── Upload.tsx # File upload page
│ │ ├── Results.tsx # Results listing page
│ │ ├── ResultDetail.tsx # Detailed result view
│ │ ├── Profile.tsx # User profile page
│ │ └── NotFound.tsx # 404 page
│ ├── utils/ # Utility functions
│ │ └── api.js # API client utilities
│ ├── App.tsx # Main application component
│ ├── index.tsx # Application entry point
│ ├── theme.ts # Theme configuration
│ └── index.css # Global styles
├── package.json # NPM dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── .env.development # Development environment variables
Contains static files that are served directly without processing.
- index.html: The HTML template for the application
- manifest.json: Web app manifest for PWA support
- assets/: Static assets like images and icons
Contains all the React application code.
Reusable UI components used throughout the application.
React context providers for state management.
- AuthContext.tsx: Manages authentication state and user information
Page layout components that provide consistent structure.
- MainLayout.tsx: Layout for authenticated pages with navigation
- AuthLayout.tsx: Layout for authentication pages
Individual page components for different routes.
- Dashboard.tsx: Main dashboard with statistics and recent activity
- Login.tsx: User login page
- Register.tsx: User registration page
- Upload.tsx: File upload and processing page
- Results.tsx: List of detection results
- ResultDetail.tsx: Detailed view of a single detection result
- Profile.tsx: User profile management
- NotFound.tsx: 404 error page
Utility functions and helpers.
- api.js: API client for communicating with the backend
- App.tsx: Main application component with routing
- index.tsx: Application entry point
- theme.ts: Material-UI theme configuration
- index.css: Global CSS styles
- package.json: NPM dependencies and scripts
- tsconfig.json: TypeScript configuration
- .env.development: Environment variables for development
docs/
├── features/ # Feature documentation
│ └── features.md # Comprehensive feature list
├── tech_stack/ # Technology stack documentation
│ └── tech_stack.md # Complete tech stack details
├── installation/ # Installation guides
│ └── installation.md # Step-by-step installation instructions
├── database/ # Database documentation
│ └── database_schema.md # Database schema and design
└── research/ # Research documentation
└── ai_detection_techniques.md # AI detection research findings
Documentation of application features and capabilities.
Details of all technologies, frameworks, and libraries used.
Step-by-step guides for installing and running the application.
Database schema design and documentation.
Research findings and technical background information.
The SkyGate project follows these organizational principles:
- Separation of Concerns: Clear separation between frontend and backend
- Modularity: Code is organized into modules with specific responsibilities
- Reusability: Common functionality is extracted into reusable components
- Scalability: Structure supports adding new features without major refactoring
- Maintainability: Consistent naming and organization for easy navigation
The recommended development workflow for the SkyGate project:
-
Backend Development:
- Run the backend server using
python run.py - Test API endpoints using Postman or curl
- Run the backend server using
-
Frontend Development:
- Run the frontend development server using
npm start - The proxy configuration will forward API requests to the backend
- Run the frontend development server using
-
Full-Stack Development:
- Run both backend and frontend servers
- Make changes to both components as needed
- Test integration using the frontend UI
-
Production Build:
- Build the frontend using
npm run build - Deploy the backend and frontend to production servers
- Build the frontend using