Skip to content

Implement simple blog with Next.js#247

Open
jazferlex wants to merge 8 commits intoZeff01:mainfrom
jazferlex:jazfer-licaros/fullstack-1-2
Open

Implement simple blog with Next.js#247
jazferlex wants to merge 8 commits intoZeff01:mainfrom
jazferlex:jazfer-licaros/fullstack-1-2

Conversation

@jazferlex
Copy link

Summary

  • Implemented a small blog app inside the fullstack directory using Next.js (App Router + TypeScript).
  • Includes pages, API routes, sample data, and basic styling.

What I added

  • fullstack/data/posts.ts — sample posts array
  • fullstack/app/page.tsx — home page (list of posts)
  • fullstack/app/posts/[id]/page.tsx — dynamic post page (awaits params)
  • fullstack/app/api/posts/route.ts — GET all posts
  • fullstack/app/api/posts/[id]/route.ts — GET post by id
  • fullstack/components/ThemeToggle.tsx — client theme toggle component
  • fullstack/app/globals.css — basic styles
  • fullstack/layout.tsx — app layout wiring

Testing notes

  • API endpoints return JSON for all posts and by id.
  • Dynamic route bug (params is a Promise) was fixed by awaiting params in app/posts/[id]/page.tsx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments