Skip to content

Commit

Permalink
feat: add template
Browse files Browse the repository at this point in the history
  • Loading branch information
chronark committed Oct 20, 2024
1 parent 83b14b8 commit 4a6d726
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ const validCharactersRegex = /^[a-zA-Z0-9-_]+$/;

const formSchema = z.object({
workspaceId: z.string(),
name: z
.string()
.min(3)
.regex(validCharactersRegex, {
message: "Workspace can only contain letters, numbers, dashes, and underscores",
})
name: z.string().min(3).regex(validCharactersRegex, {
message: "Workspace can only contain letters, numbers, dashes, and underscores",
}),
});

type Props = {
Expand Down
39 changes: 39 additions & 0 deletions apps/www/app/templates/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export const frameworks = [
"Oak",
"FastAPI",
"NestJS",
"Koa",
"AdonisJS",
] as const;
export type Framework = StrArrayToUnion<typeof frameworks>;
// id -> label
Expand Down Expand Up @@ -55,6 +57,43 @@ export type Template = {
};

export const templates: Record<string, Template> = {
"adonis-ratelimit": {
title: "Ratelimiting in AdonisJS apps",
description: "Dynami IP based ratelimiting.",
authors: ["Ionfinisher"],
repository: "https://github.com/Ionfinisher/unkey-adonisjs-ratelimit",

image: "/images/templates/adonis-ratelimit.png",
readmeUrl:
"https://raw.githubusercontent.com/Ionfinisher/unkey-adonisjs-ratelimit/heads/main/README.md",

language: "Typescript",
framework: "AdonisJS",
},
sealshare: {
title: "End-to-end encrypted secret sharing",
description: "Share secrets securely, directly in your browser.",
authors: ["unrenamed"],
repository: "https://github.com/unrenamed/sealshare",

image: "/images/templates/sealshare.png",
readmeUrl: "https://raw.githubusercontent.com/unrenamed/sealshare/heads/main/README.md",

language: "Typescript",
framework: "Next.js",
},
koa: {
title: "Koa.js middleware with Unkey RBAC",
description: "Implement API key verification in your Koa apps",
authors: ["harshsbhat"],
repository: "https://github.com/harshsbhat/unkey-koa",

image: "/images/templates/koa.png",
readmeUrl: "https://raw.githubusercontent.com/harshsbhat/unkey-koa/heads/main/README.md",

language: "Typescript",
framework: "Koa",
},
"nextjs-supabase-payasyougo": {
title: "Next.js Pay-as-you-Go starter kit",
description: "Building Pay-As-You-Go apps with Next.js, Unkey and Supabase",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/www/public/images/templates/koa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/www/public/images/templates/sealshare.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4a6d726

Please sign in to comment.