๐Ÿงต Threadit

A minimal Reddit clone built with Next.js

showcase

Features ๐Ÿ“

  • โšก Next.js with Server Actions
  • ๐Ÿ”ฅ Type checking TypeScript
  • ๐Ÿ’Ž Integrate with Tailwind CSS and Shadcn UI
  • ๐Ÿ“‚ File upload with AWS S3
  • ๐Ÿ”’ Authentication with NextAuth
  • ๐Ÿ‘ค Social Auth (Google)
  • โ™ป๏ธ Type-safe environment variables with T3 Env
  • โŒจ๏ธ Form with React Hook From
  • ๐Ÿ”ด Validation library with Zod
  • โš“ Containerization with Docker
  • ๐Ÿ‘ท Run deployment on pull request with GitHub Actions

Live Demo ๐Ÿ”ด

You can view a live demo by clicking HERE

Installation

To run the application on your local machine, follow these steps.

  1. Clone the repository to your local machine.

git clone https://github.com/Armadillidiid/reddit-clone.git
  1. Go to folder, and copy env-local-dev as .env.local

For NEXTAUTH_SECRET, use the openssl command to generate a random secret.

cd reddit-clone/
cp env-local-dev .env.local
  1. Setup authentication

Create a new OAuth 2.0 client ID in the Google Cloud Console. Add the client ID and client secret to the .env.local file.

NEXTAUTH_URL=http://localhost:3000
GOOGLE_ID=YOUR_GOOGLE_ID
GOOGLE_SECRET=YOUR_GOOGLE_SECRET
  1. Setup image upload

Create a new bucket in AWS S3. Add the bucket name, access key, and secret key to the .env.local file.

AWS_REGION=YOUR_AWS_REGION
AWS_BUCKET_NAME=YOUR_AWS_BUCKET_NAME
AWS_ACCESS_KEY_ID=YOUR_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY
  1. Run the project.

docker compose up
  1. Open your browser and go to http://localhost:3000