# abdul-ahad2/plagiarism_detection_frontend architecture

> Architecture diagram of the GitHub repository abdul-ahad2/plagiarism_detection_frontend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abdul-ahad2/plagiarism_detection_frontend
- Repository: https://github.com/abdul-ahad2/plagiarism_detection_frontend

## Overview

##### Project type and purpose
- This is a full-stack web application built with Next.js (using the new App Router).
- The README confirms it’s a Next.js app bootstrapped via create-next-app, intended for user authentication (login/register) and a role-based dashboard (researcher, student, teacher).

##### File structure
- Top-level:
- package.json, next.config.mjs, eslint.config.mjs, etc. – configuration & build scripts.
- public/ – static assets (images, fonts).
- src/app/ – Next.js App Router directory.
- Inside src/app/:
- (public)/ – root-level public pages (login, register, landing).
- dashboard/ – protected area with sub-folders per user role: researcher, student (with analytics, report, upload, settings), teacher.
- layout.js files define shared UI wrappers at each route segment.
- page.js files are route entry points.
- src/components/ – reusable React components (navbars for each role, report cards, footer, etc.).

##### README
- Confirms Next.js, dev commands, use of next/font for font optimization.
- Mentions Vercel as a preferred deployment target (implying serverless functions / ISR possible).

##### Elements
- Labels: Client, Next.js App, CDN, Auth Service, Database
- Request/Response flows (Client → App → Data Services → App → Client)
- Static asset retrieval (App → CDN → Client)
- Frontend/UI (e.g., blue rectangles)
- Server / Business Logic (e.g., green rectangles)

## Diagram (Mermaid)

```mermaid
flowchart TD
    Client["Browser / Client"]:::external

    subgraph "Next.js App (App Router)"
        direction TB
        AppRouter["App Router"]:::backend

        subgraph "Public Routes"
            direction TB
            PublicLayout["(public) Layout"]:::frontend
            LandingPage["Landing Page"]:::frontend
            LoginPage["Login Page"]:::frontend
            RegisterPage["Register Page"]:::frontend
        end

        subgraph "Dashboard Routes"
            direction TB
            DashboardLayout["dashboard Layout"]:::backend

            subgraph "Researcher"
                direction TB
                ResLayout["Researcher Layout"]:::frontend
                ResPage["Researcher Page"]:::frontend
            end

            subgraph "Student"
                direction TB
                StuLayout["Student Layout"]:::frontend
                AnalyticsPage["Analytics Page"]:::frontend
                ReportPage["Report Page"]:::frontend
                ReportDetail["Report Detail [reportId] Page"]:::frontend
                UploadPage["Upload Page"]:::frontend
                SettingsPage["Settings Page"]:::frontend
            end

            subgraph "Teacher"
                direction TB
                TeachLayout["Teacher Layout"]:::frontend
                TeachPage["Teacher Page"]:::frontend
            end
        end

        subgraph "Shared Components"
            direction TB
            Navbar["Navbar"]:::frontend
            ResNavbar["ResearcherNavbar"]:::frontend
            StuNavbar["StudentNavbar"]:::frontend
            TeachNavbar["TeacherNavbar"]:::frontend
            ReportCard["ReportCard"]:::frontend
            DetailCard["DetailCard"]:::frontend
            StatCard["StatCard"]:::frontend
            TabButton["TabButton"]:::frontend
            RotatingBox["RotatingBox"]:::frontend
            Footer["Footer"]:::frontend
        end

        GlobalLayout["Global Layout"]:::frontend
        GlobalStyles["globals.css"]:::frontend
    end

    CDN["CDN / Public Store"]:::external
    Auth["Auth Service"]:::external
    DB["Database"]:::database

    Client -->|"HTTP Requests"| AppRouter
    Client -->|"Fetch Static Assets"| CDN
    AppRouter -->|"Serve Static"| CDN
    AppRouter -->|"Auth & Session"| Auth
    AppRouter -->|"Read/Write Data"| DB

    classDef frontend fill:#D0E6FF,stroke:#0366D6,color:#0366D6;
    classDef backend fill:#D6F5D6,stroke:#2C662D,color:#2C662D;
    classDef database fill:#FFE9CC,stroke:#CC8400,color:#CC8400;
    classDef external fill:#F0E6FF,stroke:#6A33FF,color:#6A33FF;

    click AppRouter "https://github.com/abdul-ahad2/plagiarism_detection_frontend/tree/main/src/app/"
    click PublicLayout "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/(public)/layout.js"
    click LandingPage "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/(public)/page.js"
    click LoginPage "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/(public)/login/page.js"
    click RegisterPage "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/(public)/register/page.js"
    click DashboardLayout "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/dashboard/layout.js"
    click ResLayout "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/dashboard/researcher/layout.js"
    click ResPage "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/dashboard/researcher/page.js"
    click StuLayout "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/dashboard/student/layout.js"
    click AnalyticsPage "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/dashboard/student/analytics/page.js"
    click ReportPage "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/dashboard/student/report/page.js"
    click ReportDetail "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/dashboard/student/report/[reportId]/page.js"
    click UploadPage "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/dashboard/student/upload/page.js"
    click SettingsPage "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/dashboard/student/settings/page.js"
    click TeachLayout "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/dashboard/teacher/layout.js"
    click TeachPage "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/dashboard/teacher/page.js"
    click GlobalLayout "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/layout.js"
    click GlobalStyles "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/app/globals.css"
    click Navbar "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/components/navbars/Navbar.jsx"
    click ResNavbar "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/components/navbars/ResearcherNavbar.jsx"
    click StuNavbar "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/components/navbars/StudentNavbar.jsx"
    click TeachNavbar "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/components/navbars/TeacherNavbar.jsx"
    click ReportCard "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/components/report/ReportCard.jsx"
    click DetailCard "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/components/report/DetailCard.jsx"
    click StatCard "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/components/report/StatCard.jsx"
    click TabButton "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/components/report/TabButton.jsx"
    click RotatingBox "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/components/RotatingBox.jsx"
    click Footer "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/src/components/Footer.jsx"
    click CDN "https://github.com/abdul-ahad2/plagiarism_detection_frontend/tree/main/public/"
    click package.json "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/package.json"
    click next.config.mjs "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/next.config.mjs"
    click eslint.config.mjs "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/eslint.config.mjs"
    click postcss.config.mjs "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/postcss.config.mjs"
    click jsconfig.json "https://github.com/abdul-ahad2/plagiarism_detection_frontend/blob/main/jsconfig.json"
```
