A modern Reddit clone built with Next.js 15, React 19, and Tailwind CSS, replicating the core features and design principles of Reddit while leveraging cutting-edge web technologies. This project offers a seamless and responsive experience with an emphasis on user interactions, accessibility, and scalability.
- Dark/Light Mode: Built-in theme toggle for a better user experience.
- Reddit-Style Feed Layout: Familiar UI showcasing posts in categories like Hot, New, Controversial, Rising, and Top.
- Post Categorization: Filter posts by predefined categories and sort them with ease.
- Time-Based Filtering: View content by day, week, month, year, or all-time popularity.
- Responsive Design: Fully optimized for desktops, tablets, and mobile devices.
- Image Optimization: Automatically resizes and optimizes images for fast loading.
- Interactive Voting System: Upvote/downvote system to engage users.
- Authentication with Reddit API: OAuth-based login to fetch personalized data.
- Highly Modular Components: Built with reusable and scalable components using Radix UI.
- Next.js: Version 15.1.4
- React: Version 19.0.0
- Tailwind CSS: Version 3.4
- Radix UI: Highly accessible React components.
- Lucide React Icons: Lightweight and customizable icons.
- Node.js (Latest LTS version recommended)
- npm or yarn for dependency management
-
Clone the repository:
git clone https://github.com/theuzair/reddit-clone.git cd reddit-clone -
Install dependencies:
npm install # or yarn install -
Create a
.env.localfile in the root directory:REDDIT_CLIENT_ID=your_client_id REDDIT_CLIENT_SECRET=your_client_secret REDDIT_USERNAME=your_username_here REDDIT_PASSWORD=your_password_here
-
Run the development server:
npm run dev # or yarn dev -
Open http://localhost:3000 in your browser to view the application.
To create an optimized production build:
npm run build
# or
yarn buildTo run the production build:
npm run start
# or
yarn startreddit-clone/
├── app/
│ ├── api/
│ │ ├── reddit-auth/ # Authentication-related API
│ │ └── reddit-data/ # Data fetching endpoints
│ └── page.js # Main application entry point
├── components/
│ └── ui/ # Reusable UI components
├── public/ # Public assets like images
├── styles/ # Global CSS and Tailwind styles
├── .env.local # Environment variables
└── README.md # Project documentation
- Fork the repository.
- Create your feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m "Add some amazing feature" - Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Reddit API: For enabling the integration of Reddit's core functionality.
- Next.js Team: For providing a powerful framework for server-rendered and statically generated apps.
- Tailwind CSS Team: For delivering a utility-first CSS framework.
- Radix UI Team: For offering a suite of accessible UI primitives.
- User Profiles: Add the ability to create and manage user profiles.
- Post Drafts: Allow users to save drafts for posts.
- Real-Time Comments: Integrate WebSocket for real-time updates on comments and votes.
- Notifications System: Implement push notifications for mentions and updates.
- Admin Panel: Add an admin interface for content moderation.