This is a migration of the Logixtoc project to:
- Typescript
- React Query
- Next.js
- axios
- Material UI
Initially, the app was built using React
, TailwindCSS
, Material UI
, and axios
for data fetching, all written in pure JavaScript
. We are migrating to the latest technologies to improve the developer experience. This new version will also address the responsiveness issues present in the previous version.
In the previous version, we used a package called NextGenMUI
. While it was useful, it would hinder scalability in the future and pose a challenge for anyone unfamiliar with NextGenMUI
working on this project. Therefore, we decided to move all datagrid and forms code into the application codebase.
┌──────────────────────────────────────────────┐
│ │
│ **App** │
│ ┌─────────────────────────────────────────┐ │
│ │ │ │
│ │ **Page Components** │ │
│ │ (e.g., auth, dashboard, │ │
│ │ finance, suppliers) │ │
│ │ │ │
│ │ - Each folder represents a page or │ │
│ │ feature-specific component that │ │
│ │ utilizes reusable UI and hooks. │ │
│ │ │ │
│ └─────────────────────────────────────────┘ │
│ │
└──────────────────────────────────────────────┘
- The
app
folder contains primary page components organized by business domains (e.g.,dashboard
,finance
,suppliers
). Each subfolder is responsible for rendering specific pages or views within the application and organizing related files (page.tsx
,layout.tsx
,loading.tsx
) into isolated units for each feature.
┌──────────────────────────────────────────────┐
│ │
│ **Components** │
│ ┌─────────────────────────────────────────┐ │
│ │ │ │
│ │ **Reusable Components** │ │
│ │ (e.g., Buttons, Dialogs, │ │
│ │ DataGrids, Inputs, etc.) │ │
│ │ │ │
│ │ - These are UI components designed │ │
│ │ to be reused across multiple pages. │ │
│ │ │ │
│ └─────────────────────────────────────────┘ │
│ │
└──────────────────────────────────────────────┘
- The
components
folder acts as a UI library, containing reusable UI components like buttons, grids, inputs, dialogs, and navigational elements. Each subfolder groups similar components together, enabling modular and consistent UI development.
┌──────────────────────────────────────────────┐
│ │
│ **API** │
│ ┌─────────────────────────────────────────┐ │
│ │ │ │
│ │ **apiClient.ts** │ │
│ │ - Configuration for Axios instance, │ │
│ │ authentication, and request hooks. │ │
│ │ │ │
│ │ **urls.ts** │ │
│ │ - Centralized endpoint URLs for the │ │
│ │ API. │ │
│ │ │ │
│ │ **types.ts** │ │
│ │ - API-specific type definitions. │ │
│ └─────────────────────────────────────────┘ │
│ │
└──────────────────────────────────────────────┘
- The
api
folder is dedicated to managing API requests and handling configuration for HTTP requests. TheapiClient.ts
file is the central file for configuringaxios
with custom headers and interceptors, whileurls.ts
centralizes the API endpoints, andtypes.ts
provides typings for API responses.
┌──────────────────────────────────────────────┐
│ │
│ **UI Model** │
│ ┌─────────────────────────────────────────┐ │
│ │ │ │
│ │ **UIModel.tsx** │ │
│ │ - Main model for managing CRUD │ │
│ │ operations and data grids. │ │
│ │ │ │
│ │ **UIConstructor.tsx** │ │
│ │ - Class or factory functions │ │
│ │ for constructing UI models. │ │
│ │ │ │
│ │ **types.ts** │ │
│ │ - Type definitions for the UI │ │
│ │ models. │ │
│ └─────────────────────────────────────────┘ │
│ │
└──────────────────────────────────────────────┘
- The
UIModel
folder encapsulates components and classes responsible for managing data grids, forms, and CRUD interactions within the UI. This includesUIModel.tsx
as the main component for UI data management, andUIConstructor.tsx
for constructing model instances or configurations. Types are defined withintypes.ts
to support these components.
┌──────────────────────────────────────────────┐
│ │
│ **Context** │
│ ┌─────────────────────────────────────────┐ │
│ │ │ │
│ │ - Contains context providers │ │
│ │ and hooks for managing global │ │
│ │ state across components. │ │
│ │ │ │
└──────────────────────────────────────────────┘
- The
Context
folder contains files related to React Context and global state management. It provides global state to components where needed, facilitating state-sharing across deeply nested component trees.
┌──────────────────────────────────────────────┐
│ │
│ **Hooks** │
│ ┌─────────────────────────────────────────┐ │
│ │ │ │
│ │ - Contains custom hooks like │ │
│ │ `useFetch` and `useMutate` │ │
│ │ for handling API calls. │ │
│ │ │ │
└──────────────────────────────────────────────┘
- The
hooks
folder centralizes custom hooks.
┌──────────────────────────────────────────────┐
│ │
│ **Utilities (utils)** │
│ ┌─────────────────────────────────────────┐ │
│ │ │ │
│ │ - Utility functions and helpers, │ │
│ │ such as formatting functions │ │
│ │ or common validation. │ │
│ └─────────────────────────────────────────┘ │
│ │
│ **Constants** │
│ ┌─────────────────────────────────────────┐ │
│ │ │ │
│ │ - Stores constants like colors, │ │
│ │ countries, routes, and other │ │
│ │ fixed values. │ │
│ └─────────────────────────────────────────┘ │
│ │
└──────────────────────────────────────────────┘
- The
utils
folder contains utility functions that can be reused across the project, such as formatters, validators, and general-purpose helpers.
To run this project in your local machine, make sure you clone the repository. After cloning, run the following commands
yarn
|npm install
to install dependancies.yarn dev
|npm run dev
to run the project.
Here is a list of all issues