Skip to content

Commit

Permalink
feat: SEO things
Browse files Browse the repository at this point in the history
Signed-off-by: Karthik Ayangar <[email protected]>
  • Loading branch information
kituuu committed Jun 7, 2024
1 parent abf373e commit 4b6d7f7
Show file tree
Hide file tree
Showing 14 changed files with 110 additions and 24 deletions.
19 changes: 0 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +0,0 @@
# T3 Gallery

## TODO

- [x] Make it deploy
- [x] Scaffold basic ui with mock data
- [x] Tidy up build process
- [x] Actually set up a database (versel postgres)
- [x] Attach database to UI
- [x] Add authentication (w/ clerk)
- [x] Add image upload
- [x] "taint" (server only)
- [x] use next/Image
- [x] Error management (w /sentry)
- [x] Routing/ image page (parralel route)
- [x] Update upload button to be less cringy
- [x] Analytics (posthog)
- [x] Delete button with server action
- [x] Ratelimiting (upstash)
Binary file added public/android-chrome-192x192.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 public/android-chrome-512x512.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 public/apple-touch-icon.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 public/favicon-16x16.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 public/favicon-32x32.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 modified public/favicon.ico
Binary file not shown.
15 changes: 15 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"short_name": "Personal Space",
"name": "Personal Space",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
2 changes: 2 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-Agent: *
Allow: /
19 changes: 19 additions & 0 deletions public/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Personal Space",
"short_name": "Personal Space",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#000000",
"background_color": "#000000",
"display": "standalone"
}
6 changes: 5 additions & 1 deletion src/app/api/uploadthing/core.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { auth } from "@clerk/nextjs/server";
import { auth, clerkClient } from "@clerk/nextjs/server";
import { createUploadthing, type FileRouter } from "uploadthing/next";
import { UploadThingError } from "uploadthing/server";
import { db } from "~/server/db";
Expand All @@ -13,6 +13,10 @@ export const ourFileRouter = {
const user = auth();
if (!user.userId) throw new UploadThingError("Unauthorized");

const fullUserData = await clerkClient.users.getUser(user.userId);
if (fullUserData.privateMetadata["allow-upload"] !== true)
throw new UploadThingError("Not allowed to upload");

const { success } = await ratelimit.limit(user.userId);
if (!success) throw new UploadThingError("Rate limited");

Expand Down
34 changes: 30 additions & 4 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,37 @@ import { ourFileRouter } from "./api/uploadthing/core";
import { Toaster } from "~/components/ui/sonner";
import { CSPostHogProvider } from "./_analytics/AnalyticsProvider";
import { SpeedInsights } from "@vercel/speed-insights/next";
import { METADATA } from "~/const";
import { Metadata } from "next";

export const metadata = {
title: "T3 Gallery",
description: "Generated by create-t3-app",
icons: [{ rel: "icon", url: "/favicon.ico" }],
export const metadata: Metadata = {
title: METADATA.title,
description: METADATA.description,
keywords: METADATA.keywords,
authors: [{ name: METADATA.author }],
manifest: METADATA.manifest,
icons: [
{
url: METADATA.apple_touch_icon,
type: "apple-touch-icon",
sizes: "180x180",
rel: "apple-touch-icon",
},
{
rel: "icon",
type: "image/png",
sizes: "32x32",
url: METADATA.favicon_32x32,
},
{
rel: "icon",
type: "image/png",
sizes: "16x16",
url: METADATA.favicon_16x16,
},
{ rel: "icon", url: METADATA.icon },
{ rel: "manifest", url: METADATA.web_manifest },
],
};

export default function RootLayout({
Expand Down
13 changes: 13 additions & 0 deletions src/const.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export const METADATA = {
title: "Personal Space",
description:
"Your personal sanctuary for cherished memories. Safely store and organize your precious moments with ease.",
keywords: "karthik, ayangar, wonder wall, kituuu, gallery",
author: "Karthik Ayangar",
manifest: `/manifest.json`,
web_manifest: `/site.webmanifest`,
favicon_16x16: `/favicon-16x16.png`,
favicon_32x32: `/favicon-32x32.png`,
icon: `/favicon.ico`,
apple_touch_icon: `/apple-touch-icon.png`,
};
26 changes: 26 additions & 0 deletions todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# T3 Gallery

## TODO

- [x] Make it deploy
- [x] Scaffold basic ui with mock data
- [x] Tidy up build process
- [x] Actually set up a database (versel postgres)
- [x] Attach database to UI
- [x] Add authentication (w/ clerk)
- [x] Add image upload
- [x] "taint" (server only)
- [x] use next/Image
- [x] Error management (w /sentry)
- [x] Routing/ image page (parralel route)
- [x] Update upload button to be less cringy
- [x] Analytics (posthog)
- [x] Delete button with server action
- [x] Ratelimiting (upstash)

## Challenges

- Fix the page layout for images of different resolutions
- "Selecting" images on the gallery page (use zustand)
- Infinite scroll
- folders or albums

0 comments on commit 4b6d7f7

Please sign in to comment.