This commit is contained in:
alorig
2025-11-24 06:08:27 +05:00
parent 9ee03f4f7f
commit f255e3c0a0
30 changed files with 185 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
import { Suspense, lazy, useEffect } from "react";
import { BrowserRouter as Router, Routes, Route, Navigate } from "react-router";
import { BrowserRouter as Router, Routes, Route, Navigate } from "react-router-dom";
import { HelmetProvider } from "react-helmet-async";
import AppLayout from "./layout/AppLayout";
import { ScrollToTop } from "./components/common/ScrollToTop";

View File

@@ -1,5 +1,5 @@
import { useEffect, ReactNode, useState } from "react";
import { Navigate, useLocation } from "react-router";
import { Navigate, useLocation } from "react-router-dom";
import { useAuthStore } from "../../store/authStore";
import { useErrorHandler } from "../../hooks/useErrorHandler";
import { trackLoading } from "../common/LoadingStateMonitor";

View File

@@ -1,5 +1,5 @@
import { useState } from "react";
import { Link, useNavigate, useLocation } from "react-router";
import { Link, useNavigate, useLocation } from "react-router-dom";
import { ChevronLeftIcon, EyeCloseIcon, EyeIcon } from "../../icons";
import Label from "../form/Label";
import Input from "../form/input/InputField";

View File

@@ -1,5 +1,5 @@
import { useState } from "react";
import { Link, useNavigate } from "react-router";
import { Link, useNavigate } from "react-router-dom";
import { ChevronLeftIcon, EyeCloseIcon, EyeIcon } from "../../icons";
import Label from "../form/Label";
import Input from "../form/input/InputField";

View File

@@ -1,4 +1,4 @@
import { Link } from "react-router";
import { Link } from "react-router-dom";
interface BreadcrumbProps {
pageTitle: string;

View File

@@ -1,5 +1,5 @@
import { useEffect } from "react";
import { useLocation } from "react-router";
import { useLocation } from "react-router-dom";
export function ScrollToTop() {
const { pathname } = useLocation();

View File

@@ -1,5 +1,5 @@
import React, { ReactNode, useState } from "react";
import { Link } from "react-router";
import { Link } from "react-router-dom";
import { ArrowUpIcon, ArrowDownIcon } from "../../icons";
import { EnhancedTooltip } from "../ui/tooltip/EnhancedTooltip";

View File

@@ -1,5 +1,5 @@
import React, { ReactNode } from "react";
import { Link } from "react-router";
import { Link } from "react-router-dom";
import { CheckCircleIcon, TimeIcon, ArrowRightIcon } from "../../icons";
import { Tooltip } from "../ui/tooltip";

View File

@@ -2,7 +2,7 @@ import { useState } from "react";
import { ThemeToggleButton } from "../common/ThemeToggleButton";
import NotificationDropdown from "./NotificationDropdown";
import UserDropdown from "./UserDropdown";
import { Link } from "react-router";
import { Link } from "react-router-dom";
// Define the interface for the props
interface HeaderProps {

View File

@@ -1,7 +1,7 @@
import { useState, useRef } from "react";
import { Dropdown } from "../ui/dropdown/Dropdown";
import { DropdownItem } from "../ui/dropdown/DropdownItem";
import { Link } from "react-router";
import { Link } from "react-router-dom";
export default function NotificationDropdown() {
const [isOpen, setIsOpen] = useState(false);

View File

@@ -1,5 +1,5 @@
import { useState, useEffect, useRef } from "react";
import { useLocation, useNavigate } from "react-router";
import { useLocation, useNavigate } from "react-router-dom";
import { Dropdown } from "../ui/dropdown/Dropdown";
import { DropdownItem } from "../ui/dropdown/DropdownItem";
import { fetchSites, Site, setActiveSite as apiSetActiveSite } from "../../services/api";

View File

@@ -1,8 +1,8 @@
import { useState, useRef } from "react";
import { useNavigate } from "react-router";
import { useNavigate } from "react-router-dom";
import { DropdownItem } from "../ui/dropdown/DropdownItem";
import { Dropdown } from "../ui/dropdown/Dropdown";
import { Link } from "react-router";
import { Link } from "react-router-dom";
import { useAuthStore } from "../../store/authStore";
export default function UserDropdown() {

View File

@@ -1,5 +1,5 @@
import { useState, useEffect, useCallback, useRef } from "react";
import { useLocation } from "react-router";
import { useLocation } from "react-router-dom";
import { API_BASE_URL } from "../../services/api";
import { useAuthStore } from "../../store/authStore";

View File

@@ -1,5 +1,5 @@
import React from "react";
import { Link } from "react-router";
import { Link } from "react-router-dom";
import { ArrowRightIcon } from "../../icons";
export interface RelationshipData {

View File

@@ -1,4 +1,4 @@
import { Link } from "react-router";
import { Link } from "react-router-dom";
interface AlertProps {
variant: "success" | "error" | "warning" | "info"; // Alert type

View File

@@ -1,5 +1,5 @@
import { ReactNode } from "react";
import { Link } from "react-router";
import { Link } from "react-router-dom";
interface BreadcrumbProps {
items: Array<{

View File

@@ -1,5 +1,5 @@
import type React from "react";
import { Link } from "react-router";
import { Link } from "react-router-dom";
interface DropdownItemProps {
tag?: "a" | "button";

View File

@@ -1,4 +1,4 @@
import { useNavigate } from "react-router";
import { useNavigate } from "react-router-dom";
const useGoBack = () => {
const navigate = useNavigate();

View File

@@ -1,6 +1,6 @@
import { useEffect, useRef, useState } from "react";
import { Link } from "react-router";
import { Link } from "react-router-dom";
import { useSidebar } from "../context/SidebarContext";
import { ThemeToggleButton } from "../components/common/ThemeToggleButton";
import NotificationDropdown from "../components/header/NotificationDropdown";

View File

@@ -1,6 +1,6 @@
import { useEffect, useRef, useState } from "react";
import { SidebarProvider, useSidebar } from "../context/SidebarContext";
import { Outlet } from "react-router";
import { Outlet } from "react-router-dom";
import AppHeader from "./AppHeader";
import Backdrop from "./Backdrop";
import AppSidebar from "./AppSidebar";

View File

@@ -1,5 +1,5 @@
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { Link, useLocation } from "react-router";
import { Link, useLocation } from "react-router-dom";
// Assume these icons are imported from an icon library
import {

View File

@@ -1,6 +1,6 @@
import React from "react";
import GridShape from "../../components/common/GridShape";
import { Link } from "react-router";
import { Link } from "react-router-dom";
import ThemeTogglerTwo from "../../components/common/ThemeTogglerTwo";
export default function AuthLayout({

View File

@@ -1,5 +1,5 @@
import { useEffect, useState, lazy, Suspense } from "react";
import { Link, useNavigate } from "react-router";
import { Link, useNavigate } from "react-router-dom";
import PageMeta from "../../components/common/PageMeta";
import ComponentCard from "../../components/common/ComponentCard";
import { ProgressBar } from "../../components/ui/progress";

View File

@@ -1,5 +1,5 @@
import React, { useEffect, useState, lazy, Suspense, useRef } from "react";
import { Link, useNavigate } from "react-router";
import { Link, useNavigate } from "react-router-dom";
import PageMeta from "../../components/common/PageMeta";
import CreditBalanceWidget from "../../components/dashboard/CreditBalanceWidget";
import UsageChartWidget from "../../components/dashboard/UsageChartWidget";

View File

@@ -1,5 +1,5 @@
import GridShape from "../../components/common/GridShape";
import { Link } from "react-router";
import { Link } from "react-router-dom";
import PageMeta from "../../components/common/PageMeta";
export default function NotFound() {

View File

@@ -1,5 +1,5 @@
import { useEffect, useState, useMemo, lazy, Suspense } from "react";
import { Link, useNavigate } from "react-router";
import { Link, useNavigate } from "react-router-dom";
import PageMeta from "../../components/common/PageMeta";
import ComponentCard from "../../components/common/ComponentCard";
import { ProgressBar } from "../../components/ui/progress";

View File

@@ -1,5 +1,5 @@
import { useEffect, useState, lazy, Suspense } from "react";
import { Link, useNavigate } from "react-router";
import { Link, useNavigate } from "react-router-dom";
import PageMeta from "../../components/common/PageMeta";
import ComponentCard from "../../components/common/ComponentCard";
import { ProgressBar } from "../../components/ui/progress";

View File

@@ -1,5 +1,5 @@
import { useEffect, useState, useMemo, lazy, Suspense } from "react";
import { Link, useNavigate } from "react-router";
import { Link, useNavigate } from "react-router-dom";
import PageMeta from "../../components/common/PageMeta";
import ComponentCard from "../../components/common/ComponentCard";
import { ProgressBar } from "../../components/ui/progress";

View File

@@ -0,0 +1,156 @@
# Agent Master Reference — IGNY8
Purpose: provide a single, navigable reference for any new agent (human or automated) to locate the exact files, entry points, and functional responsibilities across the IGNY8 monorepo. Use this as the starting point for feature work, bug fixes, or integrations.
Contents
- Repository snapshot (concise tree)
- Key modules & responsibilities (table)
- Important functions / entrypoints (table)
- Quick agent workflow (5 steps)
- Setup & common commands
---
**Repository Snapshot (Top-level, concise)**
- `backend/` : Django project and related management scripts
- `manage.py` : Django CLI entry
- `requirements.txt` : Python deps
- `igny8_core/` : main Django package
- `settings.py`, `asgi.py`, `wsgi.py`, `celery.py`
- `api/`, `ai/`, `auth/`, `admin/`, `business/`, `modules/`, `utils/`
- `frontend/` (legacy frontend bundle inside backend)
- `frontend/` : Vite + React application (modern front-end)
- `package.json`, `vite.config.ts`, `src/` (React + TS), `public/`
- `master-docs/` : documentation; authoritative notes about architecture
- `docker-compose.app.yml` : local dev stack (DB, cache, web, worker)
---
**Key Modules & Purpose**
| Module / Path | Purpose / Responsibility | Quick Notes |
|---|---|---|
| `backend/manage.py` | Django management entrypoint | Run migrations, tests, server |
| `igny8_core/settings.py` | Central config for Django | Env-driven; source of secrets/flags |
| `igny8_core/celery.py` | Celery app configuration | Worker + beat scheduling setup |
| `igny8_core/ai/` | AI orchestration layer | Models and engine integration |
| `igny8_core/api/` | REST endpoints for backend | Look here for API implementations |
| `frontend/` | Modern frontend app | `src/` contains components, hooks, services |
| `docker-compose.app.yml` | Local dev orchestration | DB, cache, web, worker definitions |
| `master-docs/` | Documentation and process| Use for architecture decisions and public docs |
---
**Important Files & Entrypoints (where to start for common tasks)**
| Task | File / Function | Where to look |
|---|---|---|
| Start backend locally | `backend/manage.py` | `python manage.py runserver` (see file for settings) |
| Celery worker/beat | `igny8_core/celery.py` | `celery -A igny8_core worker` and `celery -A igny8_core beat` |
| Add/inspect REST endpoint | `igny8_core/api/` | Search for view classes or `@api_view` functions |
| AI model orchestration | `igny8_core/ai/engine.py` (or `ai_core.py`) | See `05-AI-FRAMEWORK-IMPLEMENTATION.md` in `master-docs/` |
| Frontend page/component | `frontend/src/pages/` and `frontend/src/components/` | Use the `App` and route files in `src/` |
---
**Function / Area Quick-Reference (examples)**
- Celery and periodic tasks
- File: `igny8_core/celery.py`
- Purpose: configure Celery app, load periodic tasks (beat schedule is present at `backend/celerybeat-schedule`).
- AI orchestration
- Files: `igny8_core/ai/ai_core.py`, `igny8_core/ai/engine.py` (or similarly named)
- Purpose: implement model selection, prompt orchestration, caching, and engine interfaces.
- API handlers
- Path: `igny8_core/api/` (search for submodules per resource)
- Purpose: HTTP endpoints used by `frontend/` and external integrations.
- Frontend data services
- Path: `frontend/src/services/` and `frontend/src/api/`
- Purpose: client-side API wrappers; coordinate expected backend response shapes.
---
**Agent Quick Workflow — 5 Steps**
1. Identify the feature or bug area
- Use this reference to map the user-facing feature to `frontend/` pages and `igny8_core/api/` endpoints.
- Search for the route or identifiable component in `frontend/src/`.
2. Locate the backend API handler
- From the frontend service or API call, open the corresponding URL and find the view in `igny8_core/api/`.
- Inspect serializer, view, and model (if present) in the same directory.
3. Check configuration and environment
- Open `igny8_core/settings.py` to find related flags and env vars.
- For scheduled/background work, inspect `igny8_core/celery.py` and `backend/celerybeat-schedule`.
4. Implement change and run local checks
- Backend: create/modify files under `igny8_core/` and run `python manage.py test` or `pytest` as configured.
- Frontend: modify `frontend/src/` and run `npm run dev` or `npm run build` for production checks.
5. Update documentation & tests
- Add or update `master-docs/*` when making cross-cutting changes.
- Update the `API-COMPLETE-REFERENCE.md` if API shapes change.
---
**Common Commands (PowerShell-friendly)**
Backend setup and run (PowerShell):
```
cd backend
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
```
Run Celery worker/beat (PowerShell):
```
cd backend
.\.venv\Scripts\Activate.ps1
celery -A igny8_core worker -l info
celery -A igny8_core beat -l info
```
Frontend dev (Windows PowerShell):
```
cd frontend
npm install
npm run dev
```
Docker compose local stack:
```
docker-compose -f docker-compose.app.yml up --build
```
---
**Guidance for new agents**
- Always cross-check `master-docs/` entries when making architectural changes.
- When changing an API, update `master-docs/API-COMPLETE-REFERENCE.md` and the frontend wrappers in `frontend/src/services/`.
- For AI changes, refer to `master-docs/05-AI-FRAMEWORK-IMPLEMENTATION.md` before editing `igny8_core/ai/`.
---
If you want, I can:
- Expand the file tree to include all files per directory (full tree).
- Generate a CSV or JSON mapping of file → responsibilities for programmatic use.
- Add an index of search terms and likely filenames for quick grep commands.
End of reference.

BIN
master-docs/file-tree.md Normal file

Binary file not shown.