Nik-Blog , Typescript

Nik-Blog — Learning Notes

Nik-Blog — Learning Notes

One note per real piece of work on this project: what we built, why it's built that way, and the syntax/logic explained — same format as langchain-practice/notes/ and k8s-practice. These are written from the actual build sessions, not from theory, so every note ends with something defensible in an interview.

Index

#NoteCovers
00Repo skeleton and PostgresMonorepo layout, Express/Next.js scaffolding, Docker Compose Postgres, connection pooling
01Admin authLayered backend architecture, bcrypt hashing, JWT issuing/verification, auth middleware
02Projects CRUDPublic/protected routes in one file, slug generation, Postgres array columns, RETURNING *
03GitHub syncIdempotent upsert logic, matching by URL vs. slug, never resetting status/source on re-sync
04Notes moduleReal tech-domain categories, Markdown-as-data, reusing toSlug, app-layer + DB-layer validation
05Frontend public pagesServer Components, Next.js 16 Cache Components opt-out, async params, rendering Markdown safely
06Admin auth cookiesHTTP-only cookie vs. localStorage, CORS credentials, Client Components, checking auth via a real API call
07Note create/edit formsShared form component via a mode prop, resending unchanged fields on update, fixing a useParams()/Cache Components conflict
08Image uploads to S3Least-privilege IAM, scoped bucket policy, multer memory storage, random filenames, multipart form uploads
09Noir design systemTailwind v4 CSS tokens, editorial layout, ref-based cursor glow (no re-renders), inline SVG grain texture
10Glitch + cursor-proximity tintDiagnosing a stale Turbopack CSS cache vs. a silently-dropped Lightning CSS rule, distance-based color blending in JS
11Dossier grid + Live PulseReplacing decorative numbers with real GitHub data, a reusable proximity-tint hook, point-to-rectangle distance fix
12Admin panel design + logoutApplying noir tokens to a utility screen without its ambient effects; missing logout, delete, and nodemon script found and fixed; a Projects/Notes tab switcher; uploading a local .md file straight into the Note form
13Project detail page designThe last unstyled public page, reusing LivePulse, a Related Notes section, and a missing Project field in the Note form that made it reachable
14Free-text category tagsDropping a database CHECK constraint, a <datalist> for autocomplete without enforcement, why the existing color fallback needed zero changes
15Notes grouped by category + breadcrumbsGrouping with a Map to preserve insertion order, completing the back-link chain from detail page to list page to home
16Tag colors simplified + footerOne fixed tag accent instead of five, dropping the proximity-to-white glass effect, a new Date() prerendering bug in the new footer
17Mermaid + syntax highlightingA server-side rehype plugin for code highlighting vs. a Client Component for mermaid (only mermaid needs the DOM), intercepting at <pre> not <code>
18Video uploads for project coversMP4/WebM over GIF and why, no schema change needed, a real <video> vs <img> verification with a generated test clip
19Backend deployed — Neon + RenderFixing hardcoded localhost CORS/cookie settings before going live, a flaky search_path bug caused by a connection pooler, why a direct connection beat the pooled one