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.
- Frontend: Next.js
- Authentication: Firebase
- Deployment: Kubernetes (Minikube, EC2 instance)
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.
Before you begin, ensure you have the following tools installed on your local machine/EC2 instance:
- Docker
- Minikube cluster (Running)
- kubectl
- Git
Follow these steps to install and run the Reddit clone app on your local machine/EC2 instance:
-
Clone the repository:
git clone https://github.com/harshnayangithub/Reddit_Clone.git
Navigate to the project directory:
cd Reddit_Clone
-
Create a Dockerfile:
- Define the Dockerfile for building the Reddit clone app.
-
Build the Docker image:
docker build -t reddit_clone .
-
Push the image to Docker Hub:
docker push <DockerHub_Username>/<ImageName>
(Example:
docker push harshnayan/reddit
) -
Deploy the app to Kubernetes using EC2:
kubectl apply -f deployment.yaml
-
Deploy the Service:
kubectl apply -f service.yaml
-
Expose the app as a Kubernetes service:
kubectl expose deployment reddit-deployment --type=NodePort --port=5000
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!