A full-featured publishing platform inspired by Medium, built with Next.js 16, React 19, TypeScript, and Prisma. This project demonstrates modern frontend engineering practices including component design, data fetching, state management, authentication, SEO optimization, and deployment.
- User Authentication - Sign up, login, and protected routes using NextAuth.js
- Rich Text Editor - Jodit Editor with formatting, images, and embeds
- Posts CRUD - Create, read, update, and delete posts with drafts and publishing workflow
- Media Handling - Cloudinary integration for image uploads and optimization
- Tags & Search - Tag-based filtering and full-text search
- Social Features - Comments (nested), likes/claps, bookmarks, and follow authors
- User Profiles - Author profiles with bio, posts, and follower counts
- Personalized Feed - Feed filtered by followed authors
- SEO Optimized - Open Graph tags, Twitter cards, and metadata
- Performance - SSG/ISR for posts, React Query for data fetching
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Database: PostgreSQL with Prisma ORM
- Authentication: NextAuth.js
- State Management: React Query (@tanstack/react-query)
- Rich Text Editor: Jodit React
- Image Upload: Cloudinary
- UI Components: Radix UI + shadcn/ui
- Node.js 18+ and npm
- PostgreSQL database
- Cloudinary account (for image uploads)
- Git
git clone https://github.com/pshemssa/Capstone_Phase_Two
cd Capstone_Phase_Twonpm installCreate a .env file in the root directory:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/lumen_yard?schema=public"
# NextAuth
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secret-key-here"
# Cloudinary
CLOUDINARY_CLOUD_NAME="your-cloud-name"
CLOUDINARY_API_KEY="your-api-key"
CLOUDINARY_API_SECRET="your-api-secret"
# App URL (for production)
NEXT_PUBLIC_APP_URL="http://localhost:3000"
# Optional: Google Site Verification
GOOGLE_SITE_VERIFICATION="your-verification-code"# Generate Prisma Client
npx prisma generate
# Run migrations
npx prisma migrate dev
# (Optional) Seed database
npx prisma db seednpm run devOpen http://localhost:3000 in your browser.
phase2/
├── app/
│ ├── (auth)/ # Authentication routes
│ │ ├── login/
│ │ └── signup/
│ ├── (main)/ # Main application routes
│ │ ├── feed/ # Personalized feed
│ │ ├── post/ # Post detail pages
│ │ ├── tag/ # Tag pages
│ │ ├── users/ # User profiles
│ │ ├── write/ # Post editor
│ │ └── settings/ # User settings
│ ├── api/ # API routes
│ │ ├── auth/ # Authentication endpoints
│ │ ├── post/ # Post CRUD endpoints
│ │ ├── comments/ # Comment endpoints
│ │ ├── users/ # User endpoints
│ │ ├── search/ # Search endpoint
│ │ └── upload/ # Image upload endpoint
│ ├── components/ # React components
│ │ ├── auth/ # Auth forms
│ │ ├── layout/ # Layout components
│ │ ├── post/ # Post components
│ │ └── users/ # User components
│ ├── lib/ # Utilities and configs
│ │ ├── auth.ts # NextAuth configuration
│ │ ├── prisma.ts # Prisma client
│ │ └── api-utils.tsx # API utilities
│ └── types/ # TypeScript types
├── components/ # Shared UI components (shadcn/ui)
├── prisma/ # Prisma schema and migrations
├── __tests__/ # Test files
└── public/ # Static assets
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverage
# Type checking
npm run type-check# Build the application
npm run build
# Start production server
npm startgit add .
git commit -m "Ready for deployment"
git push origin main- Go to vercel.com
- Import your GitHub repository
- Configure environment variables in Vercel dashboard
- Deploy!
Add all environment variables from your .env file in the Vercel project settings:
DATABASE_URLNEXTAUTH_URL(your Vercel domain)NEXTAUTH_SECRETCLOUDINARY_CLOUD_NAMECLOUDINARY_API_KEYCLOUDINARY_API_SECRETNEXT_PUBLIC_APP_URL(your Vercel domain)
For production, use a managed PostgreSQL database:
Update DATABASE_URL in Vercel with your production database URL.
- Next.js App Router with clean folder structure
- Global layouts, header, footer, and navigation
- NextAuth.js with credentials provider
- Signup/login pages with form validation
- Protected routes with middleware
- User profile pages with posts and bio
- Jodit React rich text editor
- Image upload to Cloudinary
- Preview and publish flows
- Draft saving
- Full CRUD operations for posts
- Image optimization with Cloudinary
- Draft and published states
- Edit post functionality
- Home feed with latest posts
- Tag filtering pages
- Debounced search with full-text search
- Nested comment system
- Like/clap functionality with optimistic updates
- Follow/unfollow authors
- Bookmarks
- Personalized feed based on follows
- React Query for data fetching and caching
- Context API for session management
- Optimistic UI updates
- Full TypeScript coverage
- ESLint configuration
- Unit and integration tests
- Type-safe API responses
- Dynamic metadata and Open Graph tags
- SSG with
generateStaticParamsfor posts - ISR with 60-second revalidation
- Image optimization
- Vercel deployment ready
- Environment variable configuration
- Production build optimization
npm run dev- Start development servernpm run build- Build for productionnpm start- Start production servernpm run lint- Run ESLintnpm test- Run testsnpm run test:watch- Run tests in watch modenpm run test:coverage- Generate test coveragenpm run type-check- Type check without emitting
- Ensure PostgreSQL is running
- Check
DATABASE_URLformat - Run
npx prisma generateafter schema changes
- Verify
NEXTAUTH_SECRETis set - Check
NEXTAUTH_URLmatches your domain - Clear browser cookies if session issues persist
- Verify Cloudinary credentials
- Check file size limits (5MB max)
- Ensure CORS is configured in Cloudinary
This project is part of a capstone project for educational purposes.
This is a capstone project. For questions or issues, please contact the project maintainer.
- Next.js team for the amazing framework
- Vercel for hosting and deployment
- Prisma for the excellent ORM
- All open-source contributors whose packages made this possible










