Skip to content

Project Structure

www0abdb-oss edited this page Sep 6, 2026 · 1 revision

Project Structure

This page provides an overview of the NexVaultX frontend project structure and explains the purpose of the main directories and files.

Overview

The NexVaultX frontend is organized to keep application logic, UI components, routing, configuration, and static assets separated and easy to maintain.

frontend/
├── src/
│   ├── components/
│   ├── routes/
│   ├── lib/
│   └── ...
├── public/
├── package.json
├── pnpm-lock.yaml
├── tsconfig.json
├── vite.config.ts
└── ...

The structure may change as NexVaultX continues to evolve.

src/

The src directory contains the main application source code.

src/components/

Contains reusable UI components used throughout the application.

Components should generally be kept reusable and focused on a specific UI responsibility.

Examples may include:

  • Navigation
  • Buttons
  • Cards
  • Dialogs
  • Forms
  • Layout components
  • Content components

src/routes/

Contains the application's routes and page-level components.

Each route represents a part of the NexVaultX web application and is responsible for rendering the appropriate page.

Routing is handled using TanStack Router.

src/lib/

Contains shared utilities, helpers, and application-level logic that does not belong directly to a UI component.

This directory should be used for reusable functionality shared across multiple parts of the application.

public/

Contains static assets that are served directly by the application.

These files do not require processing through the application's component system.

Configuration Files

package.json

Defines the project metadata, dependencies, and available scripts.

Common development commands are defined here.

pnpm-lock.yaml

Locks dependency versions to ensure consistent installations across development environments and CI.

This file should normally be committed whenever dependencies are changed.

tsconfig.json

Contains the TypeScript configuration used by the project.

vite.config.ts

Contains configuration related to the Vite build and development environment.

Development Principles

When adding new code:

  • Keep components small and reusable.
  • Keep page-specific logic close to its route.
  • Move reusable utilities into src/lib/.
  • Avoid duplicating existing functionality.
  • Keep TypeScript types explicit and maintainable.
  • Follow the existing project conventions before introducing new patterns.

Keeping the Structure Clean

Before adding a new file or directory, consider whether the functionality belongs in an existing location.

A clean project structure makes NexVaultX easier to:

  • Develop
  • Review
  • Maintain
  • Contribute to
  • Scale

For the development process, see Development Workflow.