logo

SINGULARITY

DOCS

PurchaseReturn to the Dashboard

Directory Structure and Naming Conventions

This document outlines the directory organization and naming practices for the Singularity React Next.js project. The project adopts a modular structure guided by route configurations defined in config files. The directory layout and naming conventions are crafted to enhance codebase navigation and comprehension.

.
├── @auth
├── @singularity
├── @i18n
├── @mock-utils
├── app
│   ├── (control-panel)
│   │   ├── apps
│   │   ├── auth
│   │   ├── dashboards
│   │   ├── documentation
│   │   ├── layout.tsx
│   │   ├── sign-in
│   │   ├── sign-out
│   │   └── sign-up
│   ├── api
│   ├── auth
│   ├── layout.tsx
│   └── page.tsx
├── components
├── configs
├── contexts
├── store
├── styles
└── utils

The Singularity React Next.js project’s directory structure is arranged by feature and functionality, with each primary section housed in its own dedicated folder.

Key Directories:

  • app/: The main application directory using Next.js 13+ App Router.
  • @auth/: AuthJs configuration and utilities.
  • @singularity/: Singularity core components and utilities.
  • @i18n/: Internationalization configuration and utilities.
  • @mock-utils/: Mock utilities for data fetching and manipulation.
  • components/: Reusable React components.
  • configs/: Configuration files for various aspects of the application.
  • contexts/: React context providers.
  • store/: State management related files, likely using Redux.
  • styles/: CSS and style-related files.
  • utils/: Utility functions and scripts.

Naming Conventions:

  • React components use PascalCase (e.g., MainLayout.tsx, PageTitle.tsx).
  • Utility functions and configuration files use camelCase (e.g., apiFetch.ts, navigationConfig.ts).
  • API routes and page components within the app/ directory use the page.tsx naming convention as per Next.js 13+ standards.
  • Feature-specific components and utilities are grouped in directories named after the feature.

This organization promotes a modular and scalable framework for developing sophisticated applications with Singularity React Next.js, supporting features like authentication, internationalization, and various UI elements typical of an admin dashboard or control panel.