A modern Next.js-based frontend for the Social Network application featuring real-time content discovery, user interactions, and admin controls.
- π Hybrid search (Internal MongoDB + External Hacker News via Algolia)
- π€ User authentication with role-based access control
- π Story and comment creation with rich text support
- β€οΈ Like/upvote system
- π Bookmark functionality
- π₯ Follow/unfollow users
- π¨ Content reporting system
- π¨βπΌ Admin dashboard with moderation tools
- π± Fully responsive design (mobile, tablet, desktop)
- Framework: Next.js 14 (React)
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- State Management: Redux Toolkit
- Icons: React Icons
- Authentication: JWT (stored in cookies)
# Clone repository
git clone <repository-url>
cd social-network-frontend
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env.local
# Edit .env.local with your configuration
# Run development server
npm run dev
# Build for production
npm run build
npm run startCreate a .env.local file:
NEXT_PUBLIC_API_URL=http://localhost:3000
NEXT_PUBLIC_API_BASE_URL=http://localhost:3000Can Access:
- β View all public stories
- β View all comments
- β Search and filter content
- β View user profiles
- β Browse by tags (story, job, ask_hn, show_hn)
Cannot Access:
- β Create stories or comments
- β Like/upvote content
- β Follow users
- β Bookmark content
- β Report content
- β Edit or delete anything
Available Actions:
- Login
- Register
All Guest Permissions +
Can:
- β Create stories (types: story, ask_hn, show_hn, poll)
- β Create comments and replies (depth limit: 1)
- β Edit own stories and comments
- β Delete own stories and comments
- β Like/unlike stories and comments
- β Follow/unfollow other users
- β Bookmark stories and comments
- β Report inappropriate content
- β Update own profile (bio, photo, location, website)
- β View own bookmarks and activity
Cannot:
- β Create job postings
- β Delete other users' content (unless admin)
- β Access admin dashboard
- β Block users or emails
All Authenticated User Permissions +
Can:
- β Create job postings (type: job)
- β All USER role permissions
Special Features:
- Job posts are labeled with "job" tag
- Can manage own job listings
Full System Access
Can:
- β All USER and EMPLOYER permissions
- β Delete any story or comment
- β Block/unblock users
- β Block/unblock email addresses
- β View and manage all reports
- β Restore deleted content
- β View analytics dashboard
- β View problematic users list
- β View top contributors
- β Access admin panel
Admin Dashboard Features:
- User management (block/unblock)
- Content moderation (delete/restore)
- Email blocking system
- Report management
- Analytics and statistics
- Trending content monitoring
- Front page stories (hybrid: internal + Hacker News)
- Tag-based filtering (story, job, ask_hn, show_hn)
- Search functionality
- Sort by popularity or date
- Responsive card layout
- Full story with metadata (author, points, time)
- Share, edit, delete buttons (based on permissions)
- Bookmark functionality
- Report button
- Comments section with nested replies (depth: 1)
- Like/comment interactions
- Responsive layout for all screen sizes
- Create top-level comments
- Reply to comments (one level only)
- Edit/delete own comments
- Like comments
- Icons for metadata (user, points, time)
- Responsive threading
- View user's stories and comments
- Follow/unfollow
- Edit own profile (bio, photo, location, website)
- View followers and following count
- Bookmarks list (own profile only)
- Real-time search
- Filter by tags
- Sort options (relevance, date)
- Combines internal and external (HN) results
- Responsive results display
- User management table
- Content moderation tools
- Report queue with filtering
- Email blocking interface
- Analytics overview
- Problematic users monitoring
- FaUser - Author/username
- FaStar (yellow) - Points/likes
- FaRegClock - Timestamps
- FaCommentAlt - Comments count
- FaExternalLinkAlt - External links
- BiLike/BiSolidLike - Like buttons
- Bookmark icon - Save functionality
- Mobile: < 640px (sm)
- Tablet: 640px - 1024px (md/lg)
- Desktop: > 1024px (xl)
src/
βββ app/
β βββ (auth)/ # Authentication pages
β βββ admin/ # Admin dashboard
β βββ components/ # Shared components
β βββ context/ # React context (Auth)
β βββ details/[storyId]/ # Story detail pages
β βββ home/ # Home page
β βββ profile/ # User profiles
β βββ search/ # Search pages
β βββ services/ # API services
β βββ store/ # Redux store
β βββ types/ # TypeScript types
βββ components/ui/ # shadcn/ui components
βββ public/ # Static assets
| Route | Description | Auth Required |
|---|---|---|
/ |
Landing page | β |
/home |
Main feed | β |
/details/[storyId] |
Story details | β |
/logIn |
Login page | β |
/register |
Registration | β |
/profile/[username] |
User profile | β |
/search |
Search results | β |
/admin |
Admin dashboard | β (Admin only) |
- Depth Limit: 1 (only one level of replies)
- Top-level comments can have replies
- Replies cannot have further replies
- Reply button hidden at depth 1
- story: Regular posts
- job: Job postings (EMPLOYER/ADMIN only)
- ask_hn: Ask HN style posts
- show_hn: Show HN style posts
- poll: Polls
- Internal Stories: UUID format (e.g.,
abc-123-def) - External Stories: Numeric IDs (e.g.,
12345) - External stories fetch metadata from Algolia
- Comments for external stories are MongoDB-only
- Mobile-first approach
- Stacked layouts on mobile
- Horizontal layouts on desktop
- Touch-friendly buttons on mobile
- Optimized image loading
# Run development server
npm run dev
# Build for production
npm run build
# Start production server
npm run start
# Lint code
npm run lint
# Format code
npm run format# Deploy to Vercel
vercel deploy
# Deploy to production
vercel --proddocker build -t social-network-frontend .
docker run -p 3001:3001 social-network-frontendCustom configuration in tailwind.config.ts
- Custom colors (cyan theme)
- Responsive breakpoints
- Custom animations
State management for:
- User authentication
- Profile data
- Bookmarks
- UI state
- Primary: Cyan
- Accent: Blue
- Text: Gray
- Background: White/Light Gray
- Font: System font stack
- Headings: Bold, larger sizes
- Body: Regular, readable sizes
MIT
- Preethi Rajesh Yennemadi - Section 4 - Grad Student MSCS
- Kalyana Ramanuja Swami Mudumby - Section 4 - Grad Student MSCS
- Mrinal Srinath Setty - Section 4 - Grad Student MSCS