A reddit clone made with NextJs 13, Firebase, Chakra UI, Recoil
- NextJs (13.x)
- React (18.x)
- Firebase (9.x)
- Chakra UI (2.x)
- Recoil (0.7.x)
- Typescript (4.x)
- Production build script
See a live demo on Vercel
-
Navigate to
https://console.firebase.google.com/u/0/
ClickAdd Project

-
Click the
Enter your project namefield.
Typereddit-clone
ClickContinue
ClickSelect an account
Select your account
ClickCreate project
ClickContinue

-
Click the
App nicknamefield.
Typeyour-app-name
ClickRegister app
Copy and store thefirebaseConfigvalues
ClickContinue to console

-
Click
Email/Password
ClickSave
ClickAdd new provider
ClickGoogle
ClickSave

-
Click
Rulestab
Copy paste the following inedit rulesrules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /users/{userId}/{restOfPath=**} { allow read, write: if request.auth != null && userId == request.auth.uid; } match /posts/{postId} { allow read; allow write: if request.resource.data.creatorId == request.auth.uid; allow delete: if request.auth.uid == resource.data.creatorId; allow update; } match /comments/{commentId} { allow read; allow write: if request.resource.data.creatorId == request.auth.uid; allow delete: if request.auth.uid == resource.data.creatorId; allow update; } match /communities/{communityId} { allow read; allow write: if request.auth != null; } } }
- Clone/download repo
- Create a file called .env in the root directory of your project, type the following in cmd/powershell
cp env.example .env - Inside the
.envfile, add the firebase keys from thefirebaseConfigcopied duringstep 4of firebase setup yarn install(ornpm installfor npm) to install the dependencies
Development
yarn dev
- Build app continuously (HMR enabled)
Production
yarn build
yarn start
- Build app once (HMR disabled) to
/.next/
All commands
| Command | Description |
|---|---|
yarn dev |
Build app continuously (HMR enabled) |
yarn build |
Build app once (HMR disabled) to /.next/ |
yarn start |
Run production build |
- Design ideas were taken from Reddit
- Some Implementation Ideas for this project are taken from Shadee Merhi
- Project was bootstrapped with create-next-app





