Skip to content

Commit f4595cf

Browse files
committed
some fix and env var change
1 parent 83c1d20 commit f4595cf

16 files changed

Lines changed: 97 additions & 83 deletions

File tree

.env.example

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ NEXT_PUBLIC_MAPBOX_API=mapbox-key
3939
# Cron (openssl rand -hex 32)
4040
CRON_SECRET=some-random-secret
4141

42+
# Resend
43+
RESEND_API_KEY=
44+
4245
# Supabase
43-
SUPABASE_URL=
44-
SUPABASE_PUBLISHABLE_DEFAULT_KEY=
45-
SUPABASE_ANON_KEY=
46-
SUPABASE_SERVICE_ROLE_KEY=
46+
SUPABASE_DB_URL=
47+
SUPABASE_ANON_KEY=

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Bootstrapped using the create-t3-app using:
1414
- [Drizzle ORM](https://orm.drizzle.team/docs/overview)
1515
- [Clerk authentication](https://clerk.com/docs)
1616
- [Vercel](https://vercel.com)
17-
- [Xata](https://app.xata.io)
17+
- [Supabase](https://supabase.com/)
18+
- Deprecated: [Xata lite](https://app.xata.io)
1819

1920
We use [pnpm](https://pnpm.io/) as the package manager for this project.
2021

@@ -32,22 +33,26 @@ pnpm i <dep_name> -E
3233
pnpm upgrade -L
3334

3435
# Database migration
35-
pnpm drizzle-kit pull
36-
pnpm drizzle-kit generate
37-
pnpm drizzle-kit migrate
36+
npx drizzle-kit generate
37+
npx drizzle-kit push
3838
```
3939

40+
### Notes
41+
42+
- UTC time
43+
- When you make changes to the DB, please back up the data first.
44+
4045
## Planned Features
4146

4247
### Project Integration Enhancements
4348

44-
- Profiles will soon showcase the projects that users have contributed to, highlighting their work and collaborations.
49+
- Profiles showcase the projects that users have contributed to, highlighting their work and collaborations.
4550
- Applications to join our seasonal Summer and Winter projects will be directly accessible through the site for our members.
4651
- Committee members and Administrators will gain the ability to upload project specifics directly to the platform.
4752

4853
### User Profile Enhancements
4954

50-
- The platform will support multiple role assignments for users, offering tailored experiences based on their involvement and interests.
55+
- The platform supports multiple role assignments for users, offering tailored experiences based on their involvement and interests.
5156
- Enhanced profile customization options will be introduced.
5257

5358
### Event Participation and Management

src/app/dashboard/(root)/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default async function Dashboard() {
1313
Here you can see our upcoming projects and the projects you have participated in. You can apply for new
1414
projects here if we link the application form.
1515
</p>
16-
<div className="flex h-full mb-8">
16+
<div className="h-full mb-8">
1717
<DashboardContent />
1818
</div>
1919
</div>

src/app/dashboard/admin/@analytics/count.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import Link from "next/link"
2-
31
import { api } from "~/trpc/server"
42

53
interface CardProps {
@@ -25,13 +23,14 @@ const Card = (props: CardProps) => {
2523

2624
const Count = async () => {
2725
const count = await api.admin.analytics.getUserCount.query()
26+
const projectCount = await api.admin.analytics.getProjectCount.query()
2827

2928
return (
3029
<>
3130
<Card heading="Users" count={count.users} icon="group" />
3231
<Card heading="Members" count={count.members} icon="group" />
33-
<Card heading="Projects" count={"N/A"} icon="devices" />
34-
<Card heading="Events" count={"N/A"} icon="event" />
32+
<Card heading="Projects" count={projectCount.publicProjects} icon="devices" />
33+
{/* <Card heading="Events" count={"N/A"} icon="event" /> */}
3534
</>
3635
)
3736
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import * as React from "react"
2+
3+
import { Button } from "~/components/ui/button"
4+
import {
5+
Dialog,
6+
DialogContent,
7+
DialogDescription,
8+
DialogHeader,
9+
DialogTitle,
10+
DialogTrigger,
11+
} from "~/components/ui/dialog"
12+
13+
type ToolCardProps = {
14+
title: string
15+
children: React.ReactNode
16+
}
17+
18+
function ToolCard({ title, children }: ToolCardProps) {
19+
return (
20+
<div className="col-span-2 border bg-card text-card-foreground">
21+
<div className="flex flex-row items-center justify-between space-y-0 p-6 pb-2">
22+
<h3 className="text-sm font-medium tracking-tight">{title}</h3>
23+
</div>
24+
<div className="w-full p-6 pt-0">
25+
<Dialog>
26+
<DialogTrigger asChild>
27+
<Button>Open form</Button>
28+
</DialogTrigger>
29+
<DialogContent className="max-h-screen overflow-auto sm:max-w-md">
30+
<DialogHeader>
31+
<DialogTitle>{title}</DialogTitle>
32+
<DialogDescription></DialogDescription>
33+
</DialogHeader>
34+
{children}
35+
</DialogContent>
36+
</Dialog>
37+
</div>
38+
</div>
39+
)
40+
}
41+
42+
export default ToolCard

src/app/dashboard/admin/@tools/update-email.tsx

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,14 @@ import { useForm } from "react-hook-form"
55
import { z } from "zod"
66

77
import { Button } from "~/components/ui/button"
8-
import {
9-
Dialog,
10-
DialogContent,
11-
DialogDescription,
12-
DialogHeader,
13-
DialogTitle,
14-
DialogTrigger,
15-
} from "~/components/ui/dialog"
168
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "~/components/ui/form"
179
import { Input } from "~/components/ui/input"
1810
import { toast } from "~/components/ui/use-toast"
1911

2012
import { api } from "~/trpc/react"
2113

14+
import ToolCard from "./tool-card"
15+
2216
const formSchema = z.object({
2317
userId: z.string(),
2418
oldEmail: z.string().email(),
@@ -35,25 +29,9 @@ const defaultValues: FormSchema = {
3529

3630
const UpdateEmail = () => {
3731
return (
38-
<div className="col-span-2 border bg-card text-card-foreground">
39-
<div className="flex flex-row items-center justify-between space-y-0 p-6 pb-2">
40-
<h3 className="text-sm font-medium tracking-tight">Update Email</h3>
41-
</div>
42-
<div className="w-full p-6 pt-0">
43-
<Dialog>
44-
<DialogTrigger asChild>
45-
<Button>Open form</Button>
46-
</DialogTrigger>
47-
<DialogContent className="max-h-screen overflow-auto sm:max-w-md">
48-
<DialogHeader>
49-
<DialogTitle>Update user email</DialogTitle>
50-
<DialogDescription></DialogDescription>
51-
</DialogHeader>
52-
<UpdateEmailForm />
53-
</DialogContent>
54-
</Dialog>
55-
</div>
56-
</div>
32+
<ToolCard title="Update Email">
33+
<UpdateEmailForm />
34+
</ToolCard>
5735
)
5836
}
5937

src/app/profile/[id]/profile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ const ProfilePage = ({ id, currentUser }: ProfilePageProps) => {
146146
user.membership_expiry && (
147147
<div>
148148
Your membership will expire on{" "}
149-
<span className="text-primary">
149+
<span className="font-bold">
150150
{format(new Date(String(user.membership_expiry)), "dd MMMM yyyy")}
151151
</span>
152152
</div>

src/components/payment/online/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { type RouterOutputs } from "~/trpc/shared"
1616

1717
const Card = dynamic(() => import("./card"), {
1818
ssr: false,
19-
loading: () => <Skeleton className="h-[97px] w-full @[485px]:h-[48px]" />,
19+
loading: () => <Skeleton className="h-24 w-full @[485px]:h-12" />,
2020
})
2121
const GooglePay = dynamic(() => import("./google-pay"), {
2222
ssr: false,
@@ -206,7 +206,7 @@ const OnlinePaymentForm = ({
206206
</AccordionItem>
207207
</Accordion>
208208
) : (
209-
<Skeleton className="h-[320px] w-full" />
209+
<Skeleton className="h-80 w-full" />
210210
)
211211
}
212212

src/env.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ export const env = createEnv({
1414
UPSTASH_REDIS_REST_URL: z.string().url(),
1515
UPSTASH_REDIS_REST_TOKEN: z.string(),
1616
CRON_SECRET: z.string(),
17+
RESEND_API_KEY: z.string(),
18+
SUPABASE_DB_URL: z.string().url(),
19+
SUPABASE_ANON_KEY: z.string(),
1720
},
1821

1922
/**
@@ -53,6 +56,9 @@ export const env = createEnv({
5356
NEXT_PUBLIC_CLERK_SIGN_IN_URL: process.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL,
5457
NEXT_PUBLIC_CLERK_SIGN_UP_URL: process.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL,
5558
CRON_SECRET: process.env.CRON_SECRET,
59+
RESEND_API_KEY: process.env.RESEND_API_KEY,
60+
SUPABASE_DB_URL: process.env.SUPABASE_DB_URL,
61+
SUPABASE_ANON_KEY: process.env.SUPABASE_ANON_KEY,
5662
},
5763
/**
5864
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially

src/server/api/routers/admin/analytics/get-payments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { desc } from "drizzle-orm"
1+
import { desc, sql } from "drizzle-orm"
22

33
import { adminProcedure } from "~/server/api/trpc"
44
import { Payment } from "~/server/db/schema"

0 commit comments

Comments
 (0)