diff --git a/apps/platform/src/components/ui/collapsible.tsx b/apps/platform/src/components/ui/collapsible.tsx
new file mode 100644
index 00000000..28dd1567
--- /dev/null
+++ b/apps/platform/src/components/ui/collapsible.tsx
@@ -0,0 +1,12 @@
+"use client"
+
+import * as React from "react"
+import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
+
+const Collapsible = CollapsiblePrimitive.Root
+
+const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger
+
+const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent
+
+export { Collapsible, CollapsibleTrigger, CollapsibleContent }
\ No newline at end of file
diff --git a/apps/platform/src/components/ui/textarea.tsx b/apps/platform/src/components/ui/textarea.tsx
new file mode 100644
index 00000000..2a10e86f
--- /dev/null
+++ b/apps/platform/src/components/ui/textarea.tsx
@@ -0,0 +1,22 @@
+import * as React from 'react'
+
+import { cn } from '@/lib/utils'
+
+const Textarea = React.forwardRef<
+ HTMLTextAreaElement,
+ React.ComponentProps<'textarea'>
+>(({ className, ...props }, ref) => {
+ return (
+
+ )
+})
+Textarea.displayName = 'Textarea'
+
+export { Textarea }
diff --git a/erDetails(userData) b/erDetails(userData)
deleted file mode 100644
index 95c798b9..00000000
--- a/erDetails(userData)
+++ /dev/null
@@ -1,664 +0,0 @@
-[1mdiff --git a/apps/platform/.eslintrc.cjs b/apps/platform/.eslintrc.cjs[m
-[1mindex 28a8b27..fa9233a 100644[m
-[1m--- a/apps/platform/.eslintrc.cjs[m
-[1m+++ b/apps/platform/.eslintrc.cjs[m
-[36m@@ -7,24 +7,13 @@[m [mmodule.exports = {[m
- },[m
- rules: {[m
- 'import/no-extraneous-dependencies': 0,[m
-[31m- '@typescript-eslint/interface-name-prefix': 'off',[m
- '@typescript-eslint/explicit-function-return-type': 'off',[m
- '@typescript-eslint/explicit-module-boundary-types': 'off',[m
-[31m- '@typescript-eslint/no-explicit-any': 'off',[m
- '@typescript-eslint/no-unused-vars': ['warn'],[m
-[31m- '@typescript-eslint/no-unsafe-call': 'off',[m
-[31m- '@typescript-eslint/no-unsafe-return': 'off',[m
- '@typescript-eslint/space-before-function-paren': 'off',[m
- '@typescript-eslint/strict-boolean-expressions': 'off',[m
-[31m- '@typescript-eslint/prefer-nullish-coalescing': 'off',[m
-[31m- 'space-before-function-paren': 'off',[m
-[31m- '@typescript-eslint/member-delimiter-style': 'off',[m
- '@typescript-eslint/no-confusing-void-expression': 'off',[m
- '@typescript-eslint/no-floating-promises': 'off',[m
-[31m- '@typescript-eslint/no-misused-promises': 'off',[m
-[31m- '@typescript-eslint/no-unsafe-assignment': 'off',[m
-[31m- '@typescript-eslint/no-unsafe-member-access': 'off',[m
-[31m- '@typescript-eslint/no-unsafe-argument': 'off',[m
-[31m- '@typescript-eslint/no-unnecessary-condition': 'off'[m
-[32m+[m[32m '@typescript-eslint/no-misused-promises': 'off'[m
- }[m
- }[m
-[1mdiff --git a/apps/platform/src/app/(main)/page.tsx b/apps/platform/src/app/(main)/page.tsx[m
-[1mindex fe8fa2a..9a9cb2a 100644[m
-[1m--- a/apps/platform/src/app/(main)/page.tsx[m
-[1m+++ b/apps/platform/src/app/(main)/page.tsx[m
-[36m@@ -6,7 +6,6 @@[m [mimport type {[m
- ProjectWithCount,[m
- Workspace[m
- } from '@keyshade/schema'[m
-[31m-import { ProjectController } from '@keyshade/api-client'[m
- import { AddSVG } from '@public/svg/shared'[m
- import { FolderSVG } from '@public/svg/dashboard'[m
- import ProjectCard from '@/components/dashboard/projectCard'[m
-[36m@@ -38,6 +37,7 @@[m [mimport {[m
- DialogHeader,[m
- DialogTrigger[m
- } from '@/components/ui/dialog'[m
-[32m+[m[32mimport ControllerInstance from '@/lib/controller-instance'[m
- [m
- export default function Index(): JSX.Element {[m
- const [isSheetOpen, setIsSheetOpen] = useState
(false)[m
-[36m@@ -76,16 +76,13 @@[m [mexport default function Index(): JSX.Element {[m
- // If a workspace is selected, we want to fetch all the projects[m
- // under that workspace and display it in the dashboard.[m
- useEffect(() => {[m
-[31m- const projectController = new ProjectController([m
-[31m- process.env.NEXT_PUBLIC_BACKEND_URL[m
-[31m- )[m
-[31m-[m
- async function getAllProjects() {[m
- if (currentWorkspace) {[m
-[31m- const { success, error, data } = await projectController.getAllProjects([m
-[31m- { workspaceSlug: currentWorkspace.slug },[m
-[31m- {}[m
-[31m- )[m
-[32m+[m[32m const { success, error, data } =[m
-[32m+[m[32m await ControllerInstance.getInstance().projectController.getAllProjects([m
-[32m+[m[32m { workspaceSlug: currentWorkspace.slug },[m
-[32m+[m[32m {}[m
-[32m+[m[32m )[m
- [m
- if (success && data) {[m
- setProjects(data.items)[m
-[36m@@ -105,16 +102,13 @@[m [mexport default function Index(): JSX.Element {[m
- // Function to create a new project[m
- const createNewProject = useCallback(async () => {[m
- if (currentWorkspace) {[m
-[31m- const projectController = new ProjectController([m
-[31m- process.env.NEXT_PUBLIC_BACKEND_URL[m
-[31m- )[m
-[31m-[m
- newProjectData.workspaceSlug = currentWorkspace.slug[m
- [m
-[31m- const { data, error, success } = await projectController.createProject([m
-[31m- newProjectData,[m
-[31m- {}[m
-[31m- )[m
-[32m+[m[32m const { data, error, success } =[m
-[32m+[m[32m await ControllerInstance.getInstance().projectController.createProject([m
-[32m+[m[32m newProjectData,[m
-[32m+[m[32m {}[m
-[32m+[m[32m )[m
- [m
- if (success && data) {[m
- setProjects([[m
-[1mdiff --git a/apps/platform/src/app/(main)/project/[project]/@secret/page.tsx b/apps/platform/src/app/(main)/project/[project]/@secret/page.tsx[m
-[1mindex 18134ab..e1bd8e6 100644[m
-[1m--- a/apps/platform/src/app/(main)/project/[project]/@secret/page.tsx[m
-[1m+++ b/apps/platform/src/app/(main)/project/[project]/@secret/page.tsx[m
-[36m@@ -5,6 +5,7 @@[m [mimport { usePathname } from 'next/navigation'[m
- import dayjs, { extend } from 'dayjs'[m
- import relativeTime from 'dayjs/plugin/relativeTime'[m
- import { NoteIconSVG } from '@public/svg/secret'[m
-[32m+[m[32mimport type { GetAllSecretsOfProjectResponse } from '@keyshade/schema'[m
- import {[m
- Accordion,[m
- AccordionContent,[m
-[36m@@ -19,8 +20,6 @@[m [mimport {[m
- TableHeader,[m
- TableRow[m
- } from '@/components/ui/table'[m
-[31m-import type { Secret } from '@keyshade/schema'[m
-[31m-import { SecretController } from '@keyshade/api-client'[m
- import { ScrollArea } from '@/components/ui/scroll-area'[m
- import {[m
- Tooltip,[m
-[36m@@ -29,31 +28,28 @@[m [mimport {[m
- TooltipTrigger[m
- } from '@/components/ui/tooltip'[m
- import { Skeleton } from '@/components/ui/skeleton'[m
-[32m+[m[32mimport ControllerInstance from '@/lib/controller-instance'[m
- [m
- extend(relativeTime)[m
- [m
- function SecretPage(): React.JSX.Element {[m
-[31m- const [allSecrets, setAllSecrets] = useState()[m
-[32m+[m[32m const [allSecrets, setAllSecrets] =[m
-[32m+[m[32m useState()[m
- const [isLoading, setIsLoading] = useState(true)[m
- const pathname = usePathname()[m
- [m
- useEffect(() => {[m
- setIsLoading(true)[m
- [m
-[31m- const secretController = new SecretController([m
-[31m- process.env.NEXT_PUBLIC_BACKEND_URL[m
-[31m- )[m
-[31m-[m
- async function getAllSecretsByProjectSlug() {[m
- const { success, error, data } =[m
-[31m- await secretController.getAllSecretsOfProject([m
-[32m+[m[32m await ControllerInstance.getInstance().secretController.getAllSecretsOfProject([m
- { projectSlug: pathname.split('/')[2] },[m
- {}[m
- )[m
- [m
- if (success && data) {[m
-[31m- //@ts-ignore[m
-[31m- setAllSecrets(data)[m
-[32m+[m[32m setAllSecrets(data.items)[m
- } else {[m
- // eslint-disable-next-line no-console -- we need to log the error[m
- console.error(error)[m
-[36m@@ -68,9 +64,9 @@[m [mfunction SecretPage(): React.JSX.Element {[m
- if (isLoading) {[m
- return ([m
- [m
-[31m- [m
-[31m- [m
-[31m- [m
-[32m+[m[32m [m
-[32m+[m[32m [m
-[32m+[m[32m [m
-
[m
- )[m
- }[m
-[36m@@ -82,7 +78,7 @@[m [mfunction SecretPage(): React.JSX.Element {[m
- collapsible[m
- type="single"[m
- >[m
-[31m- {allSecrets?.map((secret) => {[m
-[32m+[m[32m {allSecrets?.map(({ secret, values }) => {[m
- return ([m
- [m
- [m
- [m
-[31m- {secret.versions.map((value) => {[m
-[32m+[m[32m {values.map((value) => {[m
- return ([m
- [m
- {value.environment.slug}[m
-[36m@@ -147,7 +143,7 @@[m [mfunction SecretPage(): React.JSX.Element {[m
- )[m
- }[m
- [m
-[31m-function SerectLoader(): React.JSX.Element {[m
-[32m+[m[32mfunction SecretLoader(): React.JSX.Element {[m
- return ([m
- [m
-
[m
-[1mdiff --git a/apps/platform/src/app/(main)/project/[project]/layout.tsx b/apps/platform/src/app/(main)/project/[project]/layout.tsx[m
-[1mindex 1eb511b..9edfb0b 100644[m
-[1m--- a/apps/platform/src/app/(main)/project/[project]/layout.tsx[m
-[1m+++ b/apps/platform/src/app/(main)/project/[project]/layout.tsx[m
-[36m@@ -2,6 +2,7 @@[m
- import { useEffect, useState } from 'react'[m
- import { useSearchParams } from 'next/navigation'[m
- import { AddSVG } from '@public/svg/shared'[m
-[32m+[m[32mimport type { Project } from '@keyshade/schema'[m
- import { Button } from '@/components/ui/button'[m
- import {[m
- Dialog,[m
-[36m@@ -13,8 +14,7 @@[m [mimport {[m
- } from '@/components/ui/dialog'[m
- import { Input } from '@/components/ui/input'[m
- import { Label } from '@/components/ui/label'[m
-[31m-import { ProjectController } from '@keyshade/api-client'[m
-[31m-import type { Project } from '@keyshade/schema'[m
-[32m+[m[32mimport ControllerInstance from '@/lib/controller-instance'[m
- [m
- interface DetailedProjectPageProps {[m
- params: { project: string }[m
-[36m@@ -38,29 +38,22 @@[m [mfunction DetailedProjectPage({[m
- const tab = searchParams.get('tab') ?? 'rollup-details'[m
- [m
- useEffect(() => {[m
-[32m+[m[32m async function getProjectBySlug() {[m
-[32m+[m[32m const { success, error, data } =[m
-[32m+[m[32m await ControllerInstance.getInstance().projectController.getProject([m
-[32m+[m[32m { projectSlug: params.project },[m
-[32m+[m[32m {}[m
-[32m+[m[32m )[m
- [m
-[31m- const projectController = new ProjectController([m
-[31m- process.env.NEXT_PUBLIC_BACKEND_URL[m
-[31m- )[m
-[31m-[m
-[31m- async function getProjectBySlug(){[m
-[31m- const {success, error, data} = await projectController.getProject([m
-[31m- {projectSlug: params.project},[m
-[31m- {}[m
-[31m- )[m
-[31m-[m
-[31m- if( success && data ){[m
-[31m- //@ts-ignore[m
-[32m+[m[32m if (success && data) {[m
- setCurrentProject(data)[m
-[31m- }[m
-[31m- else{[m
-[32m+[m[32m } else {[m
- // eslint-disable-next-line no-console -- we need to log the error[m
- console.error(error)[m
- }[m
- }[m
- [m
- getProjectBySlug()[m
-[31m-[m
- }, [params.project])[m
- [m
- return ([m
-[1mdiff --git a/apps/platform/src/app/(main)/settings/@profile/page.tsx b/apps/platform/src/app/(main)/settings/@profile/page.tsx[m
-[1mindex 21de60b..4559ec6 100644[m
-[1m--- a/apps/platform/src/app/(main)/settings/@profile/page.tsx[m
-[1m+++ b/apps/platform/src/app/(main)/settings/@profile/page.tsx[m
-[36m@@ -1,54 +1,52 @@[m
- 'use client'[m
-[31m-import React, { useEffect, useState } from 'react'[m
-[32m+[m[32mimport React, { useCallback, useEffect, useState } from 'react'[m
- import { toast } from 'sonner'[m
-[31m-import type { User } from '@keyshade/schema'[m
- import InputLoading from './loading'[m
- import { Input } from '@/components/ui/input'[m
- import { Separator } from '@/components/ui/separator'[m
-[32m+[m[32mimport ControllerInstance from '@/lib/controller-instance'[m
- import { Button } from '@/components/ui/button'[m
-[31m-import { apiClient } from '@/lib/api-client'[m
-[31m-[m
-[31m-type UserData = Omit<[m
-[31m- User,[m
-[31m- 'id' | 'isActive' | 'isOnboardingFinished' | 'isAdmin' | 'authProvider'[m
-[31m->[m
-[31m-async function getUserDetails(): Promise {[m
-[31m- try {[m
-[31m- return await apiClient.get('/user')[m
-[31m- } catch (error) {[m
-[31m- // eslint-disable-next-line no-console -- we need to log the error[m
-[31m- console.error(error)[m
-[31m- }[m
-[31m-}[m
-[31m-[m
-[31m-async function updateUserDetails(userData: UserData): Promise {[m
-[31m- try {[m
-[31m- await apiClient.put('/user', userData)[m
-[31m- } catch (error) {[m
-[31m- // eslint-disable-next-line no-console -- we need to log the error[m
-[31m- console.error(error)[m
-[31m- }[m
-[31m-}[m
- [m
- function ProfilePage(): React.JSX.Element {[m
- const [isLoading, setIsLoading] = useState(true)[m
-[31m- const [userData, setUserData] = useState({[m
-[32m+[m[32m const [userData, setUserData] = useState({[m
- email: '',[m
- name: '',[m
- profilePictureUrl: ''[m
- })[m
- const [isModified, setIsModified] = useState(false)[m
- [m
-[32m+[m[32m const updateSelf = useCallback(async () => {[m
-[32m+[m[32m try {[m
-[32m+[m[32m await ControllerInstance.getInstance().userController.updateSelf([m
-[32m+[m[32m {[m
-[32m+[m[32m name: userData.name,[m
-[32m+[m[32m email: userData.email[m
-[32m+[m[32m },[m
-[32m+[m[32m {}[m
-[32m+[m[32m )[m
-[32m+[m[32m toast.success('Profile updated successfully')[m
-[32m+[m[32m } catch (error) {[m
-[32m+[m[32m // eslint-disable-next-line no-console -- we need to log the error[m
-[32m+[m[32m console.error(error)[m
-[32m+[m[32m }[m
-[32m+[m[32m setIsModified(false)[m
-[32m+[m[32m }, [userData])[m
-[32m+[m
- useEffect(() => {[m
-[31m- getUserDetails()[m
-[31m- .then((data) => {[m
-[31m- if (data) {[m
-[32m+[m[32m ControllerInstance.getInstance()[m
-[32m+[m[32m .userController.getSelf()[m
-[32m+[m[32m .then(({ data, success, error }) => {[m
-[32m+[m[32m if (success && data) {[m
- setUserData({[m
- email: data.email,[m
-[31m- name: data.name ?? '',[m
-[31m- profilePictureUrl: data.profilePictureUrl[m
-[32m+[m[32m name: data.name,[m
-[32m+[m[32m profilePictureUrl: data.profilePictureUrl || ''[m
- })[m
- setIsLoading(false)[m
-[32m+[m[32m } else {[m
-[32m+[m[32m // eslint-disable-next-line no-console -- we need to log the error[m
-[32m+[m[32m console.error(error)[m
- }[m
- })[m
- .catch((error) => {[m
-[36m@@ -67,7 +65,7 @@[m [mfunction ProfilePage(): React.JSX.Element {[m
- Upload a picture to change your avatar across Keyshade.[m
- [m
-
[m
-[31m-
{' '}[m
-[32m+[m[32m
[m
- {/* //! This is will be replaced by an image tag */}[m
-
[m
- {/* Name */}[m
-[36m@@ -114,20 +112,7 @@[m [mfunction ProfilePage(): React.JSX.Element {[m
- )}[m
- [m
-