Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
189 commits
Select commit Hold shift + click to select a range
a0eecca
Ignore Neon CLI local metadata in .gitignore.
Grenish Sep 1, 2026
93d65b1
Add Better Auth, Drizzle, Neon, and shadcn dependencies.
Grenish Sep 1, 2026
cf7cce4
Refresh the npm lockfile for the new runtime dependencies.
Grenish Sep 1, 2026
30a388b
Add a Bun lockfile alongside the npm lockfile.
Grenish Sep 1, 2026
944813e
Add Neon branch config with a seven-day TTL for preview branches.
Grenish Sep 1, 2026
83b542f
Point Drizzle Kit at lib/db/schema.ts and the unpooled Neon URL.
Grenish Sep 1, 2026
cf45741
Define Better Auth Postgres tables with Drizzle 1.0 relations.
Grenish Sep 1, 2026
4353dc2
Re-export the auth schema from the Drizzle schema barrel.
Grenish Sep 1, 2026
751f15e
Create a Neon HTTP Drizzle client using auth relations.
Grenish Sep 1, 2026
ec1722f
Configure Better Auth with the Drizzle relations-v2 adapter.
Grenish Sep 1, 2026
326e390
Export a Better Auth React client for browser sign-in flows.
Grenish Sep 1, 2026
553df09
Add the cn helper for merging Tailwind class names.
Grenish Sep 1, 2026
447e630
Add the SQL migration that creates Better Auth tables.
Grenish Sep 1, 2026
a0f57fd
Store the Drizzle snapshot for the Better Auth migration.
Grenish Sep 1, 2026
f2a084a
Expose Better Auth HTTP handlers on the Next.js catch-all route.
Grenish Sep 1, 2026
4dd62f0
Initialize shadcn with the base-rhea style and Remixicon.
Grenish Sep 1, 2026
f791a4c
Add the shadcn Button primitive for shared actions.
Grenish Sep 1, 2026
3dbb12c
Add the shadcn Input primitive for form fields.
Grenish Sep 1, 2026
2811c7d
Add the shadcn Textarea primitive for long-form content.
Grenish Sep 1, 2026
2645f54
Add the shadcn Label primitive for accessible form labels.
Grenish Sep 1, 2026
35dcd1e
Add the shadcn Checkbox primitive for boolean fields.
Grenish Sep 1, 2026
4984281
Add the shadcn Field layout helpers for form groups.
Grenish Sep 1, 2026
154bd67
Add the shadcn InputGroup primitive for addon inputs.
Grenish Sep 1, 2026
78f79f0
Add the shadcn Card primitive for content panels.
Grenish Sep 1, 2026
41e35b2
Add the shadcn Dialog primitive for modal flows.
Grenish Sep 1, 2026
f49ce8a
Add the shadcn DropdownMenu primitive for compact menus.
Grenish Sep 1, 2026
c249368
Add the shadcn Avatar primitive for user images.
Grenish Sep 1, 2026
faf8546
Add the shadcn Badge primitive for status labels.
Grenish Sep 1, 2026
e1897ba
Add the shadcn Separator primitive for visual dividers.
Grenish Sep 1, 2026
6a3da67
Add the shadcn Empty primitive for zero-state layouts.
Grenish Sep 1, 2026
9af2544
Add the shadcn Pagination primitive for list navigation.
Grenish Sep 1, 2026
d86d842
Add the shadcn Spinner primitive for in-flight actions.
Grenish Sep 1, 2026
d6a026b
Add the shadcn Toast primitive for transient feedback.
Grenish Sep 1, 2026
f00a10a
Add a next-themes ThemeProvider wrapper for class-based theming.
Grenish Sep 1, 2026
72b449f
Add a theme toggle menu using DropdownMenu and Remixicon.
Grenish Sep 1, 2026
45ab53a
Add a Blogly header navbar shell for site navigation.
Grenish Sep 1, 2026
8b17679
Add shadcn typeset styles for article and heading rhythm.
Grenish Sep 1, 2026
707f141
Replace starter colors with shadcn tokens and dark-mode variants.
Grenish Sep 1, 2026
e3283c2
Rebrand the root layout to Blogly fonts, metadata, and theming.
Grenish Sep 1, 2026
66f67a1
Remove the default App Router page in favor of the home route group.
Grenish Sep 1, 2026
68b0b24
Move the landing page into the (home) route group.
Grenish Sep 1, 2026
7b10e95
Set the Turbopack root so Next.js resolves this app directory.
Grenish Sep 1, 2026
211fd5c
Remove the unused Create Next App file icon.
Grenish Sep 1, 2026
e0cc181
Remove the unused Create Next App globe icon.
Grenish Sep 1, 2026
1107f7b
Remove the Next.js wordmark from public assets.
Grenish Sep 1, 2026
4e60c8f
Remove the Vercel logomark from public assets.
Grenish Sep 1, 2026
505f720
Remove the unused Create Next App window icon.
Grenish Sep 1, 2026
fe39307
Add Motion for scroll-driven navbar typography.
Grenish Sep 2, 2026
ec5fcf0
Lock Motion and the Better Auth Drizzle adapter in bun.lock.
Grenish Sep 2, 2026
9346a3e
Require a unique username on the Better Auth user table.
Grenish Sep 2, 2026
89a7536
Add a blogs table with draft status and a featured flag.
Grenish Sep 2, 2026
d2b49a6
Migrate a unique username column onto the user table.
Grenish Sep 2, 2026
547af69
Record the Drizzle snapshot after adding user.username.
Grenish Sep 2, 2026
2618f04
Add the shadcn Tabs primitive for feed filters.
Grenish Sep 2, 2026
d712673
Build a featured post bento with one main card and two side cards.
Grenish Sep 2, 2026
e98b709
Size the theme toggle to match the navbar Login button.
Grenish Sep 2, 2026
2363544
Stick the Blogly header and shrink the wordmark on scroll.
Grenish Sep 2, 2026
46db7a5
Render the site navbar on every page from the root layout.
Grenish Sep 2, 2026
4388e6a
Replace the starter landing page with featured posts and feed tabs.
Grenish Sep 2, 2026
bf4383e
Store blog hashtags as a required text array on the blogs table.
Grenish Sep 3, 2026
51eeb70
Require a unique username on Better Auth users and persist session co…
Grenish Sep 3, 2026
b38b799
Infer username on the Better Auth client session.
Grenish Sep 3, 2026
9f23991
Register the Aceternity UI registry for the footer cloud shader.
Grenish Sep 3, 2026
19bf7c1
Add the shadcn Item primitive for compact rows.
Grenish Sep 3, 2026
8bfd550
Add a themed WebGL cloud shader for the footer backdrop.
Grenish Sep 3, 2026
02654dc
Add a reusable blog card with cover, tags, likes, and an optional aut…
Grenish Sep 3, 2026
c529a1f
Reveal a full-width footer with a cloud shader and staggered Blogly l…
Grenish Sep 3, 2026
aad7ad2
Build the email sign-in form with Better Auth, remember-me, and toast…
Grenish Sep 3, 2026
8275606
Validate name, unique username, and password rules on the sign-up form.
Grenish Sep 3, 2026
68bd811
Replace Login with an avatar menu for profile, settings, and sign-out.
Grenish Sep 3, 2026
effc3a6
Render a public profile with cover, avatar, bio, and activity tabs.
Grenish Sep 3, 2026
2007b0d
Swap the static Login button for the session-aware user menu.
Grenish Sep 3, 2026
c1fb3e3
Move site chrome out of the root layout and wrap the app in the toast…
Grenish Sep 3, 2026
2ef5398
Give public pages a session-aware navbar and the sticky footer reveal.
Grenish Sep 3, 2026
070478d
Fill the homepage tabs with paginated cards, a Write action, and an e…
Grenish Sep 3, 2026
2562378
Keep sign-in and sign-up off the site chrome with a minimal Blogly he…
Grenish Sep 3, 2026
45afae5
Add the /signin route for returning writers.
Grenish Sep 3, 2026
cd9980d
Add the /signup route so new accounts can claim a username.
Grenish Sep 3, 2026
161b2c9
Expose each writer at /[username] and hide Follow on the owner's own …
Grenish Sep 3, 2026
3f4a9cf
Add a signed-in settings page that lists name, username, and email.
Grenish Sep 3, 2026
cdbf523
Add header image and a disabled flag on the Better Auth user table.
Grenish Sep 4, 2026
02e8834
Add blogs, comments, likes, and follows tables for the public writing…
Grenish Sep 4, 2026
c8c0e78
Wire auth and blog tables into the shared Drizzle schema.
Grenish Sep 4, 2026
b769c3c
Export the composed schema from the database client.
Grenish Sep 4, 2026
58c0d3f
Persist username, header image, and disabled state through Better Auth.
Grenish Sep 4, 2026
742b2f2
Expose header image on the client session so settings can edit it.
Grenish Sep 4, 2026
a137907
Cache the Better Auth session behind a single server helper.
Grenish Sep 4, 2026
0838556
Share pagination, subtitle limits, reserved usernames, and the defaul…
Grenish Sep 4, 2026
7b7b620
Name cache tags for posts, comments, and follows so mutations can exp…
Grenish Sep 4, 2026
31a5f3f
Format post dates and derive avatar initials in one place.
Grenish Sep 4, 2026
7fdfa42
Sanitize published HTML and recover plaintext for excerpts.
Grenish Sep 4, 2026
c4db704
Slugify titles into URL-safe post paths.
Grenish Sep 4, 2026
9040cd0
Clip editor subtitles to the word and character caps.
Grenish Sep 4, 2026
96f1eea
Allow only same-origin next paths after sign-in.
Grenish Sep 4, 2026
1743c11
Generate typed UploadThing helpers for cover, avatar, and header uplo…
Grenish Sep 4, 2026
f05e693
Parse search query, sort, and filter params into stable /search URLs.
Grenish Sep 4, 2026
30399b5
Load which posts the current viewer has liked.
Grenish Sep 4, 2026
f40b7a0
Expire post caches immediately so new writing shows without a hard re…
Grenish Sep 4, 2026
98b4459
Look up a public profile by username.
Grenish Sep 4, 2026
685487d
Query published, featured, and author-scoped posts with short-lived c…
Grenish Sep 4, 2026
1698f8c
Load comments for a published post.
Grenish Sep 4, 2026
1ba4ad1
Read which posts a viewer has liked.
Grenish Sep 4, 2026
289b33e
Check follow state and list the accounts a viewer follows.
Grenish Sep 4, 2026
a743842
Search published posts and people with sort, tag, and recency filters.
Grenish Sep 4, 2026
bc40493
Provide sample authors and posts for local seeding.
Grenish Sep 4, 2026
98887c7
Seed writers, posts, and follow graph into the database.
Grenish Sep 4, 2026
0807182
Create the first blogs and comments migration.
Grenish Sep 4, 2026
bceff5f
Snapshot the schema after blogs and comments.
Grenish Sep 4, 2026
7897f49
Add the follows table migration.
Grenish Sep 4, 2026
f32ca45
Snapshot the schema after follows.
Grenish Sep 4, 2026
de7728b
Add the disabled user column migration.
Grenish Sep 4, 2026
78f16c4
Snapshot the schema after the disabled column.
Grenish Sep 4, 2026
6e0be69
Add likes support in a follow-up migration.
Grenish Sep 4, 2026
94dfb24
Snapshot the schema after likes.
Grenish Sep 4, 2026
360c73c
Add the user header image column.
Grenish Sep 4, 2026
b5d8df2
Snapshot the schema after header images.
Grenish Sep 4, 2026
6548cd8
Add the editor, UploadThing, sanitizer, and database scripts.
Grenish Sep 4, 2026
44508d8
Lock editor, upload, and sanitizer dependency versions.
Grenish Sep 4, 2026
5441713
Allow UploadThing image hosts and keep cache components enabled.
Grenish Sep 4, 2026
3f5dd83
Style Tiptap and published post HTML with the typeset tokens.
Grenish Sep 4, 2026
b544350
Register the UploadThing SSR plugin on the root layout.
Grenish Sep 4, 2026
c040bd7
Define UploadThing routes for covers, inline images, avatars, and hea…
Grenish Sep 4, 2026
144420a
Expose the UploadThing App Router handlers.
Grenish Sep 4, 2026
01167e9
Create, update, and delete posts, then expire public caches.
Grenish Sep 4, 2026
a4b4cbd
Create and delete comments on published posts.
Grenish Sep 4, 2026
fd70920
Toggle likes and refresh the affected post caches.
Grenish Sep 4, 2026
74e8e30
Persist follows so the Following tab can load real timelines.
Grenish Sep 4, 2026
c5cf32d
Save account, header, and security settings with reserved-username ch…
Grenish Sep 4, 2026
d29e0f5
Skip sign-in for existing sessions and honor a safe next path.
Grenish Sep 4, 2026
515795d
Send signed-in visitors home instead of the sign-up form.
Grenish Sep 4, 2026
5f0ad72
Carry the post-login next path through the sign-in form.
Grenish Sep 4, 2026
0f24641
Block reserved usernames during sign-up.
Grenish Sep 4, 2026
964e8ca
Stream the account menu from the home layout so chrome stays static.
Grenish Sep 4, 2026
02a4fda
Load the session on the server and pass it into the user menu.
Grenish Sep 4, 2026
ffe52ab
Reserve space for the account menu while the session streams in.
Grenish Sep 4, 2026
d5372cb
Add a header search control and render the account slot from the layout.
Grenish Sep 4, 2026
8d0b328
Point the avatar menu at profile, admin, settings, and sign-out.
Grenish Sep 4, 2026
cf60da2
Keep page links working when the base path already has a query string.
Grenish Sep 4, 2026
a020f25
Add the alert dialog primitive for destructive confirmations.
Grenish Sep 4, 2026
8e487a7
Wire likes on cards and send tags through to search.
Grenish Sep 4, 2026
14c5910
Cap featured card height so the hero image stays aligned with the sid…
Grenish Sep 4, 2026
c01a516
Render a live profile from posts and keep the header image independen…
Grenish Sep 4, 2026
946aaf9
Extract homepage tabs and send search to /search.
Grenish Sep 4, 2026
35108d7
Render paginated post cards from query results.
Grenish Sep 4, 2026
8bb3c3d
Build pagination links that preserve existing search params.
Grenish Sep 4, 2026
ebcb4b8
Toggle likes with optimistic state.
Grenish Sep 4, 2026
c7078c1
Follow and unfollow writers from their profile.
Grenish Sep 4, 2026
6a31af4
Collect a comment on a published post.
Grenish Sep 4, 2026
87282e7
Show comments under a post.
Grenish Sep 4, 2026
400294b
Confirm and delete a comment.
Grenish Sep 4, 2026
851e0b7
Confirm and delete a post from admin.
Grenish Sep 4, 2026
fc69e26
Render sanitized post HTML with typeset styles.
Grenish Sep 4, 2026
ee79a99
Upload images with a drag-and-drop UploadThing field.
Grenish Sep 4, 2026
0e4eec6
Drop a cover image onto a new or existing post.
Grenish Sep 4, 2026
8abdaf1
Edit post bodies with Tiptap, toolbar, and inline image uploads.
Grenish Sep 4, 2026
ee792dc
Compose title, subtitle, body, cover, and publish state in one form.
Grenish Sep 4, 2026
aca199d
Submit search queries to /search while keeping current filters.
Grenish Sep 4, 2026
55b0801
Filter search results by type, sort, recency, and tag.
Grenish Sep 4, 2026
520ce58
List matching writers on the search page.
Grenish Sep 4, 2026
dfd2090
Navigate between account, security, and manage settings.
Grenish Sep 4, 2026
bf4c5d0
Edit name, username, avatar, and header image with drag-and-drop uplo…
Grenish Sep 4, 2026
de74b34
Update the signed-in user's password.
Grenish Sep 4, 2026
55578ca
Disable or manage the signed-in account.
Grenish Sep 4, 2026
c067bb9
Load featured, For You, and Following feeds from the database.
Grenish Sep 4, 2026
151a454
Show a homepage skeleton that matches the featured grid.
Grenish Sep 4, 2026
b91c9d4
Load a writer's published posts and follow state on their profile.
Grenish Sep 4, 2026
1179602
Show a profile skeleton while posts load.
Grenish Sep 4, 2026
e392d15
Explain when a profile handle does not exist.
Grenish Sep 4, 2026
3c8c019
Render a published post with comments and likes.
Grenish Sep 4, 2026
73bb8e8
Show a post skeleton while the article loads.
Grenish Sep 4, 2026
885b10f
Require a session before showing the writing admin.
Grenish Sep 4, 2026
f24f4b3
List the signed-in writer's drafts and published posts.
Grenish Sep 4, 2026
53b4add
Show an admin skeleton while posts load.
Grenish Sep 4, 2026
b158cb7
Open a blank editor for a new post.
Grenish Sep 4, 2026
67b4f9b
Edit an existing post in the same editor.
Grenish Sep 4, 2026
ee9387d
Search posts and people with sort and filter controls.
Grenish Sep 4, 2026
48d7c4c
Show a search skeleton while results load.
Grenish Sep 4, 2026
cf34c6b
Send /settings to the account tab.
Grenish Sep 4, 2026
7941382
Require a session for the settings section.
Grenish Sep 4, 2026
e0db408
Show a settings skeleton while the form loads.
Grenish Sep 4, 2026
c55c7f9
Load the account settings form.
Grenish Sep 4, 2026
6e26f29
Load the password settings form.
Grenish Sep 4, 2026
e3f631f
Load account management controls.
Grenish Sep 4, 2026
d5099f7
Add example environment configuration
Grenish Sep 4, 2026
4294faa
Document Blogly architecture and setup requirements
Grenish Sep 4, 2026
74e217f
Fix pagination links and spinner props
Grenish Sep 4, 2026
5adf292
Streamline Rendering And HTML Sanitization
Grenish Sep 4, 2026
138cc05
Add application screenshots to documentation
Grenish Sep 4, 2026
a4f62a7
Document Blogly technical guide in README
Grenish Sep 4, 2026
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
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
BETTER_AUTH_SECRET=
BETTER_AUTH_URL=
NEON_BRANCH=
DATABASE_URL=
DATABASE_URL_UNPOOLED=
UPLOADTHING_TOKEN=
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ yarn-error.log*

# env files (can opt-in for committing if needed)
.env*
!.env.example

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
.neon
130 changes: 130 additions & 0 deletions BLOGLY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Blogly

![screenshot](./public/ss1.png)

A multi-author blogging app. Anyone can read. Sign-in is required to write, comment, like, and follow.

## Stack

| Layer | Choice |
| --- | --- |
| Runtime | Node.js 20+, Next.js 16 (App Router, Cache Components) |
| UI | React 19, Tailwind CSS 4, shadcn/ui (Base UI), Remixicon |
| Auth | Better Auth (email/password) |
| Database | Neon Postgres, Drizzle ORM |
| Uploads | UploadThing |
| Editor | Tiptap 3 |
| Package manager | npm |

## Requirements

- Node.js 20+
- A Neon (or other Postgres) database
- An [UploadThing](https://uploadthing.com) token

## Environment

Copy `.env.example` to `.env` and fill in:

| Variable | Purpose |
| --- | --- |
| `DATABASE_URL` | Pooled Postgres URL (app) |
| `DATABASE_URL_UNPOOLED` | Direct Postgres URL (migrations) |
| `BETTER_AUTH_SECRET` | Auth signing secret |
| `BETTER_AUTH_URL` | Public origin, e.g. `http://localhost:3000` |
| `UPLOADTHING_TOKEN` | Image uploads |
| `NEON_BRANCH` | Optional Neon branch name |

## Setup

```bash
npm ci
npx drizzle-kit migrate
npm run db:seed
npm run dev
```

App: `http://localhost:3000`

Seed accounts use password `SeedPass1!`:

- `mira@blogly.dev` / `mira`
- `julian@blogly.dev` / `julian`
- `elena@blogly.dev` / `elena`

Re-running the seed is idempotent for those authors.

## Scripts

| Command | Action |
| --- | --- |
| `npm run dev` | Dev server |
| `npm run build` | Production build |
| `npm run start` | Serve the build |
| `npm run lint` | ESLint |
| `npm run db:generate` | Generate a Drizzle migration |
| `npm run db:migrate` | Apply migrations |
| `npm run db:seed` | Seed sample authors and posts |

## Routes

| Path | Access |
| --- | --- |
| `/` | Public feed (For You, Following) |
| `/search?q=` | Public search (posts/people, sort, tags, recency) |
| `/signin`, `/signup` | Auth |
| `/[username]` | Public author profile |
| `/[username]/[slug]` | Public post |
| `/admin` | Own posts (session) |
| `/admin/new`, `/admin/[postId]/edit` | Editor (session) |
| `/settings/account` | Profile, avatar, header image |
| `/settings/security` | Password |
| `/settings/manage` | Account management |
| `/api/auth/[...all]` | Better Auth |
| `/api/uploadthing` | Uploads |

Reserved usernames: `admin`, `signin`, `signup`, `settings`, `api`, `search`.

## Data

Postgres tables: `user`, `session`, `account`, `verification`, `blogs`, `comments`, `likes`, `follows`.

Posts: `draft` \| `published` \| `archived`. Slugs are unique per author. Public lists show published posts from non-disabled users, 8 per page.

Schema lives in `lib/db/schemas/`. Migrations live in `drizzle/`.

## Auth and uploads

Better Auth stores credentials in Postgres. Sessions are read through `lib/session.ts`. Sign-up requires name, unique email, unique username, and a password of at least 8 characters.

UploadThing routes (signed-in only):

- `coverImage`, `postImage`, `headerImage` — 8 MB
- `avatarImage` — 4 MB

URLs are stored on the user or post row.

## Caching

`cacheComponents` is on. Public post queries use `"use cache"` with tag `posts`. Mutations in `app/actions/` call `updateTag` and `revalidatePath` so new posts appear without a hard reload.

## Layout

```
app/ routes, server actions, API
components/ UI (editor, cards, settings)
lib/db/ schema, queries, seed
lib/ auth, session, cache, search
drizzle/ SQL migrations
```

## Screenshots

![screenshot](./public/ss2.png)
![screenshot](./public/ss3.png)
![screenshot](./public/ss4.png)
![screenshot](./public/ss5.png)
![screenshot](./public/ss6.png)
![screenshot](./public/ss7.png)
![screenshot](./public/ss8.png)
![screenshot](./public/ss9.png)
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

© 2026 Renderbit Technologies Pvt. Ltd.

>[!NOTE]
> Read [BLOGLY.md](./BLOGLY.md) for technical documentation.

## Prerequisites

You should be familiar with Node.js, React, Next.js, Git and GitHub.
Expand Down
22 changes: 22 additions & 0 deletions app/(auth)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Link from "next/link";
import { ModeToggle } from "@/components/mode-toggle";

export default function AuthLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<div className="relative min-h-svh bg-background">
<div className="absolute inset-x-0 top-0 z-10 flex items-center justify-between px-6 py-5">
<Link href="/" className="text-2xl font-extrabold tracking-tight">
Blogly.
</Link>
<ModeToggle />
</div>
<div>
{children}
</div>
</div>
);
}
25 changes: 25 additions & 0 deletions app/(auth)/signin/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { redirect } from "next/navigation";
import { SignInForm } from "@/components/auth/sign-in-form";
import { safeNextPath } from "@/lib/safe-next";
import { getSession } from "@/lib/session";

export const instant = false;

export const metadata = {
title: "Sign in · Blogly",
description: "Sign in to write and publish on Blogly.",
};

export default async function SignInPage({
searchParams,
}: {
searchParams: Promise<{ next?: string }>;
}) {
const session = await getSession();
const nextPath = safeNextPath((await searchParams).next);
if (session?.user) {
redirect(nextPath);
}

return <SignInForm nextPath={nextPath} />;
}
19 changes: 19 additions & 0 deletions app/(auth)/signup/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { redirect } from "next/navigation";
import { SignUpForm } from "@/components/auth/sign-up-form";
import { getSession } from "@/lib/session";

export const instant = false;

export const metadata = {
title: "Sign up · Blogly",
description: "Create a Blogly account and claim your username.",
};

export default async function SignUpPage() {
const session = await getSession();
if (session?.user) {
redirect("/");
}

return <SignUpForm />;
}
10 changes: 10 additions & 0 deletions app/(home)/[username]/[slug]/loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default function PostLoading() {
return (
<div className="mx-auto min-h-svh w-full max-w-3xl px-4 pb-16 sm:px-0 mt-5">
<div className="aspect-16/9 rounded-2xl bg-muted" />
<div className="mt-6 h-10 w-3/4 rounded bg-muted" />
<div className="mt-4 h-4 w-full rounded bg-muted" />
<div className="mt-2 h-4 w-5/6 rounded bg-muted" />
</div>
);
}
Loading