Reddit Clone App

This project aims to create a Reddit clone using Next.js for the frontend and Firebase for authentication. The app is deployed on Kubernetes using Minikube as the cluster, with the help of an EC2 instance.

Structure

Technologies Used

  • Frontend: Next.js
  • Authentication: Firebase
  • Deployment: Kubernetes (Minikube, EC2 instance)

Overview

The Reddit clone app replicates the basic functionality of Reddit, allowing users to create posts, comment on posts, and upvote/downvote posts and comments. Firebase Authentication is used to manage user authentication, and Kubernetes is used for deployment, ensuring scalability and reliability with the help of an EC2 instance.

Prerequisites

Before you begin, ensure you have the following tools installed on your local machine/EC2 instance:

  • Docker
  • Minikube cluster (Running)
  • kubectl
  • Git

Installation

Follow these steps to install and run the Reddit clone app on your local machine/EC2 instance:

  1. Clone the repository:

    git clone https://github.com/harshnayangithub/Reddit_Clone.git

    Navigate to the project directory:

    cd Reddit_Clone
  2. Create a Dockerfile:

    • Define the Dockerfile for building the Reddit clone app.
  3. Build the Docker image:

    docker build -t reddit_clone .
  4. Push the image to Docker Hub:

    docker push <DockerHub_Username>/<ImageName>

    (Example: docker push harshnayan/reddit)

  5. Deploy the app to Kubernetes using EC2:

    kubectl apply -f deployment.yaml
  6. Deploy the Service:

    kubectl apply -f service.yaml
  7. Expose the app as a Kubernetes service:

    kubectl expose deployment reddit-deployment --type=NodePort --port=5000

Screenshots

Docker Image Creation

Docker

Pushing to Docker Hub

DockerHub

EC2 Instance Deployment

EC-2 Instance

Deployed Application

Deployed App

Live Deployment URL

My deployment URL on EC2 looked something like this: http://3.108.194.17:3000/ (Note: You will get a 404 error as I have terminated the EC2 instance)

Feel free to open any issue regarding the installation steps mentioned. Contribute to this project by opening a Pull Request. Your contributions are welcome!