Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 48 additions & 54 deletions app/admin/login/page.tsx
Original file line number Diff line number Diff line change
@@ -1,65 +1,59 @@
"use client";

import { useState } from "react";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Button } from "@/components/ui/button";

export default function AdminLoginPage() {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");

const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
console.log({ email, password });
};
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
console.log({ email, password });
};

return (
<div className="flex min-h-screen items-center justify-center bg-background">
<div className="w-full max-w-md space-y-8 rounded-lg border border-border bg-card p-8 shadow-sm">
<div className="text-center">
<h1 className="text-2xl font-bold tracking-tight">Admin Login</h1>
<p className="mt-2 text-sm text-muted-foreground">
Sign in to access the admin dashboard
</p>
</div>
return (
<div className="flex min-h-screen items-center justify-center bg-background">
<div className="w-full max-w-md space-y-8 rounded-lg border border-border bg-card p-8 shadow-sm">
<div className="text-center">
<h1 className="text-2xl font-bold tracking-tight">Admin Login</h1>
<p className="mt-2 text-sm text-muted-foreground">
Sign in to access the admin dashboard
</p>
</div>

<form onSubmit={handleSubmit} className="space-y-6">
<div className="space-y-2">
<label htmlFor="email" className="text-sm font-medium">
Email
</label>
<input
id="email"
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="admin@example.com"
required
className="flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
/>
</div>
<form onSubmit={handleSubmit} className="space-y-6">
<div className="space-y-2">
<Label htmlFor="email">Email</Label>
<Input
id="email"
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="admin@example.com"
required
/>
</div>

<div className="space-y-2">
<label htmlFor="password" className="text-sm font-medium">
Password
</label>
<input
id="password"
type="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
placeholder="••••••••"
required
className="flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
/>
</div>
<div className="space-y-2">
<Label htmlFor="password">Password</Label>
<Input
id="password"
type="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
placeholder="••••••••"
required
/>
</div>

<button
type="submit"
className="inline-flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
>
Sign In
</button>
</form>
</div>
</div>
);
<Button type="submit" className="w-full">
Sign In
</Button>
</form>
</div>
</div>
);
}
23 changes: 14 additions & 9 deletions app/api/admin/events/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,36 @@
import { NextResponse } from "next/server";
import { prisma } from "@/lib/prisma";

export async function GET(_: Request, { params }: { params: { id: string } }) {
type RouteContext = { params: Promise<{ id: string }> };

export async function GET(_: Request, { params }: RouteContext) {
const { id } = await params;
// TODO: require admin
const event = await prisma.event.findUnique({ where: { id: params.id } });
const event = await prisma.event.findUnique({ where: { id } });
if (!event) return NextResponse.json({ error: "Not found" }, { status: 404 });
return NextResponse.json(event);
}

export async function PATCH(req: Request, { params }: { params: { id: string } }) {
export async function PATCH(req: Request, { params }: RouteContext) {
const { id } = await params;
// TODO: require admin
const body = await req.json();

const data: Record<string, any> = {};
const data: Record<string, unknown> = {};
if (body.title !== undefined) data.title = body.title;
if (body.description !== undefined) data.description = body.description ?? null;
if (body.startAt !== undefined) data.startAt = new Date(body.startAt);
if (body.endAt !== undefined) data.endAt = body.endAt ? new Date(body.endAt) : null;
if (body.location !== undefined) data.location = body.location ?? null;
if (body.link !== undefined) data.link = body.link ?? null;

if (data.startAt && data.endAt && data.endAt < data.startAt) {
if (data.startAt && data.endAt && (data.endAt as Date) < (data.startAt as Date)) {
return NextResponse.json({ error: "endAt cannot be before startAt" }, { status: 400 });
}

try {
const updated = await prisma.event.update({
where: { id: params.id },
where: { id },
data,
});
return NextResponse.json(updated);
Expand All @@ -36,12 +40,13 @@ export async function PATCH(req: Request, { params }: { params: { id: string } }
}
}

export async function DELETE(_: Request, { params }: { params: { id: string } }) {
export async function DELETE(_: Request, { params }: RouteContext) {
const { id } = await params;
// TODO: require admin
try {
await prisma.event.delete({ where: { id: params.id } });
await prisma.event.delete({ where: { id } });
return NextResponse.json({ ok: true });
} catch {
return NextResponse.json({ error: "Not found" }, { status: 404 });
}
}
}
4 changes: 1 addition & 3 deletions app/api/applications/startup/route.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
export const runtime = "nodejs";

import { NextResponse } from "next/server";
import { PrismaClient } from "@/generated/prisma/client";

const prisma = new PrismaClient();
import { prisma } from "@/lib/prisma";

export async function POST(request: Request) {
console.log("DATABASE_URL:", process.env.DATABASE_URL);
Expand Down
61 changes: 38 additions & 23 deletions app/apply/page.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,45 @@
import Link from "next/link";
import PublicLayout from "@/components/layout/PublicLayout";
import { useState } from "react";

export default function ApplyPage() {
const cards = [
{ id: "startup", label: "STARTUP\nAPPLICATION", href: "/apply/startup" },
{ id: "org", label: "ORG/COMPANY\nPROJECT FORM", href: "/apply/org" },
{ id: "student", label: "STUDENT/PRODUCT\nTEAM SKILLS FORM [Mock for now]", href: "#" },
];

export default function StrategicLeadersPage() {
return (
<PublicLayout>
<div className="mx-auto max-w-4xl px-6 py-12">
<h1 className="text-4xl font-semibold tracking-tight">Apply</h1>
<p className="text-gray-700 leading-relaxed mt-3">
Choose the application you want to start.
<div className="relative min-h-screen bg-white overflow-hidden flex flex-col items-center px-6 py-16">

<div className="absolute top-0 left-0 w-64 h-64 bg-rose-100 rounded-full -translate-x-1/3 -translate-y-1/4 opacity-70" />
<div className="absolute bottom-0 right-0 w-56 h-56 bg-rose-100 rounded-full translate-x-1/4 translate-y-1/4 opacity-70" />

<div className="relative z-10 text-center max-w-2xl mb-4">
<h1 className="text-4xl font-black text-black leading-tight mb-3">
Apply to Join a Private<br />
<span className="relative inline-block">
Network of Strategic Leaders
<span className="absolute left-0 -bottom-1 w-full h-0.5 bg-cyan-400" />
</span>
</h1>
<p className="text-gray-500 text-lg mt-4 leading-relaxed">
Learn from our executive strategy playbook<br />
and get access to our network of strategic leaders.
</p>
</div>

<section className="mt-10">
<h2 className="text-2xl font-semibold mb-3">Application Types</h2>
<div className="flex flex-col gap-4">
<Link href="/apply/startup" className="underline text-gray-700 hover:text-black">
Startup Application
</Link>
<Link href="/apply/org" className="underline text-gray-700 hover:text-black">
Org Application
</Link>
<Link href="/apply/team" className="underline text-gray-700 hover:text-black">
Team Application
</Link>
</div>
</section>
<div className="relative z-10 flex flex-col sm:flex-row gap-6 mt-10 w-full max-w-4xl justify-center">
{cards.map((card) => (
<a
key={card.id}
href={card.href}
className="flex-1 min-h-96 bg-sky-100 rounded-3xl flex items-start justify-start p-6 hover:bg-sky-200 hover:shadow-md transition-all duration-200 group"
>
<span className="text-black font-bold text-lg uppercase tracking-wide leading-snug whitespace-pre-line group-hover:text-cyan-700 transition-colors">
{card.label}
</span>
</a>
))}
</div>
</PublicLayout>
</div>
);
}
118 changes: 53 additions & 65 deletions app/apply/startup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

import { useState } from "react";
import PublicLayout from "@/components/layout/PublicLayout";
import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
import { Label } from "@/components/ui/label";
import { Button } from "@/components/ui/button";

type StartupFormState = {
name: string;
Expand Down Expand Up @@ -32,79 +36,63 @@ export default function StartupApplyPage() {
<div className="mx-auto max-w-2xl px-6 py-12">
<h1 className="text-3xl font-semibold">Startup Application</h1>
<p className="mt-2 text-gray-600">
UI only for now — submitting will log your inputs to the console.
Tell us more about your startup!
</p>

<form onSubmit={handleSubmit} className="mt-8 space-y-6">
<div className="space-y-2">
<label className="block font-medium" htmlFor="name">
Startup Name
</label>
<input
id="name"
type="text"
value={form.name}
onChange={(e) => updateField("name", e.target.value)}
className="w-full rounded-md border px-3 py-2"
placeholder="e.g., Startup Labs"
required
/>
</div>
<div className="space-y-2">
<Label htmlFor="description">Tell us more about your startup!</Label>
<Textarea
id="description"
value={form.description}
onChange={(e) => updateField("description", e.target.value)}
placeholder="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
rows={5}
required
/>
</div>

<div className="space-y-2">
<label className="block font-medium" htmlFor="description">
Description
</label>
<textarea
id="description"
value={form.description}
onChange={(e) => updateField("description", e.target.value)}
className="w-full rounded-md border px-3 py-2"
placeholder="What does your startup do?"
rows={5}
required
/>
</div>
<div className="space-y-2">
<Label htmlFor="name">Link to pitch deck</Label>
<Input
id="name"
type="url"
value={form.name}
onChange={(e) => updateField("name", e.target.value)}
placeholder="Loremipsumdolorsitamet.com"
required
/>
</div>

<div className="space-y-2">
<label className="block font-medium" htmlFor="fundingGoal">
Funding Goal
</label>
<input
id="fundingGoal"
type="text"
value={form.fundingGoal}
onChange={(e) => updateField("fundingGoal", e.target.value)}
className="w-full rounded-md border px-3 py-2"
placeholder="e.g., $50,000"
required
/>
</div>
<div className="space-y-2">
<Label htmlFor="fundingGoal">Funding goal ($)</Label>
<Input
id="fundingGoal"
type="text"
value={form.fundingGoal}
onChange={(e) => updateField("fundingGoal", e.target.value)}
placeholder="100,000,000"
required
/>
</div>

<div className="space-y-2">
<label className="block font-medium" htmlFor="contact">
Contact (email or phone)
</label>
<input
id="contact"
type="text"
value={form.contact}
onChange={(e) => updateField("contact", e.target.value)}
className="w-full rounded-md border px-3 py-2"
placeholder="you@company.com"
required
/>
</div>
<div className="space-y-2">
<Label htmlFor="contact">Link to external funding site</Label>
<Input
id="contact"
type="url"
value={form.contact}
onChange={(e) => updateField("contact", e.target.value)}
placeholder="Loremipsumdolorsitamet.com"
required
/>
</div>

<button
type="submit"
className="rounded-md border px-4 py-2 font-medium hover:bg-gray-50"
>
Submit
</button>
</form>
<div className="flex justify-center pt-4">
<Button type="submit">Apply</Button>
</div>
</form>
</div>
</PublicLayout>
);
}

Loading