A full-stack Twitter clone built with Next.js, NestJS, and Firebase, offering a modern social experience with cool features, sleek design, and great architecture.
This project mimics the core features of Twitter — including posting, liking, and commenting — with support for authentication, server-side rendering, and cloud functions. It's split into two parts:
- Client: Built with Next.js, React, and ShadCN
- Server: Built with NestJS, deployed with Firebase Functions
.
├── client/ # Next.js frontend
└── server/ # NestJS backend (Firebase Functions)
- Authentication with Firebase
- Posts, Likes, and Comments
- Responsive UI with Tailwind + ShadCN UI
- Server-side APIs with NestJS
- Cloud-hosted backend using Firebase + Firestore + Storage
- Dark mode toggle with
next-themes
- Next.js 15
- React 19
- TailwindCSS
- ShadCN UI
- Zustand (state management)
- React Hook Form + Zod (forms and validation)
- Framer Motion (animations)
- React Query (
@tanstack/react-query
)
- NestJS 11
- Express 5
- Firebase Admin SDK for Firestore + Storage
- Firebase Functions (cloud deployment)
git clone https://github.com/andrew-dev-p/nextjs-firebase-twitter-clone.git
cd nextjs-firebase-twitter-clone
cd client
npm install
cd ../server
npm install
cd client
npm run dev
cd server
npm run start:dev
NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_storage_bucket
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=your_measurement_id
NEXT_PUBLIC_API_URL=https://your-api-url
CLIENT_URL=https://your-client-url
- Client: Deployed on Vercel
- Server: Deployed via Firebase Functions (Google Cloud)