-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f9f304
commit 225a1e0
Showing
78 changed files
with
2,181 additions
and
1,203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
DATABASE_URL=postgres://postgres:test123@localhost:5432 | ||
REDIS_KEY=AZ8JASQgYjIyYzgyM2EtMDViZC00ZjRiLTgzOGItMDI0OGEwZTdkZDc2ZDk5OTBjM2RjM2ZlNGU3MTk2YzA5ZDQyZGI5NzU2ZmI= | ||
DATABASE_URL=postgresql://localhost:5432/seistart | ||
NEXTAUTH_JWT_SECRET=KyxVXUR2EIF1MuesX9ygnnsfeQyu7ExK_2suK6lLqWA4evzzDjBTR1KF__frGgWGjFoUCk1p2PPpBIeG5tVydQ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,4 @@ yarn-error.log* | |
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
next-env.d.ts |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
// TODO: Add analytics | ||
import { getUser } from "@/auth/auth-guard" | ||
import { Role } from "@/server-actions/entitlements/entitlements.models" | ||
import { redirect } from "next/navigation" | ||
|
||
export default async function AnalyticsPage() { | ||
const { entitlements } = await getUser() | ||
if (!entitlements || entitlements.role !== Role.Admin) redirect("/dashboard") | ||
return <h1 className="my-4 text-2xl font-semibold">Analytics</h1> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
import { getUser } from "@/auth/auth-guard" | ||
import { CreateProject } from "@/components/pages/create-project" | ||
import { Permission } from "@/server-actions/entitlements/entitlements.models" | ||
import { getAllTagsAction } from "@/server-actions/tags/tags.actions" | ||
import { redirect } from "next/navigation" | ||
|
||
export default async function CreateProjectPage() { | ||
const { tags } = await getAllTagsAction() | ||
return <CreateProject tags={tags}></CreateProject> | ||
const { entitlements } = await getUser() | ||
if (entitlements && entitlements.permissions[Permission.ProjectSelfWrite]) { | ||
const { tags } = await getAllTagsAction() | ||
return <CreateProject tags={tags}></CreateProject> | ||
} else { | ||
redirect("/dashboard") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
import { getUser } from "@/auth/auth-guard" | ||
import { EditProject } from "@/components/pages/edit-project" | ||
import { Permission } from "@/server-actions/entitlements/entitlements.models" | ||
import { getProjectBySlugAction } from "@/server-actions/projects/projects.actions" | ||
import { getAllTagsAction } from "@/server-actions/tags/tags.actions" | ||
import { Metadata } from "next" | ||
import { redirect } from "next/navigation" | ||
|
||
export async function generateMetadata({ | ||
params, | ||
}: { | ||
params: { slug: string } | ||
}) { | ||
const { project } = await getProjectBySlugAction(params.slug) | ||
return { | ||
title: project.name, | ||
description: project.description, | ||
keywords: project.tags, | ||
} | ||
export const metadata: Metadata = { | ||
title: "Edit Project", | ||
} | ||
|
||
export default async function EditProjectPage({ | ||
params, | ||
}: { | ||
params: { slug: string } | ||
}) { | ||
const { entitlements, userId } = await getUser() | ||
const { project } = await getProjectBySlugAction(params.slug) | ||
const { tags } = await getAllTagsAction() | ||
return <EditProject project={project} tags={tags}></EditProject> | ||
if ( | ||
entitlements && | ||
((entitlements.permissions[Permission.ProjectSelfEdit] && | ||
project.userId === userId) || | ||
entitlements.permissions[Permission.ProjectAllEdit]) | ||
) { | ||
const { tags } = await getAllTagsAction() | ||
return <EditProject project={project} tags={tags}></EditProject> | ||
} else { | ||
redirect("/dashboard") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,34 @@ | ||
import { getUser } from "@/auth/auth-guard" | ||
import { EditProjects } from "@/components/pages/edit-projects" | ||
import { getAllProjectsAction } from "@/server-actions/projects/projects.actions" | ||
import { Permission } from "@/server-actions/entitlements/entitlements.models" | ||
import { | ||
getAllProjectsAction, | ||
getAllProjectsByUserAction, | ||
} from "@/server-actions/projects/projects.actions" | ||
import { redirect } from "next/navigation" | ||
|
||
export default async function EditProjectsPage() { | ||
const { projects } = await getAllProjectsAction() | ||
return ( | ||
<> | ||
<h1 className="my-4 text-2xl font-semibold">Edit Projects</h1> | ||
<EditProjects projects={projects}></EditProjects> | ||
</> | ||
) | ||
const { entitlements, userId } = await getUser() | ||
if (entitlements && entitlements.permissions[Permission.ProjectAllEdit]) { | ||
const { projects } = await getAllProjectsAction() | ||
return ( | ||
<> | ||
<h1 className="my-4 text-2xl font-semibold">Edit Projects</h1> | ||
<EditProjects projects={projects}></EditProjects> | ||
</> | ||
) | ||
} else if ( | ||
entitlements && | ||
entitlements.permissions[Permission.ProjectSelfEdit] | ||
) { | ||
const { projects } = await getAllProjectsByUserAction(userId) | ||
return ( | ||
<> | ||
<h1 className="my-4 text-2xl font-semibold">Edit Projects</h1> | ||
<EditProjects projects={projects}></EditProjects> | ||
</> | ||
) | ||
} else { | ||
redirect("/dashboard") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
import { getUserAuth } from "@/auth/auth-guard" | ||
import SignOutBtn from "@/components/auth/sign-out-button" | ||
|
||
export default async function DashboardPage() { | ||
const { session } = await getUserAuth() | ||
return ( | ||
<> | ||
<div className="flex w-full flex-row items-center justify-between"> | ||
<h1 className="my-2 text-2xl font-bold">Home</h1> <SignOutBtn /> | ||
</div> | ||
<pre className="my-2 rounded-lg bg-secondary p-4"> | ||
{session?.user.email} | ||
</pre> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
import { getUser } from "@/auth/auth-guard" | ||
import { DashboardTags } from "@/components/pages/dashboard-tags" | ||
import { Role } from "@/server-actions/entitlements/entitlements.models" | ||
import { getAllTagsAction } from "@/server-actions/tags/tags.actions" | ||
import { redirect } from "next/navigation" | ||
|
||
export default async function ProjectsPage() { | ||
const { entitlements } = await getUser() | ||
if (!entitlements || entitlements.role !== Role.Admin) redirect("/dashboard") | ||
const { tags } = await getAllTagsAction() | ||
return <DashboardTags tags={tags}></DashboardTags> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Wallets } from "@/components/pages/wallets" | ||
import { getAllWalletsAction } from "@/server-actions/wallets/wallets.actions" | ||
|
||
export default async function ProjectsPage() { | ||
const { wallets } = await getAllWalletsAction() | ||
return <Wallets wallets={wallets}></Wallets> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { getUser } from "@/auth/auth-guard" | ||
import { Role } from "@/server-actions/entitlements/entitlements.models" | ||
import { redirect } from "next/navigation" | ||
|
||
export default async function EcosystemLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
const { entitlements } = await getUser() | ||
if (!entitlements || entitlements.role !== Role.Admin) redirect("/") | ||
return <>{children}</> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.