154 |
155 |
156 | {!isAdminRoute && (
157 | <>
158 |
162 | Get Case Details
163 |
164 |
168 | Register
169 |
170 |
174 | Login
175 |
176 | >
177 | )}
178 | {isAdminRoute ? (
179 | <>
180 |
184 | Register New Case
185 |
186 |
190 | Search Case Details
191 |
192 |
196 | Logout
197 |
198 | >
199 | ) : (
200 | <>>
201 | )}
202 | {!isMetamaskConnected ? (
203 |
207 | Connect Metamask
208 |
209 | ) : (
210 |
211 | Metamask Connected
212 |
213 | )}
214 |
215 |
216 | Project E-Vault
217 |
218 |
219 | )}
220 |
221 | );
222 | };
223 |
224 | export default Navbar;
225 |
--------------------------------------------------------------------------------
/frontend-vite/src/components/ProjectStatistics.jsx:
--------------------------------------------------------------------------------
1 | import React, {useEffect, useState} from "react";
2 | import {
3 | LineChart,
4 | Line,
5 | XAxis,
6 | YAxis,
7 | CartesianGrid,
8 | Legend,
9 | ResponsiveContainer,
10 | Tooltip,
11 | } from "recharts";
12 |
13 | // this data can be from api or other js files
14 | const data = [
15 | {
16 | name: "Jan-23",
17 | client: 26,
18 | lawyer: 6,
19 | judge: 1,
20 | cases: 15,
21 | },
22 | {
23 | name: "Apr-23",
24 | client: 41,
25 | lawyer: 15,
26 | judge: 13,
27 | cases: 16,
28 | },
29 | {
30 | name: "Jul-23",
31 | client: 42,
32 | lawyer: 32,
33 | judge: 13,
34 | cases: 36,
35 | },
36 | {
37 | name: "Dec-23",
38 | client: 60,
39 | lawyer: 32,
40 | judge: 13,
41 | cases: 94,
42 | },
43 | {
44 | name: "Apr-24",
45 | client: 84,
46 | lawyer: 60,
47 | judge: 32,
48 | cases: 106,
49 | },
50 | ];
51 |
52 | const ProjectStatistics = () => {
53 | const [counters, setCounters] = useState({
54 | totalClients: 84,
55 | totalRegisteredLawyers: 60,
56 | totalRegisteredJudges: 32,
57 | totalRecordedCases: 106,
58 | });
59 |
60 | const counterSpeeds = {
61 | totalClients: 6000, // Counter 1 updates every 2 seconds
62 | totalRegisteredLawyers: 9000, // Counter 2 updates every 3 seconds
63 | totalRegisteredJudges: 30000, // Counter 3 updates every 10 seconds
64 | totalRecordedCases: 4500, // Counter 4 updates every 1.5 seconds
65 | };
66 |
67 | const counterHeadings = {
68 | totalClients: "Total Clients",
69 | totalRegisteredLawyers: "Total Lawyers",
70 | totalRegisteredJudges: "Total Judges",
71 | totalRecordedCases: "Total Cases",
72 | };
73 |
74 | useEffect(() => {
75 | const timers = {};
76 | for (const counter in counterSpeeds) {
77 | timers[counter] = setInterval(() => {
78 | setCounters((prevCounters) => ({
79 | ...prevCounters,
80 | [counter]: prevCounters[counter] + 1,
81 | }));
82 | }, counterSpeeds[counter]);
83 | }
84 |
85 | return () => {
86 | // Clear all timers on component unmount
87 | for (const counter in timers) {
88 | clearInterval(timers[counter]);
89 | }
90 | };
91 | }, []);
92 |
93 | return (
94 |
95 |
96 |
97 | Project Statistics
98 |
99 |
100 |
101 |
102 | {/* LeftSection >>> Data*/}
103 |
104 |
105 | {Object.entries(counters).map(([counter, value]) => (
106 |
110 |
111 | {counterHeadings[counter]}
112 |
113 |
114 | {value}
115 |
116 |
117 | ))}
118 |
119 |
120 |
121 | {/* RightSection >>> StaticticalChart*/}
122 |
123 |
124 |
125 |
126 |
127 |
134 |
142 |
143 |
144 |
152 |
160 |
168 |
176 |
177 |
178 |
179 |
180 |
181 | );
182 | };
183 |
184 | export default ProjectStatistics;
185 |
--------------------------------------------------------------------------------
/frontend-vite/src/components/RegisterANewCaseComponent.jsx:
--------------------------------------------------------------------------------
1 | import React, {useState} from "react";
2 | import registerNewCase from "../blockchain-api/registerNewCase";
3 |
4 | import {ToastContainer, toast} from "react-toastify";
5 | import "react-toastify/dist/ReactToastify.css";
6 |
7 | // Define the initial state
8 | const initialState = {
9 | UIDOfParty1: "",
10 | UIDOfParty2: "",
11 | caseSubject: "",
12 | associatedLawyers: [],
13 | };
14 |
15 | const RegisterANewCaseComponent = () => {
16 | const [formData, setFormData] = useState({...initialState});
17 |
18 | const handleSubmit = async (e) => {
19 | e.preventDefault();
20 |
21 | // Check if any of the required fields are empty
22 | if (
23 | !formData.UIDOfParty1 ||
24 | !formData.UIDOfParty2 ||
25 | !formData.caseSubject ||
26 | !formData.associatedLawyers.length
27 | ) {
28 | alert("Please fill in all the required fields.");
29 | return;
30 | }
31 |
32 | try {
33 | const registrationResponse = await registerNewCase(formData);
34 |
35 | // Customization: https://fkhadra.github.io/react-toastify/how-to-style/
36 | toast(`${registrationResponse}`, {
37 | position: "top-right",
38 | autoClose: 2000,
39 | closeOnClick: true,
40 | pauseOnHover: true,
41 | draggable: true,
42 | progress: undefined,
43 | icon: false,
44 | hideProgressBar: true,
45 | closeButton: false,
46 | });
47 |
48 | // resettingFormSubmission
49 | setFormData({...initialState});
50 | } catch (error) {
51 | console.error("Error during case registration: ", error);
52 | }
53 | };
54 |
55 | const handleChange = (e) => {
56 | const {name, value} = e.target;
57 | setFormData((prevData) => ({
58 | ...prevData,
59 | [name]: value,
60 | }));
61 | };
62 |
63 | return (
64 |
65 |
66 |
67 | Register A New Legal Case
68 |
69 |
70 |
127 |
128 |
129 |
133 |
134 | );
135 | };
136 |
137 | export default RegisterANewCaseComponent;
138 |
--------------------------------------------------------------------------------
/frontend-vite/src/components/SearchCaseDetailsComponent.jsx:
--------------------------------------------------------------------------------
1 | import React, {useState, useEffect} from "react";
2 | import {Link} from "react-router-dom";
3 |
4 | import getCaseDetailsByCaseID from "../blockchain-api/getCaseDetailsByCaseID";
5 | import getJudgeDetailsByUID from "@/blockchain-api/getJudgeDetailsByUID";
6 | import getLawyerDetailsByUID from "@/blockchain-api/getLawyerDetailsByUID";
7 | import getClientDetailsByUID from "@/blockchain-api/getClientDetailsByUID";
8 |
9 | const SearchCaseDetailsComponent = () => {
10 | const [caseID, setCaseID] = useState("");
11 | const [caseDetails, setCaseDetails] = useState(null);
12 |
13 | const [isUserJudge, setIsUserJudge] = useState(false);
14 | const [isUserLawyer, setIsUserLawyer] = useState(false);
15 | const [isUserClient, setIsUserClient] = useState(false);
16 |
17 | const [userAddress, setUserAddress] = useState(null);
18 |
19 | const handleSubmit = async (e) => {
20 | e.preventDefault();
21 |
22 | if (!caseID) {
23 | alert("Please fill in all the required fields.");
24 | return;
25 | }
26 |
27 | try {
28 | const caseDetails = await getCaseDetailsByCaseID(caseID);
29 | setCaseDetails(caseDetails);
30 | // console.log("Fetched case details:", caseDetails);
31 |
32 | checkForCaseAdmins(caseDetails);
33 | } catch (error) {
34 | console.error("Error fetching case details:", error);
35 | alert(
36 | "Error fetching case details. There's isn't any case registered with this caseID !"
37 | );
38 | }
39 | };
40 |
41 | // checkingIfCaseAdminsAreTryingToViewFurtherCaseDetails?
42 | const checkForCaseAdmins = async (caseDetails) => {
43 | const judgeDetails = await getJudgeDetailsByUID(
44 | caseDetails.associatedJudge,
45 | "walletAddress"
46 | );
47 |
48 | const lawyerDetails = await Promise.all(
49 | caseDetails.associatedLawyers.map(async (lawyerUID) => {
50 | const lawyerInfo = await getLawyerDetailsByUID(
51 | lawyerUID,
52 | "walletAddress"
53 | );
54 | return {
55 | walletAddress: lawyerInfo.walletAddress,
56 | };
57 | })
58 | );
59 |
60 | const party1Details = await getClientDetailsByUID(
61 | caseDetails.UIDOfParty1,
62 | "walletAddress"
63 | );
64 | const party2Details = await getClientDetailsByUID(
65 | caseDetails.UIDOfParty2,
66 | "walletAddress"
67 | );
68 |
69 | if (
70 | party1Details.walletAddress.toLowerCase() === userAddress.toLowerCase() ||
71 | party2Details.walletAddress.toLowerCase() === userAddress.toLowerCase()
72 | ) {
73 | setIsUserClient(true);
74 | } else {
75 | setIsUserClient(false);
76 | }
77 |
78 | if (
79 | lawyerDetails[0].walletAddress.toLowerCase() ===
80 | userAddress.toLowerCase() ||
81 | lawyerDetails[1].walletAddress.toLowerCase() === userAddress.toLowerCase()
82 | ) {
83 | setIsUserLawyer(true);
84 | } else {
85 | setIsUserLawyer(false);
86 | }
87 |
88 | if (
89 | judgeDetails.walletAddress.toLowerCase() === userAddress.toLowerCase()
90 | ) {
91 | setIsUserJudge(true);
92 | } else {
93 | setIsUserJudge(false);
94 | }
95 | };
96 |
97 | useEffect(() => {
98 | // Function to handle MetaMask account change
99 | const handleAccountChange = (accounts) => {
100 | setUserAddress(accounts[0]);
101 | };
102 |
103 | // Listen for MetaMask account changes
104 | if (window.ethereum) {
105 | window.ethereum.on("accountsChanged", handleAccountChange);
106 | }
107 |
108 | const fetchCurrentWalletAddress = async () => {
109 | try {
110 | if (window.ethereum) {
111 | const accounts = await window.ethereum.request({
112 | method: "eth_requestAccounts",
113 | });
114 | setUserAddress(accounts[0]);
115 | } else {
116 | console.error("MetaMask not installed or user not logged in");
117 | }
118 | } catch (error) {
119 | console.error("Error fetching user address:", error);
120 | }
121 | };
122 |
123 | fetchCurrentWalletAddress();
124 |
125 | if (caseDetails) {
126 | checkForCaseAdmins(caseDetails);
127 | }
128 |
129 | // Clean up event listener when component unmounts
130 | return () => {
131 | if (window.ethereum) {
132 | window.ethereum.off("accountsChanged", handleAccountChange);
133 | }
134 | };
135 | }, [userAddress, isUserJudge, isUserLawyer, isUserClient]);
136 |
137 | return (
138 |
139 |
140 |
141 | Search for case details ?
142 |
143 |
144 | Only associated clients, lawyers, and judges of the case can access
145 | the relevant case details and information
146 |
147 |
166 |
167 | {/* Display case details table if available */}
168 | {caseDetails && (
169 |
170 | {/*
Case Details */}
171 |
172 |
173 |
174 | Case ID
175 | Case Subject
176 | Party 1
177 | Party 2
178 | Filing Date
179 | Appointed Judge
180 | Appointed Lawyers
181 |
182 |
183 |
184 |
185 | {caseDetails.caseId}
186 | {caseDetails.caseSubject}
187 | {caseDetails.UIDOfParty1}
188 | {caseDetails.UIDOfParty2}
189 |
190 | {caseDetails.filedOnDate.toString()}
191 |
192 | {caseDetails.associatedJudge}
193 |
194 | {caseDetails.associatedLawyers.join(", ")}
195 |
196 |
197 |
198 |
199 |
200 | {/* forMobileScreens */}
201 |
202 |
203 |
204 | Case ID:
205 | {caseDetails.caseId}
206 |
207 |
208 | Case Subject:
209 | {caseDetails.caseSubject}
210 |
211 |
212 | Party 1:
213 | {caseDetails.UIDOfParty1}
214 |
215 |
216 | Party 2:
217 | {caseDetails.UIDOfParty2}
218 |
219 |
220 | Filing Date:
221 |
222 | {caseDetails.filedOnDate.toString()}
223 |
224 |
225 |
226 | Appointed Judge:
227 | {caseDetails.associatedJudge}
228 |
229 |
230 | Appointed Lawyers:
231 |
232 | {caseDetails.associatedLawyers.join(", ")}
233 |
234 |
235 |
236 |
237 |
238 | {isUserJudge | isUserLawyer | isUserClient ? (
239 |
240 |
241 | See More Details
242 |
243 |
244 | ) : (
245 |
246 | Only case admins are allowed to view further details
247 |
248 | )}
249 |
250 |
251 | )}
252 |
253 |
254 | );
255 | };
256 |
257 | export default SearchCaseDetailsComponent;
258 |
--------------------------------------------------------------------------------
/frontend-vite/src/components/SignUpComponent.jsx:
--------------------------------------------------------------------------------
1 | import {useState} from "react";
2 | import {ethers} from "ethers";
3 | import {Link} from "react-router-dom";
4 | import {useNavigate} from "react-router-dom";
5 |
6 | import registerToEVault from "../blockchain-api/registerToEVault";
7 |
8 | import {ToastContainer, toast} from "react-toastify";
9 | import "react-toastify/dist/ReactToastify.css";
10 | import {shortenWalletAddress} from "@/lib/utils";
11 |
12 | const SignUpComponent = ({initialFormType}) => {
13 | const navigate = useNavigate();
14 |
15 | const [formType, setFormType] = useState(initialFormType || "");
16 | const [isConnected, setIsConnected] = useState(false);
17 |
18 | const [fullName, setFullName] = useState("");
19 | const [religion, setReligion] = useState("");
20 | const [nationality, setNationality] = useState("");
21 | const [sex, setSex] = useState("");
22 | const [dob, setDob] = useState("");
23 | const [contactNumber, setContactNumber] = useState("");
24 | const [aadharUID, setAadharUID] = useState("");
25 | const [pan, setPan] = useState("");
26 | const [walletAddress, setWalletAddress] = useState("");
27 | const [signingUpAs, setSigningUpAs] = useState("lawyer");
28 |
29 | const connectMetamaskWallet = async () => {
30 | try {
31 | const accounts = await window.ethereum.request({
32 | method: "eth_requestAccounts",
33 | });
34 | const account = ethers.utils.getAddress(accounts[0]);
35 | setWalletAddress(account);
36 | setIsConnected(true);
37 | } catch (error) {
38 | console.error("Error connecting to Ethereum:", error);
39 | setIsConnected(false);
40 | }
41 | };
42 |
43 | const handleSubmit = async (e) => {
44 | e.preventDefault();
45 |
46 | // Check if any of the required fields are empty
47 | if (
48 | !fullName ||
49 | !religion ||
50 | !nationality ||
51 | !sex ||
52 | !dob ||
53 | !contactNumber ||
54 | !aadharUID ||
55 | !pan
56 | ) {
57 | alert("Please fill in all the required fields.");
58 | return;
59 | }
60 |
61 | const formData = {
62 | fullName,
63 | religion,
64 | nationality,
65 | sex,
66 | dob,
67 | contactNumber,
68 | aadharUID,
69 | pan,
70 | walletAddress,
71 | signingUpAs,
72 | };
73 |
74 | try {
75 | const register = await registerToEVault(formData);
76 |
77 | // Customization: https://fkhadra.github.io/react-toastify/how-to-style/
78 | // Customization: https://fkhadra.github.io/react-toastify/how-to-style/
79 | toast("Evault login successfull ✅", {
80 | position: "top-right",
81 | autoClose: 1000,
82 | closeOnClick: true,
83 | pauseOnHover: true,
84 | draggable: true,
85 | progress: undefined,
86 | icon: false,
87 | hideProgressBar: true,
88 | closeButton: false,
89 | });
90 |
91 | // resettingToDefaultValues
92 | setFullName("");
93 | setReligion("");
94 | setNationality("");
95 | setSex("");
96 | setDob("");
97 | setContactNumber("");
98 | setAadharUID("");
99 | setPan("");
100 | setWalletAddress("");
101 |
102 | setTimeout(() => {
103 | navigate(`/admin/lawyer/${aadharUID}`);
104 | }, 2000);
105 | } catch (error) {
106 | console.error("Error during registration: ", error);
107 | }
108 | };
109 |
110 | const renderFormFields = () => {
111 | switch (formType) {
112 | case "lawyer":
113 | return (
114 | <>
115 |
116 | setFullName(e.target.value)}
122 | />
123 |
124 |
125 |
126 | setReligion(e.target.value)}
130 | >
131 | Religion ?
132 | Hinduism
133 | Islam
134 | Christianity
135 |
136 |
137 |
138 | setNationality(e.target.value)}
142 | >
143 | Nationality ?
144 | Indian
145 |
146 |
147 |
148 | setSex(e.target.value)}
152 | >
153 | Select your sex ?
154 | Male
155 | Female
156 | Transgender
157 | Rather not say
158 |
159 |
160 |
161 |
162 | setDob(e.target.value)}
168 | />
169 |
170 |
171 | setContactNumber(e.target.value)}
177 | />
178 |
179 | >
180 | );
181 | case "client":
182 | return (
183 | <>
184 |
185 | setFullName(e.target.value)}
191 | />
192 |
193 |
194 |
195 | setReligion(e.target.value)}
199 | >
200 | Select your religion ?
201 | Hinduism
202 | Islam
203 | Christianity
204 |
205 |
206 |
207 | setNationality(e.target.value)}
211 | >
212 | Select your nationality ?
213 | Indian
214 |
215 |
216 |
217 | setSex(e.target.value)}
221 | >
222 | Select your sex ?
223 | Male
224 | Female
225 | Transgender
226 | Rather not say
227 |
228 |
229 |
230 |
231 | setDob(e.target.value)}
237 | />
238 |
239 |
240 | setContactNumber(e.target.value)}
246 | />
247 |
248 | >
249 | );
250 | case "judge":
251 | return (
252 | <>
253 |
254 | setFullName(e.target.value)}
260 | />
261 |
262 |
263 |
264 | setReligion(e.target.value)}
268 | >
269 | Select your religion ?
270 | Hinduism
271 | Islam
272 | Christianity
273 |
274 |
275 |
276 | setNationality(e.target.value)}
280 | >
281 | Select your nationality ?
282 | Indian
283 |
284 |
285 |
286 | setSex(e.target.value)}
290 | >
291 | Select your sex ?
292 | Male
293 | Female
294 | Transgender
295 | Rather not say
296 |
297 |
298 |
299 |
300 | setDob(e.target.value)}
306 | />
307 |
308 |
309 | setContactNumber(e.target.value)}
315 | />
316 |
317 | >
318 | );
319 | default:
320 | return null;
321 | }
322 | };
323 |
324 | return (
325 |
326 |
327 |
328 | E-Vault Registration
329 |
330 |
331 |
332 |
333 | Already have an acccount ?
334 |
335 |
336 | Login to E-Vault here
337 |
338 |
339 |
340 |
341 |
342 | {
349 | setFormType("lawyer");
350 | setSigningUpAs("lawyer");
351 | }}
352 | >
353 | Lawyer Registration
354 |
355 |
356 |
357 |
358 | {
365 | setFormType("client");
366 | setSigningUpAs("client");
367 | }}
368 | >
369 | Client Registration
370 |
371 |
372 |
373 |
374 | {
381 | setFormType("judge");
382 | setSigningUpAs("judge");
383 | }}
384 | >
385 | Judge Registration
386 |
387 |
388 |
389 |
390 |
391 |
455 |
456 |
460 |
461 | );
462 | };
463 |
464 | export default SignUpComponent;
465 |
--------------------------------------------------------------------------------
/frontend-vite/src/components/ui/dialog.jsx:
--------------------------------------------------------------------------------
1 | "use client";
2 |
3 | import * as React from "react";
4 | import * as DialogPrimitive from "@radix-ui/react-dialog";
5 | import {X} from "lucide-react";
6 |
7 | import {cn} from "@/lib/utils";
8 |
9 | const Dialog = DialogPrimitive.Root;
10 |
11 | const DialogTrigger = DialogPrimitive.Trigger;
12 |
13 | const DialogPortal = DialogPrimitive.Portal;
14 |
15 | const DialogClose = DialogPrimitive.Close;
16 |
17 | const DialogOverlay = React.forwardRef(({className, ...props}, ref) => (
18 |
26 | ));
27 | DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
28 |
29 | const DialogContent = React.forwardRef(
30 | ({className, children, ...props}, ref) => (
31 |
32 |
33 |
41 | {children}
42 |
43 |
44 | Close
45 |
46 |
47 |
48 | )
49 | );
50 | DialogContent.displayName = DialogPrimitive.Content.displayName;
51 |
52 | const DialogHeader = ({className, ...props}) => (
53 |
57 | );
58 | DialogHeader.displayName = "DialogHeader";
59 |
60 | const DialogFooter = ({className, ...props}) => (
61 |
68 | );
69 | DialogFooter.displayName = "DialogFooter";
70 |
71 | const DialogTitle = React.forwardRef(({className, ...props}, ref) => (
72 |
80 | ));
81 | DialogTitle.displayName = DialogPrimitive.Title.displayName;
82 |
83 | const DialogDescription = React.forwardRef(({className, ...props}, ref) => (
84 |
89 | ));
90 | DialogDescription.displayName = DialogPrimitive.Description.displayName;
91 |
92 | export {
93 | Dialog,
94 | DialogPortal,
95 | DialogOverlay,
96 | DialogClose,
97 | DialogTrigger,
98 | DialogContent,
99 | DialogHeader,
100 | DialogFooter,
101 | DialogTitle,
102 | DialogDescription,
103 | };
104 |
--------------------------------------------------------------------------------
/frontend-vite/src/index.css:
--------------------------------------------------------------------------------
1 | @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300&family=Nunito+Sans:opsz,wght@6..12,300&display=swap');
2 |
3 | @tailwind base;
4 | @tailwind components;
5 | @tailwind utilities;
6 |
7 | body {
8 | padding-right: 100px;
9 | padding-left: 100px;
10 | margin: 0;
11 | }
12 |
13 | @media screen and (min-width: 350px) and (max-width: 640px) {
14 | body {
15 | padding-right: 35px;
16 | padding-left: 35px;
17 | }
18 | }
19 |
20 | @layer base {
21 | :root {
22 | --background: 0 0% 100%;
23 | --foreground: 222.2 84% 4.9%;
24 |
25 | --card: 0 0% 100%;
26 | --card-foreground: 222.2 84% 4.9%;
27 |
28 | --popover: 0 0% 100%;
29 | --popover-foreground: 222.2 84% 4.9%;
30 |
31 | --primary: 222.2 47.4% 11.2%;
32 | --primary-foreground: 210 40% 98%;
33 |
34 | --secondary: 210 40% 96.1%;
35 | --secondary-foreground: 222.2 47.4% 11.2%;
36 |
37 | --muted: 210 40% 96.1%;
38 | --muted-foreground: 215.4 16.3% 46.9%;
39 |
40 | --accent: 210 40% 96.1%;
41 | --accent-foreground: 222.2 47.4% 11.2%;
42 |
43 | --destructive: 0 84.2% 60.2%;
44 | --destructive-foreground: 210 40% 98%;
45 |
46 | --border: 214.3 31.8% 91.4%;
47 | --input: 214.3 31.8% 91.4%;
48 | --ring: 222.2 84% 4.9%;
49 |
50 | --radius: 0.5rem;
51 | }
52 |
53 | .dark {
54 | --background: 222.2 84% 4.9%;
55 | --foreground: 210 40% 98%;
56 |
57 | --card: 222.2 84% 4.9%;
58 | --card-foreground: 210 40% 98%;
59 |
60 | --popover: 222.2 84% 4.9%;
61 | --popover-foreground: 210 40% 98%;
62 |
63 | --primary: 210 40% 98%;
64 | --primary-foreground: 222.2 47.4% 11.2%;
65 |
66 | --secondary: 217.2 32.6% 17.5%;
67 | --secondary-foreground: 210 40% 98%;
68 |
69 | --muted: 217.2 32.6% 17.5%;
70 | --muted-foreground: 215 20.2% 65.1%;
71 |
72 | --accent: 217.2 32.6% 17.5%;
73 | --accent-foreground: 210 40% 98%;
74 |
75 | --destructive: 0 62.8% 30.6%;
76 | --destructive-foreground: 210 40% 98%;
77 |
78 | --border: 217.2 32.6% 17.5%;
79 | --input: 217.2 32.6% 17.5%;
80 | --ring: 212.7 26.8% 83.9%;
81 | }
82 | }
83 |
84 | @layer base {
85 | * {
86 | @apply border-border;
87 | }
88 | body {
89 | @apply bg-background text-foreground;
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/frontend-vite/src/lib/utils.js:
--------------------------------------------------------------------------------
1 | import {clsx} from "clsx";
2 | import {twMerge} from "tailwind-merge";
3 |
4 | export function cn(...inputs) {
5 | return twMerge(clsx(inputs));
6 | }
7 |
8 | export function shortenWalletAddress(walletAddress) {
9 | if (!walletAddress || typeof walletAddress !== "string") {
10 | return "Invalid wallet address";
11 | }
12 |
13 | const prefix = walletAddress.slice(0, 10);
14 |
15 | const suffix = walletAddress.slice(-10);
16 |
17 | return `${prefix}...${suffix}`;
18 | }
19 |
20 | export function superShortenWalletAddress(walletAddress) {
21 | if (!walletAddress || typeof walletAddress !== "string") {
22 | return "Invalid wallet address";
23 | }
24 |
25 | const prefix = walletAddress.slice(0, 3);
26 |
27 | const suffix = walletAddress.slice(-3);
28 |
29 | return `${prefix}...${suffix}`;
30 | }
31 |
--------------------------------------------------------------------------------
/frontend-vite/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | import App from "./App.jsx";
4 | import "./index.css";
5 | import "./App.css";
6 |
7 | import {BrowserRouter} from "react-router-dom";
8 |
9 | ReactDOM.createRoot(document.getElementById("root")).render(
10 |
11 |
12 |
13 |
14 |
15 | );
16 |
--------------------------------------------------------------------------------
/frontend-vite/src/pages/AdminPage.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import {useParams} from "react-router-dom";
3 |
4 | import AdminDashboardComponent from "../components/AdminDashboardComponent";
5 |
6 | const AdminPage = () => {
7 | const {aadharUID, adminType} = useParams();
8 |
9 | return (
10 | <>
11 |
12 | >
13 | );
14 | };
15 |
16 | export default AdminPage;
17 |
--------------------------------------------------------------------------------
/frontend-vite/src/pages/CaseDetailsPage.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import {useLocation} from "react-router-dom";
3 | import CaseDetailsComponent from "../components/CaseDetailsComponent";
4 |
5 | const CaseDetailsPage = () => {
6 | const location = useLocation();
7 | const searchParams = new URLSearchParams(location.search);
8 | const caseID = searchParams.get("caseid");
9 | return (
10 | <>
11 | {/* Pass the caseID as a prop to CaseDetailsComponent */}
12 |
13 | >
14 | );
15 | };
16 |
17 | export default CaseDetailsPage;
18 |
--------------------------------------------------------------------------------
/frontend-vite/src/pages/GetCaseDetailsPage.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import SearchCaseDetailsComponent from "../components/SearchCaseDetailsComponent.jsx";
3 |
4 | const GetCaseDetailsPage = () => {
5 | return (
6 |
7 |
8 |
9 | );
10 | };
11 |
12 | export default GetCaseDetailsPage;
13 |
--------------------------------------------------------------------------------
/frontend-vite/src/pages/HomePage.jsx:
--------------------------------------------------------------------------------
1 | import HeroSection from "../components/HeroSection";
2 | import ProjectStatistics from "../components/ProjectStatistics";
3 |
4 | function HomePage() {
5 | return (
6 | <>
7 |
8 |
9 | >
10 | );
11 | }
12 |
13 | export default HomePage;
14 |
--------------------------------------------------------------------------------
/frontend-vite/src/pages/LoginPage.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import {useParams} from "react-router-dom";
3 |
4 | import LoginComponent from "../components/LoginComponent";
5 |
6 | const LoginPage = () => {
7 | const {initialFormType} = useParams();
8 |
9 | return (
10 | <>
11 |
12 | >
13 | );
14 | };
15 |
16 | export default LoginPage;
17 |
--------------------------------------------------------------------------------
/frontend-vite/src/pages/RegisterNewLegalCasePage.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import RegisterANewCaseComponent from "../components/RegisterANewCaseComponent";
3 |
4 | const RegisterNewLegalCasePage = () => {
5 | return (
6 | <>
7 |
8 | >
9 | );
10 | };
11 |
12 | export default RegisterNewLegalCasePage;
13 |
--------------------------------------------------------------------------------
/frontend-vite/src/pages/SignUpPage.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import {useParams} from "react-router-dom";
3 |
4 | import SignUpComponent from "../components/SignUpComponent";
5 |
6 | const SignUpPage = () => {
7 | const {initialFormType} = useParams();
8 |
9 | return (
10 | <>
11 |
12 | >
13 | );
14 | };
15 |
16 | export default SignUpPage;
17 |
--------------------------------------------------------------------------------
/frontend-vite/src/pages/TestPage.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Loader from "@/components/Loader";
3 |
4 | const TestPage = () => {
5 | return (
6 | <>
7 |
8 | >
9 | );
10 | };
11 |
12 | export default TestPage;
13 |
--------------------------------------------------------------------------------
/frontend-vite/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | darkMode: ["class"],
4 | content: [
5 | "./pages/**/*.{js,jsx}",
6 | "./components/**/*.{js,jsx}",
7 | "./app/**/*.{js,jsx}",
8 | "./src/**/*.{js,jsx}",
9 | ],
10 | prefix: "",
11 | theme: {
12 | container: {
13 | center: true,
14 | padding: "2rem",
15 | screens: {
16 | "2xl": "1400px",
17 | },
18 | },
19 | screens: {
20 | xs: "350px",
21 | // => @media (min-width: 350px) { ... }
22 |
23 | sm: "640px",
24 | // => @media (min-width: 640px) { ... }
25 |
26 | md: "768px",
27 | // => @media (min-width: 768px) { ... }
28 |
29 | lg: "1024px",
30 | // => @media (min-width: 1024px) { ... }
31 |
32 | xl: "1280px",
33 | // => @media (min-width: 1280px) { ... }
34 |
35 | "2xl": "1500px",
36 | // => @media (min-width: 1500px) { ... }
37 |
38 | "3xl": "1800px",
39 | // => @media (min-width: 1800px) { ... }
40 | },
41 | extend: {
42 | fontFamily: {
43 | montserrat: ["Montserrat", "sans"],
44 | },
45 | colors: {
46 | border: "hsl(var(--border))",
47 | input: "hsl(var(--input))",
48 | ring: "hsl(var(--ring))",
49 | background: "hsl(var(--background))",
50 | foreground: "hsl(var(--foreground))",
51 | primary: {
52 | DEFAULT: "hsl(var(--primary))",
53 | foreground: "hsl(var(--primary-foreground))",
54 | },
55 | secondary: {
56 | DEFAULT: "hsl(var(--secondary))",
57 | foreground: "hsl(var(--secondary-foreground))",
58 | },
59 | destructive: {
60 | DEFAULT: "hsl(var(--destructive))",
61 | foreground: "hsl(var(--destructive-foreground))",
62 | },
63 | muted: {
64 | DEFAULT: "hsl(var(--muted))",
65 | foreground: "hsl(var(--muted-foreground))",
66 | },
67 | accent: {
68 | DEFAULT: "hsl(var(--accent))",
69 | foreground: "hsl(var(--accent-foreground))",
70 | },
71 | popover: {
72 | DEFAULT: "hsl(var(--popover))",
73 | foreground: "hsl(var(--popover-foreground))",
74 | },
75 | card: {
76 | DEFAULT: "hsl(var(--card))",
77 | foreground: "hsl(var(--card-foreground))",
78 | },
79 | },
80 | borderRadius: {
81 | lg: "var(--radius)",
82 | md: "calc(var(--radius) - 2px)",
83 | sm: "calc(var(--radius) - 4px)",
84 | },
85 | keyframes: {
86 | "accordion-down": {
87 | from: {height: "0"},
88 | to: {height: "var(--radix-accordion-content-height)"},
89 | },
90 | "accordion-up": {
91 | from: {height: "var(--radix-accordion-content-height)"},
92 | to: {height: "0"},
93 | },
94 | },
95 | animation: {
96 | "accordion-down": "accordion-down 0.2s ease-out",
97 | "accordion-up": "accordion-up 0.2s ease-out",
98 | },
99 | },
100 | },
101 | plugins: [require("tailwindcss-animate")],
102 | };
103 |
--------------------------------------------------------------------------------
/frontend-vite/vite.config.js:
--------------------------------------------------------------------------------
1 | import path from "path";
2 | import {defineConfig} from "vite";
3 | import react from "@vitejs/plugin-react";
4 |
5 | // https://vitejs.dev/config/
6 | export default defineConfig({
7 | plugins: [react()],
8 | resolve: {
9 | alias: {
10 | "@": path.resolve(__dirname, "./src"),
11 | },
12 | },
13 | });
14 |
--------------------------------------------------------------------------------
/frontend-vite/vite.config.js.timestamp-1711906103182-8a096b5df01d3.mjs:
--------------------------------------------------------------------------------
1 | // vite.config.js
2 | import { defineConfig } from "file:///C:/Users/LENOVO/Desktop/Active%20Projects/sih-evault-project/frontend-vite/node_modules/vite/dist/node/index.js";
3 | import react from "file:///C:/Users/LENOVO/Desktop/Active%20Projects/sih-evault-project/frontend-vite/node_modules/@vitejs/plugin-react/dist/index.mjs";
4 | var vite_config_default = defineConfig({
5 | plugins: [react()]
6 | });
7 | export {
8 | vite_config_default as default
9 | };
10 | //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcuanMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJDOlxcXFxVc2Vyc1xcXFxMRU5PVk9cXFxcRGVza3RvcFxcXFxBY3RpdmUgUHJvamVjdHNcXFxcc2loLWV2YXVsdC1wcm9qZWN0XFxcXGZyb250ZW5kLXZpdGVcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZmlsZW5hbWUgPSBcIkM6XFxcXFVzZXJzXFxcXExFTk9WT1xcXFxEZXNrdG9wXFxcXEFjdGl2ZSBQcm9qZWN0c1xcXFxzaWgtZXZhdWx0LXByb2plY3RcXFxcZnJvbnRlbmQtdml0ZVxcXFx2aXRlLmNvbmZpZy5qc1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vQzovVXNlcnMvTEVOT1ZPL0Rlc2t0b3AvQWN0aXZlJTIwUHJvamVjdHMvc2loLWV2YXVsdC1wcm9qZWN0L2Zyb250ZW5kLXZpdGUvdml0ZS5jb25maWcuanNcIjtpbXBvcnQgeyBkZWZpbmVDb25maWcgfSBmcm9tICd2aXRlJ1xuaW1wb3J0IHJlYWN0IGZyb20gJ0B2aXRlanMvcGx1Z2luLXJlYWN0J1xuXG4vLyBodHRwczovL3ZpdGVqcy5kZXYvY29uZmlnL1xuZXhwb3J0IGRlZmF1bHQgZGVmaW5lQ29uZmlnKHtcbiAgcGx1Z2luczogW3JlYWN0KCldLFxufSlcbiJdLAogICJtYXBwaW5ncyI6ICI7QUFBMFosU0FBUyxvQkFBb0I7QUFDdmIsT0FBTyxXQUFXO0FBR2xCLElBQU8sc0JBQVEsYUFBYTtBQUFBLEVBQzFCLFNBQVMsQ0FBQyxNQUFNLENBQUM7QUFDbkIsQ0FBQzsiLAogICJuYW1lcyI6IFtdCn0K
11 |
--------------------------------------------------------------------------------
/project-assets/SC_COVER.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/SC_COVER.png
--------------------------------------------------------------------------------
/project-assets/demo_car_accident_image.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/demo_car_accident_image.jpg
--------------------------------------------------------------------------------
/project-assets/demo_fir.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/demo_fir.jpg
--------------------------------------------------------------------------------
/project-assets/demo_fir.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/demo_fir.png
--------------------------------------------------------------------------------
/project-assets/sc_admin_dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_admin_dashboard.png
--------------------------------------------------------------------------------
/project-assets/sc_case_details.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_case_details.png
--------------------------------------------------------------------------------
/project-assets/sc_case_document.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_case_document.png
--------------------------------------------------------------------------------
/project-assets/sc_case_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_case_search.png
--------------------------------------------------------------------------------
/project-assets/sc_home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_home.png
--------------------------------------------------------------------------------
/project-assets/sc_login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_login.png
--------------------------------------------------------------------------------
/project-assets/sc_logo.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_logo.PNG
--------------------------------------------------------------------------------
/project-assets/sc_registration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_registration.png
--------------------------------------------------------------------------------
/project-assets/sc_upload_case_document.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_upload_case_document.png
--------------------------------------------------------------------------------