Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ac89810
Merge pull request #16 from dewank07/main
dewank07 May 29, 2025
4c60b3b
GFG | improve : page performance boosted to 95+ (#19)
kartikey2004-git May 30, 2025
ae8809b
ELX | refactor: Performance Improvements (#6)
dewank07 May 30, 2025
79060fc
GFG | chore: package.json cleanup, update layout name
dewank07 May 30, 2025
43d7aa5
GFG | chore: cleanup code base (#21)
dewank07 May 31, 2025
81c7fdb
GFG | refactor: updated navbar (#20)
vaibhavxtripathi May 31, 2025
f9619c1
GFG | fix: wrapper layout, design, fonts
dewank07 May 31, 2025
19e6ec2
adding-link-chapter-section
Akash-1808 Jan 1, 2025
5cf2a16
change-Link-tag
Akash-1808 Jan 4, 2025
69da3b6
Fixed "Our Events" acting as a link
vaibhavxtripathi Dec 30, 2024
02639b0
Updated "Our Events" heading
vaibhavxtripathi Dec 30, 2024
afe58a9
Updated Readme.md (#10)
vaibhavxtripathi Dec 30, 2024
5b0cfbb
Removed section tab which caused redundant links
PrakharJain345 Jan 18, 2025
17a8b3a
feat: added readme and fixed heading issue (#2)
dewank07 Dec 30, 2024
3349a07
fix: image optimization
dewank07 Jan 4, 2025
e66dfb9
GFG | improve : page performance boosted to 95+ (#19)
kartikey2004-git May 30, 2025
67732b7
GFG | chore: package.json cleanup, update layout name
dewank07 May 30, 2025
51752fe
GFG | chore: cleanup code base (#21)
dewank07 May 31, 2025
25848d7
GFG | refactor: updated navbar (#20)
vaibhavxtripathi May 31, 2025
87e13b7
GFG | fix: wrapper layout, design, fonts
dewank07 May 31, 2025
6cdc2f5
Merge pull request #9 from ElixirTechCommunity/dev-fork-sync
dewank07 May 31, 2025
6d55e5a
ELX | fix: build errors
dewank07 May 31, 2025
81ca139
Merge branch 'main' into dev-fork-sync
dewank07 May 31, 2025
15e349a
Merge pull request #23 from ElixirTechCommunity/dev-fork-sync
dewank07 May 31, 2025
b3cf84f
Merge branch 'dev' into main
dewank07 May 31, 2025
fb45fb5
Merge pull request #8 from ElixirTechCommunity/main
dewank07 May 31, 2025
410ac80
ELX | Feat: dashboards (frontend), Ench: performance improvements, r…
dragon-slayer875 Jun 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/.vscode
/node_modules
./dist

*.env
.env
.env.*
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": false,
"bracketSpacing": true,
"tabWidth": 2,
"trailingComma": "es5",
"semi": true
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.wordWrap": "on"
"editor.wordWrap": "on",
"postman.settings.dotenv-detection-notification-visibility": false
}
95 changes: 95 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Contributing Guidelines

Thank you for your interest in contributing to this project! We welcome contributions from the community. Please read the following guidelines to help us maintain a high standard and streamline the contribution process.

## How to Contribute

1. **Fork the Repository**

- Click the 'Fork' button at the top right of this repository page to create your own copy.

2. **Clone Your Fork**

- Clone your forked repository to your local machine:
```bash
git clone https://github.com/<your-username>/ElixirV3.git
cd ElixirV3
```

3. **Create a New Branch**

- Create a branch for your feature or bugfix:
```bash
git checkout -b <branch-name>
```

4. **Make Your Changes**

- Make your changes or additions. Please ensure your code follows the existing style and conventions.

5. **Test Your Changes**

- Run the application and ensure your changes work as expected and do not break existing functionality.

6. **Commit Your Changes**

- Use clear and descriptive commit messages. Follow the commit message format below.

7. **Push to Your Fork**

- Push your branch to your forked repository:
```bash
git push origin <branch-name>
```

8. **Open a Pull Request**
- Go to the original repository and open a pull request. Provide a clear description of your changes and reference any related issues.

## Commit Message Format

```
<TEAM> | <type>(<scope>): <description>
```

### Examples

```
GFG | feat(event): new card designs
GFG | fix(event): api request improve
GFG | chore(event): title copy change
GFG | refactor(event): mentor's search logic

ELX | feat(event): new card designs
GDG | fix(event): api request improve
CC | chore(event): title copy change
```

- `<TEAM>`: Team code. If you are a member of one of the Elixir clubs, use your club's code:

- `GFG` for GeeksforGeeks ABESEC
- `GDG` for Google Developer Group ABESEC
- `CC` for CodeChef ABESEC
- `ELX` for external contributers

- `<type>`: Type of change (feat, fix, chore, refactor, etc.)
- `<scope>`: Area affected (e.g., event)
- `<description>`: Short summary of the change

## Code Style & Standards

- Follow the existing code style and formatting.
- Write clear, concise, and well-documented code.
- Add comments where necessary, especially for complex logic.
- Write tests for new features or bug fixes if applicable.

## Community Standards

- Be respectful and inclusive in all interactions.
- Provide constructive feedback in code reviews.
- Report issues or bugs using the issue tracker.

## Need Help?

If you have any questions or need guidance, feel free to open an issue or reach out to the maintainers.

Thank you for contributing!
254 changes: 254 additions & 0 deletions app/dashboard/admin/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
"use client";
import { useState } from "react";
import { AnimatePresence } from "framer-motion";
import WelcomeSection from "../components/WelcomeSection";
import ManagementSection from "../components/ManagementSection";
import Modal from "../components/Modal";
import StatsCards from "../components/StatsCards";
import { ColorScheme } from "../types";

// Mock Data
const mockStudents = [
{
id: 1,
name: "Vaibhav Tripathi",
email: "[email protected]",
role: "Student",
joinDate: "2024-01-15",
},
{
id: 2,
name: "Akash Chaudhary",
email: "[email protected]",
role: "Student",
joinDate: "2024-02-01",
},
{
id: 3,
name: "Shreyash Singh",
email: "[email protected]",
role: "Club Head",
joinDate: "2024-01-20",
},
];

const mockMentors = [
{
id: 1,
name: "Dewank Rastogi",
expertise: "Frontend",
achievements: "3+ years experience",
status: "Active",
},
{
id: 2,
name: "Rudraksh Tyagi",
expertise: "Open Source",
achievements: "LFX",
status: "Active",
},
{
id: 3,
name: "Vandit Singh",
expertise: "DevOps",
achievements: "Google Summer of Code",
status: "Active",
},
];

const mockEvents = [
{
id: 1,
name: "Binary Vault",
club: "GFG_ABESEC",
date: "2024-03-15",
participants: 450,
},
{
id: 2,
name: "Hackhaven",
club: "GDG_ABESEC",
date: "2024-03-20",
participants: 320,
},
{
id: 3,
name: "Some Event",
club: "CodeChef_ABESEC",
date: "2024-03-25",
participants: 280,
},
];

const mockBlogs = [
{
id: 1,
title: "Future of AI",
author: "Priya Kumari",
status: "Pending",
date: "2024-03-10",
},
{
id: 2,
title: "Web Development Trends",
author: "Radhika Chauhan",
status: "Approved",
date: "2024-03-08",
},
{
id: 3,
title: "Cloud Computing Basics",
author: "Granth Agarwal",
status: "Pending",
date: "2024-03-09",
},
];

const AdminDashboard = () => {
const [activeModal, setActiveModal] = useState<string | null>(null);
const [selectedItem, setSelectedItem] = useState<any>(null);

const openModal = (modalType: string, item?: any) => {
setActiveModal(modalType);
if (item) setSelectedItem(item);
};

const closeModal = () => {
setActiveModal(null);
setSelectedItem(null);
};

const adminStats = [
{
heading: "1.2k",
subheading: "Total Students",
description: "+120 this month",
colorScheme: "purple" as ColorScheme,
},
{
heading: "45",
subheading: "Upcoming Events",
description: "Next: 3 days",
colorScheme: "blue" as ColorScheme,
},
{
heading: "8",
subheading: "Blog Submissions",
description: "3 pending approval",
colorScheme: "green" as ColorScheme,
},
{
heading: "24",
subheading: "Mentors",
description: "5 new additions",
colorScheme: "orange" as ColorScheme,
},
];

const renderModalContent = () => {
if (!selectedItem) return null;
return (
<div className="space-y-2">
<table className="w-full text-left">
<tbody>
{Object.entries(selectedItem).map(([key, value]) => (
<tr key={key}>
<td className="pr-4 font-semibold text-white/80 capitalize">
{key}
</td>
<td className="text-white/60">{String(value)}</td>
</tr>
))}
</tbody>
</table>
</div>
);
};

return (
<>
<div className="flex flex-col gap-8 w-full max-w-6xl mx-auto lg:mt-38 mt-20">
<WelcomeSection
title="Admin Dashboard"
description="Manage your community and monitor platform metrics."
/>

<div className="grid grid-cols-1 md:grid-cols-4 gap-6">
{adminStats.map((stat, idx) => (
<StatsCards
key={idx}
heading={stat.heading}
subheading={stat.subheading}
description={stat.description}
colorScheme={stat.colorScheme}
/>
))}
</div>

<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
<ManagementSection
title="Student Management"
data={mockStudents}
columns={[
{ header: "Name", accessor: (row) => row.name },
{ header: "Role", accessor: (row) => row.role },
{ header: "Join Date", accessor: (row) => row.joinDate },
]}
onViewAll={() => openModal("students")}
onRowClick={(item) => openModal("Student Details", item)}
/>

<ManagementSection
title="Mentor Management"
data={mockMentors}
columns={[
{ header: "Name", accessor: (row) => row.name },
{ header: "Expertise", accessor: (row) => row.expertise },
{ header: "Status", accessor: (row) => row.status },
]}
onViewAll={() => openModal("mentors")}
onRowClick={(item) => openModal("Mentor Details", item)}
/>

<ManagementSection
title="Event Management"
data={mockEvents}
columns={[
{ header: "Event", accessor: (row) => row.name },
{ header: "Club", accessor: (row) => row.club },
{ header: "Date", accessor: (row) => row.date },
]}
onViewAll={() => openModal("events")}
onRowClick={(item) => openModal("Event Details", item)}
/>

<ManagementSection
title="Blog Management"
data={mockBlogs}
columns={[
{ header: "Title", accessor: (row) => row.title },
{ header: "Author", accessor: (row) => row.author },
{ header: "Status", accessor: (row) => row.status },
]}
onViewAll={() => openModal("blogs")}
onRowClick={(item) => openModal("Blog Details", item)}
/>
</div>
</div>

<AnimatePresence>
{activeModal && (
<Modal
isOpen={true}
onClose={closeModal}
title={activeModal.charAt(0).toUpperCase() + activeModal.slice(1)}
>
{renderModalContent()}
</Modal>
)}
</AnimatePresence>
</>
);
};

export default AdminDashboard;
Loading