A learning-based social app for students built with Next.js, TypeScript, and Tailwind CSS.
This implementation provides a complete read-only frontend for browsing posts, topics, and comments.
- Home Feed - Browse all posts with pagination
- Topic Feed - View posts filtered by topic
- Post Detail - Read full post content and comments
- Server-side rendering for optimal performance
- Responsive design with Tailwind CSS
- TypeScript for type safety
- Next.js 16 (App Router)
- TypeScript
- Tailwind CSS
- Server Components (with client components where needed)
- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env.local
# Edit .env.local and set NEXT_PUBLIC_API_URL to your backend API URL- Run the development server:
npm run dev- Open http://localhost:3000 in your browser
The frontend expects the following API endpoints:
GET /api/feed/home?page={page}&page_size={size}- Home feedGET /api/feed/topic/{topicId}?page={page}&page_size={size}- Topic feedGET /api/posts/{postId}- Post detail with comments
src/app/
├── page.tsx # Home feed
├── topics/[topicId]/page.tsx # Topic feed
├── posts/[postId]/page.tsx # Post detail
├── components/
│ ├── PostCard.tsx # Post card component
│ └── Pagination.tsx # Pagination controls
├── lib/
│ └── api.ts # API utilities and types
├── layout.tsx # Root layout
└── globals.css # Global styles
npm run buildFor production deployment to Vercel, see DEPLOYMENT.md for:
- Configuration verification
- Troubleshooting Ghost 404 errors
- Environment setup
- Deployment checklist
src/app/page.tsx- Home feed pagesrc/app/topics/[topicId]/page.tsx- Topic feed pagesrc/app/posts/[postId]/page.tsx- Post detail pagesrc/app/components/PostCard.tsx- Reusable post card componentsrc/app/components/Pagination.tsx- Pagination componentsrc/app/lib/api.ts- API utility functions and TypeScript interfaces
- API Response Format: The API returns responses in the expected JSON format with
posts,total,page,page_size, andtotal_pagesfields - Post Excerpts: If the API doesn't provide excerpts, they are automatically generated from the first 40 words of the content
- Authentication: Phase 1 does not include authentication (as specified in requirements)
- Mutations: No create, update, or delete operations are included (read-only experience)
- Error Handling: Basic error states are shown when API calls fail
- API Base URL: Defaults to
http://localhost:8000ifNEXT_PUBLIC_API_URLis not set
This is a Next.js project bootstrapped with create-next-app.