๐๐ป ํ์๊ฐ์
๋ฐ ๋ก๊ทธ์ธ๊ณผ ๊ด๋ จ๋ ๊ธฐ๋ฅ์
๋๋ค.
These are features related to sign-up and login.
๐๐ป pinafore์์ ๊ฒ์๋ ๊ณ์ ์ ํ๋กํ์์ ์์๋ฐ์ดํฐ๋ฅผ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฐ์ดํฐ๋ก ๋ฐ๊ฟ๋๋ค.(ํ๋กํ + ์์ฑํ๊ธ)
Replace the temporary data with database data in the profile of the account found on Pinafore (including the profile and posts).
๐๐ป FOLLOW์ FOLLOWERS๊ฐ์ gotosocial๊ณผ mastodon์์ ์ฃผ์ง ์๋ ๊ฐ์ผ๋ก ๋ด ๋ก์ปฌ ์๋ฒ(aloy)์์ ๊ฐ์ ธ์์ต๋๋ค.
The “FOLLOW” and “FOLLOWERS” values โโare not provided by GoToSocial or Mastodon; I retrieved them from my local server (aloy).
๐๐ป user1์ผ๋ก ๋ก๊ทธ์ธํ๋ฉด user1์ FOLLOW์ FOLLOWERS๊ฐ์ด pinafore.social์์ ํ์ธ ๋ฉ๋๋ค.
When you log in as user1, the “Following” and “Followers” counts for user1 are displayed on pinafore.social.
๐๐ป ๊ทธ๋์ pinafore.social์์ ํ์ธํ๋๊ฑฐ๋ ํด๋น sns์น์ฌ์ดํธ ๊ฐ๊ณผ ๋ค๋ฅผ ์ ์์ต๋๋ค.
Therefore, the values โโshown on pinafore.social may differ from those on the actual social media website.
๐๐ป ์ ์ฒด ์ฝ๋๋ ๊นํ๋ธ์์ ํ์ธ ํ ์ ์์ต๋๋ค.
You can find the full code on GitHub.
https://github.com/gideonslife01/flm-nextjs
๐ ์ ์ฒด ํ๋ก์ ํธ ๊ตฌ์กฐ / Overall Project Structure
myapp project/
โโโ app/ (Next.js App Router)
โ โโโ .well-known/webfinger/route.ts -> webfinger
โ โโโ api/follow/route.ts -> Follow API(temporary)
โ โโโ api/announce/route.ts -> Boost(Announcement)
โ โโโ api/like/route.ts. -> Like API
โ โโโ api/posts/route.ts -> Writing API
โ โโโ api/timeline/route.ts -> Timeline API
โ โโโ api/v1/instance/route.ts -> auth
โ โโโ api/v1/apps/route.ts. -> auth
โ โโโ api/v1/accounts/verify_credentials/route.ts -> auth
โ โโโ api/v1/statuses/route.ts -> Write Post
โ โโโ api/v1/timelines/home/route.ts -> timeline
โ โโโ oauth/authorize/route.ts -> auth
โ โโโ oauth/token/route.ts -> auth
โ โโโ api/v1/search/home/route.ts -> search
โ โโโ api/v2/search/home/route.ts -> search
โ โโโ users/[username]/
โ โ โโโ statuses/[id]/route.ts -> Indivisual Post
โ โ โโโ route.ts -> Acotr Information
โ โ โโโ followers/route.ts -> Followers List
โ โ โโโ following/route.ts -> Following List
โ โ โโโ inbox/route.ts -> Inbox
โ โ โโโ outbox/route.ts -> outbox
โ โโโ usersui/[username]/
โ โ โโโ page.tsx -> Timeline UI
โ โ โโโ _components/themes/
โ โ โโโ themeex/ThemeexTheme.tsx -> Example Theme
โ โ โโโ pinafore/PinaforeTheme.tsx -> Theme 1
โ โ โโโ mastodon/MastodonTheme.tsx -> Theme 2
โ โ โโโ minimal/MinimaltTheme.tsx -> Theme 3
โ โโโ layout.tsx, page.tsx, globals.css
โ โโโ favicon.ico
โโโ lib/
โ โโโ theme.tsx -> Theme Provider
โ โโโ watchThemes.ts -> Check real-time theme changes
โ โโโ auth.ts -> Authentication, User Management
โ โโโ ap.ts -> Follow,Undo,Create,Likes,Announce
โ โโโ db.ts -> DB connection
โโโ data/
โ โโโ keys/userIDs/ -> private.pem, public.pem(New)
โ โโโ keys/ -> private.pem, public.pem(legacy)
โโโ data.sqlite -> Database(1/3)
โโโ data.sqlite-wal -> Database(2/3)
โโโ data.sqlite-shm -> Database(3/3)
โโโ Caddyfile -> https
โโโ instrumentation.ts -> Background Server
โโโ package.json
๐ ํ๋ก์ ํธ ์์ / Project Start
๐ ์ฝ๋ ์์ / Code Modification
โ๏ธ app/api/v1/accounts/[id]/route.ts
— ๊ฒ์ ํ ์์ธํ์ด์ง ํ๋กํ ์์ญ
Profile section on the detail page after search
// โ
myapp35 - app/api/v1/accounts/[id]/route.ts
// - Profile info.
import { NextResponse } from 'next/server';
import db from '@/lib/db';
const DOMAIN = process.env.DOMAIN || 'aloy-horizon.duckdns.org';
export async function GET(req: Request, { params }: { params: Promise<{ id: string }> }) { ... ...}
export async function OPTIONS() {
return new NextResponse(null, { status: 204, headers: { 'Access-Control-Allow-Origin': '*' } });
}
โ๏ธ app/api/v1/accounts/[id]/statuses/route.ts
— ๊ฒ์ ํ ์์ธํ์ด์ง ๊ธ ์์ญ
Content area of โโthe details page after search
// โ
myapp35 - app/api/v1/accounts/[id]/statuses/route.ts
// - pinafore s
import { NextResponse } from 'next/server';
import db from '@/lib/db';
const DOMAIN = process.env.DOMAIN || 'aloy-horizon.duckdns.org';
export async function GET(req: Request, { params }: { params: Promise<{ id: string }> }) { ... ... }
export async function OPTIONS() {
return new NextResponse(null, { status: 204, headers: { 'Access-Control-Allow-Origin': '*' } });
}
๐ ํ ์คํธ / Test
โ๏ธ ๋ฆฌ๋ชจํธ ์๋ฒ / Remote Server
— ๋ง์คํ ๋ / Mastodon

— ๊ณ ํฌ์์ / Gotosocial

โ๏ธ ๋ก์ปฌ์๋ฒ / Local Server

์ํ๋ณต์ 8์ฅ 32์ / John 8:32
“๊ทธ๋ฆฌ๊ณ ๋ํฌ๋ ์ง๋ฆฌ๋ฅผ ์๊ฒ ๋ ๊ฒ์ด๋ฉฐ, ์ง๋ฆฌ๊ฐ ๋ํฌ๋ฅผ ์์ ๋กญ๊ฒ ํ ๊ฒ์ด๋ค.”
“Then you will know the truth ,and the truth will set you free”