diff --git a/src/deda_frontend/components.json b/src/deda_frontend/components.json
new file mode 100644
index 0000000..fb5b4e6
--- /dev/null
+++ b/src/deda_frontend/components.json
@@ -0,0 +1,20 @@
+{
+ "$schema": "https://ui.shadcn.com/schema.json",
+ "style": "new-york",
+ "rsc": false,
+ "tsx": true,
+ "tailwind": {
+ "config": "tailwind.config.js",
+ "css": "src/index.scss",
+ "baseColor": "neutral",
+ "cssVariables": true,
+ "prefix": ""
+ },
+ "aliases": {
+ "components": "@/components",
+ "utils": "@/lib/utils",
+ "ui": "@/components/ui",
+ "lib": "@/lib",
+ "hooks": "@/hooks"
+ }
+}
\ No newline at end of file
diff --git a/src/deda_frontend/package.json b/src/deda_frontend/package.json
index d17f182..e978069 100644
--- a/src/deda_frontend/package.json
+++ b/src/deda_frontend/package.json
@@ -14,11 +14,22 @@
"@dfinity/agent": "^1.4.0",
"@dfinity/candid": "^1.4.0",
"@dfinity/principal": "^1.4.0",
+ "@radix-ui/react-icons": "^1.3.0",
+ "@radix-ui/react-scroll-area": "^1.2.0",
+ "@radix-ui/react-separator": "^1.1.0",
+ "@radix-ui/react-slot": "^1.1.0",
+ "@radix-ui/react-switch": "^1.1.1",
+ "@radix-ui/react-tabs": "^1.1.1",
"axios": "^1.7.2",
+ "class-variance-authority": "^0.7.0",
+ "clsx": "^2.1.1",
"ic-auth": "^0.9.1",
+ "lucide-react": "^0.453.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
- "recoil": "^0.7.7"
+ "recoil": "^0.7.7",
+ "tailwind-merge": "^2.5.4",
+ "tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@dfinity/auth-client": "^1.4.0",
@@ -27,11 +38,11 @@
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@vitejs/plugin-react": "^4.0.1",
- "autoprefixer": "^10.4.19",
+ "autoprefixer": "^10.4.20",
"dotenv": "^16.4.5",
- "postcss": "^8.4.38",
+ "postcss": "^8.4.47",
"sass": "^1.63.6",
- "tailwindcss": "^3.4.4",
+ "tailwindcss": "^3.4.14",
"typescript": "^5.1.3",
"vite": "^4.3.9",
"vite-plugin-environment": "^1.1.3"
diff --git a/src/deda_frontend/src/App.tsx b/src/deda_frontend/src/App.tsx
index fec003e..cea524a 100644
--- a/src/deda_frontend/src/App.tsx
+++ b/src/deda_frontend/src/App.tsx
@@ -1,26 +1,29 @@
-import React from 'react';
-import { RecoilRoot, useRecoilValue } from 'recoil';
-import Login from './components/Login';
-import DataRequestList from './components/DataRequestList';
-import SubmitData from './components/SubmitData';
-import VerifyData from './components/VerifyData';
-import StoreCleanedData from './components/StoreCleanedData';
-import AddDataRequest from './components/AddDataRequest';
-import PayContributors from './components/PayContributors';
-//import './App.css';
-import { userState } from './state/userState';
+import React from "react";
+import { RecoilRoot, useRecoilValue } from "recoil";
+import MainPage from "./Pages/Main/MainPage";
+import Login from "./components/Login";
+import DataRequestList from "./components/DataRequestList";
+import SubmitData from "./components/SubmitData";
+import VerifyData from "./components/VerifyData";
+import StoreCleanedData from "./components/StoreCleanedData";
+import AddDataRequest from "./components/AddDataRequest";
+import PayContributors from "./components/PayContributors";
+import "./App.css";
+import { userState } from "./state/userState";
const AppContent: React.FC = () => {
const user = useRecoilValue(userState);
return (
-
DeDa - Decentralized Data Marketplace
+
+ DeDa - Decentralized Data Marketplace
+
- {user.role === 'Researcher' &&
}
+ {user.role === "Researcher" &&
}
- {user.role === 'User' &&
}
- {user.role === 'Validator' && (
+ {user.role === "User" &&
}
+ {user.role === "Validator" && (
<>
@@ -33,7 +36,8 @@ const AppContent: React.FC = () => {
const App: React.FC = () => (
-
+ {/* */}
+
);
diff --git a/src/deda_frontend/src/Pages/Main/MainPage.tsx b/src/deda_frontend/src/Pages/Main/MainPage.tsx
new file mode 100644
index 0000000..ced5da2
--- /dev/null
+++ b/src/deda_frontend/src/Pages/Main/MainPage.tsx
@@ -0,0 +1,185 @@
+import React, { useState } from "react";
+import {
+ Bell,
+ ChevronDown,
+ Home,
+ Search,
+ Settings,
+ User,
+ Database,
+ FileCheck,
+ DollarSign,
+} from "lucide-react";
+import { Button } from "../../components/ui/button";
+import { ScrollArea } from "../../components/ui/scroll-area";
+import { Separator } from "../../components/ui/separator";
+import { Switch } from "../../components/ui/switch";
+import {
+ Tabs,
+ TabsContent,
+ TabsList,
+ TabsTrigger,
+} from "../../components/ui/tabs";
+import CompletedTasks from "../../components/Tasks/CompletedTasks";
+import ResearcherDashboard from "../../components/Dashboards/ResearcherDashBoard";
+import PublisherDashboard from "../../components/Dashboards/PublisherDashBoard";
+import ValidatorDashboard from "../../components/Dashboards/ValidatorDashBoard";
+
+export default function MainPage() {
+ const [activeRole, setActiveRole] = useState("researcher");
+
+ return (
+
+ {/* Left Sidebar */}
+
+
DEDA
+
+
+
+
+
+
+
+ {/* Main Content */}
+
+ {/* Top Bar */}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/* Content Area */}
+
+
+
+
+ Active
+
+
+ Completed
+
+
+
+ {activeRole === "researcher" && }
+ {activeRole === "publisher" && }
+ {activeRole === "validator" && }
+
+
+
+
+
+
+
+
+ {/* Right Sidebar */}
+
+
Statistics
+
+
+ Total Datasets
+ 1,234
+
+
+ Active Requests
+ 56
+
+
+ Pending Validations
+ 23
+
+
+
+
+
+ Notifications
+
+
+
+ Auto-match Requests
+
+
+
+
+
Recent Activity
+
+
New dataset submitted for NLP task
+
Validation completed for Image Classification data
+
Reward distributed for Sentiment Analysis contribution
+
+
+
+ );
+}
diff --git a/src/deda_frontend/src/components/AddDataRequest.tsx b/src/deda_frontend/src/components/AddDataRequest.tsx
index 86e4870..2c5c19b 100644
--- a/src/deda_frontend/src/components/AddDataRequest.tsx
+++ b/src/deda_frontend/src/components/AddDataRequest.tsx
@@ -1,27 +1,35 @@
-import React, { useState } from 'react';
-import { Actor, HttpAgent } from '@dfinity/agent';
-import { idlFactory } from '../../../declarations/deda_backend';
+import React, { useState } from "react";
+import { Actor, HttpAgent } from "@dfinity/agent";
+import { idlFactory } from "../../../declarations/deda_backend";
const agent = new HttpAgent();
-agent.fetchRootKey().catch(err => {
- console.warn('Unable to fetch root key. Check to ensure that your local replica is running');
+agent.fetchRootKey().catch((err) => {
+ console.warn(
+ "Unable to fetch root key. Check to ensure that your local replica is running"
+ );
console.error(err);
});
-const backend = Actor.createActor(idlFactory as any, { agent, canisterId: process.env.CANISTER_ID_DEDA_BACKEND as string });
+const backend = Actor.createActor(idlFactory as any, {
+ agent,
+ canisterId: process.env.CANISTER_ID_DEDA_BACKEND as string,
+});
const AddDataRequest: React.FC = () => {
- const [description, setDescription] = useState
('');
- const [reward, setReward] = useState('');
- const [response, setResponse] = useState('');
+ const [description, setDescription] = useState("");
+ const [reward, setReward] = useState("");
+ const [response, setResponse] = useState("");
const addDataRequest = async () => {
try {
- const requestId = await backend.add_data_request(description, BigInt(reward));
+ const requestId = await backend.add_data_request(
+ description,
+ BigInt(reward)
+ );
console.log(requestId);
setResponse(`Data request added successfully with ID: ${requestId}`);
} catch (error) {
- console.error(error)
- setResponse('Error adding data request');
+ console.error(error);
+ setResponse("Error adding data request");
}
};
@@ -42,7 +50,10 @@ const AddDataRequest: React.FC = () => {
onChange={(e) => setReward(e.target.value)}
className="p-2 border rounded mb-2"
/>
-