Skip to content

Architecture Overview

Simon Gibson edited this page Sep 9, 2024 · 2 revisions

Architecture Overview

NeRF-or-Nothing is a React-based web application built with Vite. It follows a component-based architecture and utilizes modern React patterns and practices.

High-Level Architecture

  1. Frontend: React application built with TypeScript
  2. Backend: RESTful API (implementation details not included in this repository). Backend API Spec
  3. State Management: React Context API
  4. Routing: React Router
  5. UI Framework: Mantine
  6. 3D Rendering: Three.js and React Three Fiber

Key Directories

  • /src: Main source code directory
    • /Components: React components
    • /Context: React context providers
    • /Fetch: API call functions
    • /Types: TypeScript type definitions
    • /Util: Utility functions and constants

Core Components

  1. App: The main application component
  2. AuthProvider: Manages authentication state
  3. Home: Landing page and main interface for creating new scenes
  4. Scene: Displays individual 3D scenes, remote or local.
  5. SceneHistory: Shows the user's previously created scenes
  6. Login/Signup: User authentication forms

State Management

The application uses React's Context API for global state management, primarily for user authentication. The AuthContext provides authentication state and methods to all child components.

API Integration

API calls are centralized in the Fetch directory, with CommonApiCalls.ts containing the main API functions. These functions use the fetch API and include error handling and response parsing.

Routing

React Router is used for navigation within the application. The main routes are defined in the App component.

3D Rendering

The application uses Three.js and React Three Fiber for rendering 3D scenes. The SplatCloudHandler and SplatMesh components are responsible for visualizing the 3D data. Additionally, the VideoHandler component allows for backend handled scene rendering exported as video.

Next Steps

For more detailed information on specific aspects of the architecture, please refer to the following pages: