ππ» νμκ°μ
λ° λ‘κ·ΈμΈκ³Ό κ΄λ ¨λ κΈ°λ₯μ
λλ€.
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”