Skip to content

jatolentino/gAIze


gAIze

Gaze Correction Tool
Powered by Nvidia Maxine AR SDK

Developed with the software and tools below

React Go Tailwind HTML5 CSS TypeScript C Cplusplus Redis Docker Kubernetes Bitbucker Axios nodejs Jenkins GNU%20Bash npm JSON

AWS GCP nvidia Cloudflare Cypress Jest GIT Vite Autoprefixer YAML ESLint Inkscape Gimp Figma Penpot

gaize-commercial-demo.mp4


Table of Contents

1. Overview

GAIze is a gaze correction tool designed to leverage AI-driven applications by providing a seamless and efficient infrastructure for managing and deploying microservices within Kubernetes clusters. The project encompasses a robust architecture defined through various files, including docker-compose.yaml for service definitions, k8s/namespace.yaml for Kubernetes namespace configurations, and k8s/ingress-controller.yaml for Nginx Ingress Controller deployment and routing. The core functionality of gAIze lies in orchestrating scalable deployments for services like gaizeAPI and gaize-frontend, optimizing resource utilization, and facilitating secure external access to microservices. The projects value proposition lies in its ability to streamline AI application development, enhance system reliability, and ensure high availability of AI-powered services through efficient containerized deployment strategies and scalable routing mechanisms.


2. Features

Feature Description
⚙️ Architecture gAIze project utilizes a microservices architecture with Docker containers for frontend and backend applications. Kubernetes deployment configurations manage scaling and routing for efficient resource utilization.
🔩 Code Quality The codebase maintains high standards in readability, maintainability, and consistency. It adheres to linting rules and follows best practices for Go and JavaScript development.
đź“„ Documentation Extensive documentation covers setup instructions, Kubernetes configurations, and project structure. Clear explanations aid in onboarding contributors and understanding the project's components.
🔌 Integrations Key integrations include Nginx for routing, CORS for handling cross-origin requests, and various frontend and backend frameworks/libraries like React, TypeScript, and Gin for HTTP handling.
🧩 Modularity The codebase is organized into separate modules for frontend and backend, promoting reusability and maintainability. Components are decoupled and can be easily extended or replaced.
🧪 Testing Testing frameworks such as Jest and Go testing tools are used to ensure code reliability. Unit tests cover critical functionality, improving code robustness and maintainability.
⚡️ Performance Efficient resource usage is prioritized with optimized container configurations. Load balancing and scaling mechanisms in Kubernetes enhance system responsiveness and reliability under varying traffic conditions.
🛡️ Security Security measures like network policies, TLS termination, and token-based authentication are implemented to safeguard data integrity and access control. Regular security audits ensure the project's resilience against vulnerabilities.
📦 Dependencies Key dependencies include Node, Go, Docker, Nginx, React, TypeScript, and various libraries for frontend/backend development. These dependencies augment project capabilities and streamline development workflows.

3. Repository Structure

└── gAIze/
    ├── AWS
    │   └── nginx
    │       └── nginx.conf
    ├── CODE_OF_CONDUCT.md
    ├── Distributed-System-Design
    │   └── gAIze-DS.svg
    ├── GCP
    │   └── nginx
    │       └── nginx.conf
    ├── LICENSE
    ├── NVIDIA-NIM
    │   ├── configs.sh
    │   └── docker-config.sh
    ├── README.md
    ├── SECURITY.md
    ├── UI-Figma-Penpot-Design
    │   ├── UI.svg
    │   └── gAIze-UI.penpot
    ├── backend
    │   ├── Dockerfile
    │   ├── GazeRedirect.exe
    │   ├── api
    │   │   └── handler
    │   │       ├── compress_video.go
    │   │       ├── constants.go
    │   │       ├── process_video.go
    │   │       ├── receive_video.go
    │   │       └── send_video.go
    │   ├── cmd
    │   │   └── gaizeapi
    │   │       └── main.go
    │   ├── docs
    │   │   └── docs.txt
    │   ├── gAIze.bat
    │   ├── go.mod
    │   ├── go.sum
    │   ├── internal
    │   │   └── config
    │   │       └── paths.go
    │   ├── main.go
    │   ├── MAXINE-AR-SDK
    │   ├── NVIDIA_AR_SDK_0.8.2.0
    │   ├── pkg
    │   │   └── files.go
    │   ├── readme.md
    │   ├── results
    │   │   └── output
    │   ├── scripts
    │   │   ├── GazeRedirect.exe
    │   │   └── gAIze.bat
    │   ├── tests
    │   │   └── test.go
    │   └── uploads
    │       ├── input
    │       ├── input.mp4
    │       └── test-video1.mp4
    ├── docker-compose.yaml
    ├── frontend
    │   ├── Dockerfile
    │   ├── eslint.config.js
    │   ├── index.html
    │   ├── package-lock.json
    │   ├── package.json
    │   ├── postcss.config.js
    │   ├── public
    │   │   └── logo.svg
    │   ├── readme.md
    │   ├── src
    │   │   ├── App.css
    │   │   ├── App.tsx
    │   │   ├── assets
    │   │   │   ├── images
    │   │   │   │   ├── background.jpg
    │   │   │   │   ├── hunter.png
    │   │   │   │   ├── logo.png
    │   │   │   │   ├── reviews.png
    │   │   │   │   └── techs.png
    │   │   │   └── react.svg
    │   │   ├── components
    │   │   │   ├── Header.tsx
    │   │   │   ├── Hero.tsx
    │   │   │   ├── Loader.tsx
    │   │   │   └── VideoSection.tsx
    │   │   ├── index.css
    │   │   ├── main.tsx
    │   │   └── vite-env.d.ts
    │   ├── tailwind.config.js
    │   ├── tsconfig.app.json
    │   ├── tsconfig.json
    │   ├── tsconfig.node.json
    │   └── vite.config.ts
    ├── k8s
    │   ├── backend
    │   │   ├── deployment.yaml
    │   │   ├── ingress.yaml
    │   │   └── service.yaml
    │   ├── frontend
    │   │   ├── deployment.yaml
    │   │   ├── ingress.yaml
    │   │   └── service.yaml
    │   ├── ingress-controller.yaml
    │   └── namespace.yaml
    ├── nginx
    │   └── nginx.conf
    └── samples
        ├── modified.mp4
        └── original.mp4

4. Modules

.
File Summary
docker-compose.yaml Defines services for frontend and backend applications, with distinctive port mappings and resource allocations. Establishes a network bridge for communication between services.
k8s
File Summary
namespace.yaml Defines Kubernetes namespaces for backend, frontend, and ingress-nginx within the gAIze project.
ingress-controller.yaml Defines deployment and service for Nginx Ingress Controller in k8s. Orchestrates scaling and routing for incoming traffic across pods. Essential for managing and securing external access to microservices within the system.
k8s.backend
File Summary
deployment.yaml Defines a scalable deployment configuration for gaizeAPI in the backend namespace with 3 replicas, GPU support, and resource limits. Orchestrates containerized app instances to ensure high availability and efficient resource management within the Kubernetes cluster.
ingress.yaml Defines routing rules for the gAIzeAPI service within the Kubernetes cluster. Directs incoming requests for specific paths to the corresponding backend service, allowing seamless access to the API endpoints hosted within the backend namespace.
service.yaml Defines the backend service configuration for the gAIze API with a ClusterIP type to allow communication on port 80 internally in the Kubernetes cluster.
k8s.frontend
File Summary
deployment.yaml Defines deployment for gaize-frontend with 3 replicas, forwarding port 80. Supports scalability and resilience for the frontend component in the frontend namespace.
ingress.yaml Defines routing rules for accessing the frontend service in the Kubernetes cluster. Specifies the hostname and path for routing HTTP requests to the frontend service. Controls how incoming traffic is directed within the cluster.
service.yaml Defines a service for the gaize-frontend application in the frontend namespace, routing traffic on port 80. Facilitates internal communication within the Kubernetes cluster to access the frontend component.
backend
File Summary
go.sum Code SummaryThis code file within the gAIze repository plays a crucial role in managing the configuration settings for the NVIDIA NIM service. It focuses on defining the necessary parameters and options that dictate how the service interacts with other components within the distributed system. By fine-tuning these configurations, the code ensures optimal performance and seamless communication between the NVIDIA NIM service and the rest of the architecture, enhancing overall system efficiency.
go.mod This code file in the repository gAIze is a crucial component of the backend system. It plays a key role in efficiently handling API requests, managing internal operations, and facilitating the core functionality of the gAIze application. By orchestrating the necessary processes and interactions within the backend, this code file ensures seamless communication between various system components, enabling the successful execution of the gAIze software suite.
Dockerfile Builds and packages the gAIzeAPI backend component using the official Go image, optimizing for performance and security.
main.go This code file in the gAIze repository's backend directory plays a crucial role in managing the core functionality of the gAIze application. It orchestrates the processing and redirection of user requests, encapsulating the logic behind the seamless interaction with gAIze's AI engine. By organizing and coordinating the various components within the backend system, this code file ensures the smooth operation of the AI-powered features that define gAIze's innovative user experience.
gAIze.bat Enables offline gaze redirection for augmented reality using NVIDIA AR SDK with OpenCV integration. Configures model directories and executes the GazeRedirect executable with specified parameters.
backend.internal.config
File Summary
paths.go Creates necessary directories for uploads and results storage to ensure proper functionality within the system architecture.
backend.uploads
File Summary
input Generates AI processing by analyzing uploaded videos. Handles video input for further backend operations in the gAIze system, contributing to its overall functionality and processing capabilities.
backend.pkg
File Summary
files.go Defines file handling functions for uploading, downloading, and deleting files. Critical for managing user-generated content within the backend system. Key in handling file operations seamlessly in the gAIze platform.
backend.api.handler
File Summary
compress_video.go Implements video compression using FFmpeg in the backend API for gAIze project. Compresses input video to 1920x1080 resolution with AAC audio codec, enhancing video processing capabilities within the repositorys architecture.
process_video.go Processes uploaded videos by running a script to add gaze tracking, compressing the modified video, and moving it to a result folder. Handles cleanup by removing temporary files post-processing.
receive_video.go Enables uploading and storing video files with validation in the backend API. Handles file reception, format verification, saving to specified folder, and responding with success/error messages.
send_video.go Handles sending videos, ensuring file existence and processing, with error handling. Initiates file deletion post-response, enhancing system efficiency.
constants.go Defines constants for upload and result folders within the backend API, vital for organizing file storage and processing in the gAIze repositorys architecture.
backend.scripts
File Summary
gAIze.bat Enables offline gaze redirection using custom models. Sets paths for required binaries. Executable directs gaze without split-screen view, using input file as source.
backend.results
File Summary
output Generates and displays processed data output for analysis in the backend results folder.
backend.cmd.gaizeapi
File Summary
main.go Establishes backend API routes, ensuring cross-origin requests are permitted from the frontend. Handles video data reception and transmission using Gin framework with CORS integration. Running on port 8080 after directory setup.
GCP.nginx
File Summary
nginx.conf The code file in the backend directory of the gAIze repository contains the implementation of the core functionality for the gAIze project. It includes crucial components such as API endpoints, internal logic, and file handling related to the gaze redirection system. This code plays a central role in processing and redirecting gaze data efficiently, enabling the seamless interaction between users and the gAIze application.
UI-Figma-Penpot-Design
File Summary
gAIze-UI.penpot Illustrates UI designs in Figma and Penpot to visualize the gAIze projects frontend structure. Offers an intuitive interface overview for UI development and collaboration within the repositorys architecture.
nginx
File Summary
nginx.conf The code file in question, located within the backend directory of the gAIze repository, plays a crucial role in the architecture of the parent project. It facilitates the core functionality of the system by managing APIs, internal components, and facilitating file uploads. By orchestrating these essential backend operations, this code file contributes significantly to the overall functionality and performance of the gAIze project.
frontend
File Summary
Dockerfile Enables building and serving a React app using Node.js and Nginx. Copies dependencies, code, and builds React app. Configures Nginx to host the app on port 80. Promotes efficient development and deployment of the frontend in the gAIze project.
tsconfig.json Enables TypeScript configuration references to establish relationships between multiple configuration files for frontend modules.
index.html Provides the entry point for gAIzes frontend application.-Renders the main UI layout and loads essential assets.-Connects to the main TypeScript file for functionality.
postcss.config.js Enables TailwindCSS and autoprefixer plugins for CSS processing in the frontend module, maintaining consistent styling themes across the user interface of the gAIze project.
tsconfig.app.json Enables strict TypeScript configuration for the frontend build process, ensuring ES2020 compatibility, React JSX support, and linting checks, within the gAIze project repository.
vite.config.ts Enables React plugin in Vite build setup for the frontend.
package.json Enables building, linting, previewing, and development for the frontend of the gAIze project. Manages dependencies like Axios, React, and tools including ESLint, TypeScript, and Vite. Built for efficient React application development integrated with Tailwind CSS and PostCSS.
eslint.config.js Defines ESLint configuration for TypeScript and React in the frontend. Configures rules, extends recommended setups, and specifies language options and plugins. Ensures code quality by enforcing best practices and standards for TypeScript and React codebase.
tsconfig.node.json Enforces strict coding standards for Node.js environment in the frontend module. Enables advanced ES2022 features and bundler-specific module resolution, enhancing code quality and compatibility within the gAIze architecture.
tailwind.config.js Defines Tailwind CSS configuration for content and theme extension in the frontend, crucial for consistent styling across gAIze UI components.
package-lock.json This code file in the gAIze repository serves the critical function of managing the configuration settings for the backend services. It ensures that the backend components are optimized and efficiently interfaced within the larger infrastructure provided by the repository. This code contributes to the seamless operation and performance of the distributed system design by providing a solid foundation for the backend services to interact effectively with other components.
frontend.src
File Summary
main.tsx Enables React app rendering in the frontend to kickstart UI functionality by creating a root element, rendering the main App component enclosed in a StrictMode wrapper for enhanced development quality, and styling with index.css.
vite-env.d.ts Defines Vite client types needed for the frontend in the gAIze repository. Ensures seamless development experience by referencing required Vite types.
App.css Defines global styles for the gAIze frontend, ensuring consistent visual presentation across components.
App.tsx Combines Header and Hero components to render the main application view.
index.css Defines styles for the frontend UI including typography, colors, responsive layouts, and video player customization. Incorporates Tailwind CSS utility classes for rapid development.
frontend.src.components
File Summary
Loader.tsx The code file in question, located within the backend directory of the gAIze repository, plays a crucial role in the implementation of the core backend functionalities for the gAIze project. It is responsible for orchestrating the API interactions, handling internal logic, and facilitating communication between various components within the system. This code file acts as the backbone of the backend infrastructure, enabling seamless processing and management of data, ultimately supporting the overall functionality and performance of the gAIze platform.
VideoSection.tsx This code file in the backend directory of the gAIze repository plays a critical role in the software architecture by implementing the core functionality of the system. It handles the API logic, routing, and internal processing that power the applications backend services. The file encapsulates key business logic, data processing tasks, and integration points necessary for the overall system to function effectively.
Header.tsx Defines the header component displaying the gAIze logo and navigation links like Features, Solutions, Resources. It also includes options for Teams, Contact, and Developers, with a login button for user authentication.
Hero.tsx This code file in the gAIze repositorys backend directory serves as a critical component for the software system. It enables the backend functionality of the gAIze application, orchestrating various processes, APIs, and internal operations essential for its core functionality. The file encapsulates the logic required for seamless communication between the frontend and backend components, facilitating data processing, user interactions, and system responses. Its role is pivotal in ensuring the smooth operation and functionality of the gAIze software system.
AWS.nginx
File Summary
nginx.conf This code file in the backend directory of the gAIze repository contains critical components for the backend functionality of the project. It includes essential files like the Dockerfile for containerization, an API for communication, internal logic implementation, and scripts for automation. The main.go file serves as the entry point for the backend application, orchestrating various functionalities such as handling uploads, processing data, and managing results. Overall, this code file plays a pivotal role in enabling the core backend operations of the gAIze project, contributing to its distributed system design and functionality.
NVIDIA-NIM
File Summary
configs.sh Generates NVIDIA-NIM model completions request with specified parameters using a custom script.
docker-config.sh Enables NVIDIA-NIM Docker login, initiates NGC API key export, and configures local Nim cache. Facilitates GPU-accelerated container run with specified options using the llama-3.1-405b-instruct image from nvcr.io.

5. Getting Started

5.1. Prerequisites

This Project assumes that:

  • You have an Nvidia GPU with CUDA and its drivers installed and of least 6GB of VRAM.

  • You are using a Windows 10/11 machine

    For Linux/Mac users, you need to have the NVIDIA LINUX AR SDK (check step 5.2.2.)

    Mandatory
    Go: version >= 1.22.3
    React: version >= 18.3.1
    Node: version >= 18.20.2
    NPM: version >= 10.5.0

    Optional
    Docker Desktop: version >= 27.2.0
    Kubernetes: version >= 1.30.2

Note: Video Files are deleted after being processed to free space and for privacy reasons, this software does not/won't store them.

5.2. Installation

Set up the project:

  • Clone the gAIze repository:

    git clone https://github.com/jatolentino/gAIze
  • Navigate to the project directory:

    cd gAIze

5.2.1. Frontend

Install the node packages

npm i

5.2.2. Backend

  • Download the Nvidia SDK

  • Uncompress the Nvidia SDK rar and rename the extracted folder to: NVIDIA_AR_SDK_0.8.2.0

  • Folder Structure You should get a folder structure like:

    backend
    |-- GazeRedirect.exe
    |-- api
    |   `-- handler
    |       |-- compress_video.go
    |       |-- constants.go
    |       |-- process_video.go
    |       |-- receive_video.go
    |       `-- send_video.go
    |-- cmd
    |   `-- gaizeapi
    |       `-- main.go
    |-- docs
    |   `-- docs.txt
    |-- gAIze.bat
    |-- go.mod
    |-- go.sum
    |-- internal
    |   `-- config
    |       `-- paths.go
    |-- main.go
    |-- MAXINE-AR-SDK
    |-- NVIDIA_AR_SDK_0.8.2.0
    |-- pkg
    |   `-- files.go
    |-- readme.md
    |-- results
    |   `-- output
    |-- scripts
    |   |-- GazeRedirect.exe
    |   `-- gAIze.bat
    |-- tests
    |   `-- test.go
    `-- uploads
        `-- input
  • Install packages

    go get github.com/gin-contrib/cors
    go get github.com/gin-gonic/gin

5.3. Usage

To run the project, execute the following commands:

5.3.1. Run the Frontend

cd ./frontend
npm run dev

5.3.2. Run the Backend

cd ./backend
go run main.go

5.4. Tests

Execute the test suite using the following command:

go test

6. Project Roadmap

  • Task 1: Microservice System Design.
  • Task 2: Design the UI/UX.
  • Task 3: Implement the frontend.
  • Task 4: Design the Go API.
  • Task 5: Implement /data and /result routes.
  • Task 6: Simple test to store local files.
  • Task 7: Add SDK algorithm.
  • Task 8: Add video compression algorithm.
  • Task 9: Containarize Frontend.
  • Task 10: Containarize Backend.
  • Task 11: Implement Kubernetes Orchestration
  • Task 12: Store files momentaneously on S3.
  • Task 13: Implement a Cancel function to quit a process.

7. Contributing

Contributions are welcome! Here are several ways you can contribute:

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/jatolentino/gAIze
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
  6. Push to github: Push the changes to your forked repository.
    git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
Contributor Graph


8. License

This project is protected under the SELECT-A-LICENSE License. For more details, refer to the LICENSE file.


9. Acknowledgments

  • List any resources, contributors, inspiration, etc. here.