# harishpullagurla/astrix architecture

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

- Interactive diagram: https://gitdiagram.com/harishpullagurla/astrix
- Repository: https://github.com/harishpullagurla/astrix

## Overview

Astrix is an academic resource-sharing platform for IIITDMJ. Students browse or search papers, unlock paid resources with AST coins, upload contributions, and participate in community Insights; personalized profile and library views support that workflow. Server actions handle resource, post, and account operations against MongoDB, with uploads also using file storage and Gemini auditing. The README documents curriculum mapping, moderation, reward throttling, and contribution analytics, but sampled excerpts do not establish every implementation link, so those relationships are not expanded. Some route and dashboard behavior is represented from the index and README.

Main entry points: [`src/lib/actions.ts`](https://github.com/harishpullagurla/astrix/blob/main/src/lib/actions.ts) (Server actions), [`src/auth.ts`](https://github.com/harishpullagurla/astrix/blob/main/src/auth.ts) (Authentication), [`src/components/upload-modal.tsx`](https://github.com/harishpullagurla/astrix/blob/main/src/components/upload-modal.tsx) (Upload form), [`src/components/ui/button.tsx`](https://github.com/harishpullagurla/astrix/blob/main/src/components/ui/button.tsx) (UI primitives)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Student experience"]
  node_browse["Paper browse<br/>[browse-client.tsx]"]
  node_explorer["Academic explorer"]
  node_insights["Community insights"]
  node_library["Resource library<br/>[library-client.tsx]"]
  node_dashboard["Dashboard"]
  node_profile["Personal profile<br/>[page.tsx]"]
  node_navbar["Navigation<br/>[navbar.tsx]"]
  node_ui["UI primitives<br/>[button.tsx]"]
end

subgraph group_contribution["Resource contribution"]
  node_upload["Upload form<br/>[upload-modal.tsx]"]
end

subgraph group_services["Domain services"]
  node_actions["Server actions<br/>[actions.ts]"]
  node_auth["Authentication<br/>[auth.ts]"]
  node_authconfig["Auth configuration<br/>[auth.config.ts]"]
  node_gemini{{"Gemini auditing"}}
  node_blob[("Blob file storage")]
end

subgraph group_persistence["Identity and data"]
  node_database[("MongoDB<br/>[db.ts]")]
  node_resource[("Resource records<br/>[Resource.ts]")]
  node_user[("User records<br/>[User.ts]")]
  node_post[("Insight posts<br/>[Post.ts]")]
  node_unlock[("Unlock records<br/>[Unlock.ts]")]
end

node_student(("Student"))

node_student -.->|"searches"| node_browse
node_student -.->|"contributes"| node_upload
node_browse -->|"requests papers"| node_actions
node_explorer -->|"searches and unlocks"| node_actions
node_insights -->|"posts and votes"| node_actions
node_upload -->|"submits upload"| node_actions
node_dashboard -->|"opens form"| node_upload
node_actions -->|"checks session"| node_auth
node_auth -->|"uses configuration"| node_authconfig
node_auth -->|"connects"| node_database
node_auth -->|"reads and creates"| node_user
node_actions -->|"connects"| node_database
node_actions -->|"reads and writes"| node_resource
node_actions -->|"reads and writes"| node_user
node_actions -->|"reads and writes"| node_post
node_actions -->|"uses unlock records"| node_unlock
node_actions -->|"audits uploads"| node_gemini
node_actions -->|"stores files"| node_blob
node_library -.->|"loads library"| node_actions
node_profile -->|"uses account actions"| node_actions
node_navbar -->|"signs out"| node_actions
node_browse -->|"renders controls"| node_ui
node_explorer -->|"renders controls"| node_ui
node_insights -->|"renders controls"| node_ui
node_upload -->|"renders controls"| node_ui

click node_browse "https://github.com/harishpullagurla/astrix/blob/main/src/app/browse/browse-client.tsx"
click node_explorer "https://github.com/harishpullagurla/astrix/blob/main/src/app/explorer/explorer-client.tsx"
click node_insights "https://github.com/harishpullagurla/astrix/blob/main/src/app/insights/insights-client.tsx"
click node_library "https://github.com/harishpullagurla/astrix/blob/main/src/app/library/library-client.tsx"
click node_dashboard "https://github.com/harishpullagurla/astrix/blob/main/src/app/dashboard/dashboard-client.tsx"
click node_profile "https://github.com/harishpullagurla/astrix/blob/main/src/app/profile/page.tsx"
click node_navbar "https://github.com/harishpullagurla/astrix/blob/main/src/components/navbar.tsx"
click node_upload "https://github.com/harishpullagurla/astrix/blob/main/src/components/upload-modal.tsx"
click node_actions "https://github.com/harishpullagurla/astrix/blob/main/src/lib/actions.ts"
click node_auth "https://github.com/harishpullagurla/astrix/blob/main/src/auth.ts"
click node_authconfig "https://github.com/harishpullagurla/astrix/blob/main/src/auth.config.ts"
click node_database "https://github.com/harishpullagurla/astrix/blob/main/src/lib/db.ts"
click node_resource "https://github.com/harishpullagurla/astrix/blob/main/src/models/Resource.ts"
click node_user "https://github.com/harishpullagurla/astrix/blob/main/src/models/User.ts"
click node_post "https://github.com/harishpullagurla/astrix/blob/main/src/models/Post.ts"
click node_unlock "https://github.com/harishpullagurla/astrix/blob/main/src/models/Unlock.ts"
click node_ui "https://github.com/harishpullagurla/astrix/blob/main/src/components/ui/button.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_browse,node_explorer,node_insights,node_library,node_dashboard,node_profile,node_navbar,node_ui toneBlue
class node_upload toneAmber
class node_actions,node_auth,node_authconfig,node_gemini,node_blob toneMint
class node_database,node_resource,node_user,node_post,node_unlock toneRose
class node_student toneIndigo
```

## Components

### Student experience

- [Paper browse](https://github.com/harishpullagurla/astrix/blob/main/src/app/browse/browse-client.tsx): `src/app/browse/browse-client.tsx`
- [Academic explorer](https://github.com/harishpullagurla/astrix/blob/main/src/app/explorer/explorer-client.tsx): `src/app/explorer/explorer-client.tsx`
- [Community insights](https://github.com/harishpullagurla/astrix/blob/main/src/app/insights/insights-client.tsx): `src/app/insights/insights-client.tsx`
- [Resource library](https://github.com/harishpullagurla/astrix/blob/main/src/app/library/library-client.tsx): `src/app/library/library-client.tsx`
- [Dashboard](https://github.com/harishpullagurla/astrix/blob/main/src/app/dashboard/dashboard-client.tsx): `src/app/dashboard/dashboard-client.tsx`
- [Personal profile](https://github.com/harishpullagurla/astrix/blob/main/src/app/profile/page.tsx): `src/app/profile/page.tsx`
- [Navigation](https://github.com/harishpullagurla/astrix/blob/main/src/components/navbar.tsx): `src/components/navbar.tsx`
- [UI primitives](https://github.com/harishpullagurla/astrix/blob/main/src/components/ui/button.tsx): `src/components/ui/button.tsx`

### Resource contribution

- [Upload form](https://github.com/harishpullagurla/astrix/blob/main/src/components/upload-modal.tsx): `src/components/upload-modal.tsx`

### Domain services

- [Server actions](https://github.com/harishpullagurla/astrix/blob/main/src/lib/actions.ts): `src/lib/actions.ts`
- [Authentication](https://github.com/harishpullagurla/astrix/blob/main/src/auth.ts): `src/auth.ts`
- [Auth configuration](https://github.com/harishpullagurla/astrix/blob/main/src/auth.config.ts): `src/auth.config.ts`
- **Gemini auditing**
- **Blob file storage**

### Identity and data

- [MongoDB](https://github.com/harishpullagurla/astrix/blob/main/src/lib/db.ts): `src/lib/db.ts`
- [Resource records](https://github.com/harishpullagurla/astrix/blob/main/src/models/Resource.ts): `src/models/Resource.ts`
- [User records](https://github.com/harishpullagurla/astrix/blob/main/src/models/User.ts): `src/models/User.ts`
- [Insight posts](https://github.com/harishpullagurla/astrix/blob/main/src/models/Post.ts): `src/models/Post.ts`
- [Unlock records](https://github.com/harishpullagurla/astrix/blob/main/src/models/Unlock.ts): `src/models/Unlock.ts`

### Other components

- **Student**

## Connections

- Student → Paper browse: searches
- Student → Upload form: contributes
- Paper browse → Server actions: requests papers (evidence: `src/app/browse/browse-client.tsx`)
- Academic explorer → Server actions: searches and unlocks (evidence: `src/app/explorer/explorer-client.tsx`)
- Community insights → Server actions: posts and votes (evidence: `src/app/insights/insights-client.tsx`)
- Upload form → Server actions: submits upload (evidence: `src/components/upload-modal.tsx`)
- Dashboard → Upload form: opens form (evidence: `src/app/dashboard/dashboard-client.tsx`)
- Server actions → Authentication: checks session (evidence: `src/lib/actions.ts`)
- Authentication → Auth configuration: uses configuration (evidence: `src/auth.ts`)
- Authentication → MongoDB: connects (evidence: `src/auth.ts`)
- Authentication → User records: reads and creates (evidence: `src/auth.ts`)
- Server actions → MongoDB: connects (evidence: `src/lib/actions.ts`)
- Server actions → Resource records: reads and writes (evidence: `src/lib/actions.ts`)
- Server actions → User records: reads and writes (evidence: `src/lib/actions.ts`)
- Server actions → Insight posts: reads and writes (evidence: `src/lib/actions.ts`)
- Server actions → Unlock records: uses unlock records (evidence: `src/lib/actions.ts`)
- Server actions → Gemini auditing: audits uploads (evidence: `src/lib/actions.ts`)
- Server actions → Blob file storage: stores files (evidence: `src/lib/actions.ts`)
- Resource library → Server actions: loads library (evidence: `src/app/library/page.tsx`)
- Personal profile → Server actions: uses account actions (evidence: `src/app/profile/page.tsx`)
- Navigation → Server actions: signs out (evidence: `src/components/navbar.tsx`)
- Paper browse → UI primitives: renders controls (evidence: `src/app/browse/browse-client.tsx`)
- Academic explorer → UI primitives: renders controls (evidence: `src/app/explorer/explorer-client.tsx`)
- Community insights → UI primitives: renders controls (evidence: `src/app/insights/insights-client.tsx`)
- Upload form → UI primitives: renders controls (evidence: `src/components/upload-modal.tsx`)
