Moj Reddit is a reddit website clone made with React, Typescript and Firebase.
Live preview: https://mojreddit.com
- Home feed and custom user feed
- Subreddits
- Sign in with email/password, Google or GitHub
- 3 types of posts:
- Text
- Image/video
- Poll
- Upvote/downvote posts
- Post comments
- Inbox & chatting with other redditors
- Searching for posts
- Account and profile settings
Front-end: | Back-end: |
---|---|
React | NodeJS |
Express | |
Typescript | Typescript |
Firebase
|
Firebase
|
Axios | Algolia Search |
React Router Dom | Node Cron |
Material UI | DotEnv |
FontAwesome icons | |
React Hot Toast | |
React Loading Skeleton | |
React Quill |
- Install NodeJS.
- Clone both frontend and backend repositories.
- Install dependencies in both folders.
- Run
npm install
- Run
- Set up environment variables.
- Back-end:
File name Description fake-reddit-backend/.env Environment variables such as the client URL,
port number, hostname, algolia api key, etc.
See an example here.fake-reddit-backend/serviceAccountKey.json Firebase Admin SDK configuration file.
Read more here. See an example here - Front-end:
File name Description fake-reddit/src/utils/firebase/firebaseConfig.ts Firebase configuration file containing the api key,
auth domain, etc. Read more here. See an example here.fake-reddit/src/utils/misc/constants.ts Various application constants.
"SERVER_URL" is set tohttp://localhost:5000
by default. See an example here.
- Back-end:
- Start the server.
- Navigate to the back-end folder and run
npm start
. - The console should say
Server started at http://localhost:5000
.
- Navigate to the back-end folder and run
- Start the client.
- Navigate to the front-end folder and run
npm start
. - The console should say
Compiled successfully! You can now view fake-reddit in the browser.
- Navigate to the front-end folder and run
- Have more consistent CSS styles.
- Use Material UI components for everything.
- Make it easy to add more themes later on (dark/light/system).
- Make it responsive for mobile devices from the beginning.
- Pay attention to accessibility.
- Use a CDN instead of storing raw files in the Firebase Storage bucket.
- Add missing links above.
- Make it responsive and mobile friendly.
- Change post requirements to be same as the real reddit website.
- Fetch only last x comments, instead of fetching all of them.
- Fetch only last x messages, instead of fetching all of them.