-
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
Showing
15 changed files
with
4,403 additions
and
2,488 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
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,8 @@ | ||
import { Module } from "@nestjs/common"; | ||
import { PrismaService } from "./PrismaService"; | ||
|
||
@Module({ | ||
exports: [PrismaService], | ||
providers: [PrismaService], | ||
}) | ||
export class PrismaModule {} |
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,23 @@ | ||
import { Injectable } from "@nestjs/common"; | ||
import { | ||
HealthCheckError, | ||
HealthIndicator, | ||
HealthIndicatorResult, | ||
} from "@nestjs/terminus"; | ||
|
||
import { PrismaService } from "../PrismaService"; | ||
|
||
@Injectable() | ||
export class PrismaHealthIndicator extends HealthIndicator { | ||
constructor(private readonly prismaService: PrismaService) { | ||
super(); | ||
} | ||
|
||
async isHealthy(key: string): Promise<HealthIndicatorResult> { | ||
return this.prismaService.$queryRaw`SELECT 1` | ||
.then(() => this.getStatus(key, true)) | ||
.catch((e) => { | ||
throw new HealthCheckError(e.message, this.getStatus(key, false, e)); | ||
}); | ||
} | ||
} |
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,19 @@ | ||
import { Controller, Get } from "@nestjs/common"; | ||
import { HealthCheck, HealthCheckService } from "@nestjs/terminus"; | ||
import { SkipThrottle } from "@nestjs/throttler"; | ||
import { PrismaHealthIndicator } from "./PrismaHealth"; | ||
|
||
@Controller("health") | ||
export class HealthController { | ||
constructor( | ||
private health: HealthCheckService, | ||
private prisma: PrismaHealthIndicator, | ||
) {} | ||
|
||
@SkipThrottle() | ||
@Get() | ||
@HealthCheck() | ||
check() { | ||
return this.health.check([() => this.prisma.isHealthy("database")]); | ||
} | ||
} |
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,12 @@ | ||
import { Module } from "@nestjs/common"; | ||
import { TerminusModule } from "@nestjs/terminus"; | ||
import { PrismaModule } from "../PrismaModule"; | ||
import { HealthController } from "./PrismaHealthController"; | ||
import { PrismaHealthIndicator } from "./PrismaHealth"; | ||
|
||
@Module({ | ||
imports: [TerminusModule, PrismaModule], | ||
controllers: [HealthController], | ||
providers: [PrismaHealthIndicator], | ||
}) | ||
export class HealthModule {} |
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 @@ | ||
const { defineConfig } = require("cypress"); | ||
|
||
module.exports = defineConfig({ | ||
e2e: { | ||
setupNodeEvents(on, config) {}, | ||
}, | ||
}); |
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 @@ | ||
import "@testing-library/cypress/add-commands"; |
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 @@ | ||
import "./commands"; |
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 @@ | ||
declare namespace Cypress {} |
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,97 @@ | ||
import MarbleFiLogo from "@/components/MarbleFiLogo"; | ||
import { Tag } from "@/components/Tag"; | ||
import clsx from "clsx"; | ||
import { FaReddit } from "react-icons/fa"; | ||
import { FaXTwitter } from "react-icons/fa6"; | ||
import Link from "next/link"; | ||
|
||
const footerLinks = [ | ||
{ | ||
title: "FAQs", | ||
link: "/faqs", | ||
}, | ||
{ | ||
title: "Documentation", | ||
link: "/documentation", | ||
}, | ||
{ | ||
title: "Terms of Use", | ||
link: "/terms-of-use", | ||
}, | ||
|
||
{ | ||
title: "Privacy Notice", | ||
link: "/privacy-notice", | ||
}, | ||
]; | ||
|
||
export default function AppFooter() { | ||
return ( | ||
<footer className="py-10 md:py-0 max-w-5xl px-5 min-w-fit w-full bottom-0 grid gap-y-5"> | ||
<section className="flex flex-row items-center w-full justify-between md:py-10 md:border-t md:border-light-1000/10"> | ||
<div className="flex flex-row items-center md:w-full"> | ||
<MarbleFiLogo customStyle="w-[101px] h-[23px] md:w-fit sm:h-auto" /> | ||
|
||
<div className="md:block hidden"> | ||
<FooterNaviationLinkWeb /> | ||
</div> | ||
</div> | ||
<div className="ml-2 w-full md:w-fit md:justify-end"> | ||
<Tag | ||
text="v1.21" | ||
testID="footer-version-tag" | ||
customStyle="bg-light-1000/[0.05] px-3 !py-1 mr-2 w-fit" | ||
/> | ||
</div> | ||
<div className="flex flex-row items-center gap-x-2"> | ||
<FaReddit size={24} className="text-light-1000/50" /> | ||
<FaXTwitter size={24} className="text-light-1000/50" /> | ||
</div> | ||
</section> | ||
|
||
{/* Mobile view */} | ||
<div className="block md:hidden"> | ||
<FooterNaviationLinkMobile /> | ||
</div> | ||
</footer> | ||
); | ||
} | ||
|
||
function FooterNaviationLinkWeb() { | ||
return ( | ||
<div className="flex flex-row divide-light-1000/10 ml-6 w-full"> | ||
{footerLinks.map((link, index) => ( | ||
<div key={link.title} className="flex flex-row items-center"> | ||
<a | ||
href={link.link} | ||
className={clsx( | ||
"text-light-1000/50 font-mono text-sm px-3 text-center border-light-1000/10", | ||
{ "border-r": index !== footerLinks.length - 1 }, | ||
)} | ||
> | ||
{link.title} | ||
</a> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
} | ||
function FooterNaviationLinkMobile() { | ||
return ( | ||
<div className="flex flex-col"> | ||
{footerLinks.map((link, index) => ( | ||
<Link | ||
key={link.title} | ||
className={clsx( | ||
"border-b py-2 border-light-1000/10 text-light-1000/50 active:text-opacity-10 text-xs cursor-pointer", | ||
{ "pt-0": index === 0 }, | ||
{ "pb-0 border-b-0": index === footerLinks.length - 1 }, | ||
)} | ||
href={link.link} | ||
> | ||
<span className="py-1">{link.title}</span> | ||
</Link> | ||
))} | ||
</div> | ||
); | ||
} |
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
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.