Threadly -> A Better Whatsapp-Web - Model Link
- Overview
- Features
- Technologies Used
- Installation
- Running the Project
- API Endpoints
- Future Improvements
This project is a compelete Turborepo-Full-Stack system for adressing a major issue in Whatsapp-Web, which is No call + No Notes/File Sharing and No Discussion on a whiteboard as in Google-Meet. This App solves all.
This Turborepo includes the following packages/apps:
web: FrontEnd React.js apphttp-server: Backend and Sockets Hosted on expressJs and Socket.io@repo/ui: a stub React component library shared by bothwebanddocsapplications@repo/eslint-config:eslintconfigurations (includeseslint-config-nextandeslint-config-prettier)@repo/typescript-config:tsconfig.jsons used throughout the monorepo
Each package/app is 100% TypeScript.
This Turborepo has some additional tools:
- TypeScript for static type checking
- ESLint for code linting
- Prettier for code formatting
- Backend Framework: Node.js with Express
- Database: MongoDB with Mongoose
- Authentication: JSON Web Token (JWT)
- Socket-io For Live Connections
- Web-Rtc For Video calling, file sharing and Live WhiteBoard Sharing
- File Storage: (e.g., cloudinary, local storage, etc.)
- Containerization: Docker
- Other Minor ones like: Axios, React-hook-form, tailwind, Fabric.js etc
- Registration, login, logout, change password.
- Profile management -> Update Account Details, Pfp, Bio etc.
- Track Friend List, Get All Friends etc
- Seed Random Users with Dummy information
- Get Seeded Informaiton of the Pre-seeded users.
- Seed user with @faker-js.
- Send Message, Delete Message, Get Message. Basic CRUD for messages.
- Create One on One Chat, Group Chat, Get all Chats.
- Manipulate Group, RBAC, Add Participants, Kick Participants, Delete Group etc.
- Seach For available users in DB.
- Endpoint to verify the server's health
- Clone the repository then do:
docker compose up -d
-
Clone the repository:
git clone https://github.com/Barmanji/Threadly.git
-
Install dependencies: (I prefer Pnpm so:)
cd Threadly.git pnpm build pnpm install -
Set up environment variables:
Change .env.example to .env and fill the required fields
-
Start the server:
pnpm run dev
Once you have completed the setup, you can run the project using:
pnpm devThis will start the server, and the application will be available on http://localhost:3004.
The Client will start on default react port: http://localhost:5173
| Method | Endpoint | Description | Protected |
|---|---|---|---|
| POST | /api/v1/user/register |
Register a new user | No |
| POST | /api/v1/user/refresh-token |
Refresh Token | No |
| POST | /api/v1/user/login |
Login a User | No |
| GET | /api/v1/user/get-any-user-friend-list/c/:username |
Get Any User Friend List | No |
| GET | /api/v1/user/c/:username |
Get User Profile | No |
| POST | /api/v1/user/logout |
Logout user | Yes |
| GET | /api/v1/user/current-user |
Get Current User Details | Yes |
| PUT | /api/v1/user/change-password |
Change password from old to new | Yes |
| PUT | /api/v1/user/update-account |
Update Account Details (Username & Email) | Yes |
| PUT | /api/v1/user/update-profile-picture |
Change Pfp of the Logined user | Yes |
| PUT | /api/v1/user/update-bio |
Change Bio | Yes |
| GET | /api/v1/user/get-my-friend-list |
Get My Friend list | Yes |
| GET | /api/v1/user/get-all-users |
Get All Users | Yes |
| Method | Endpoint | Description | Protected |
|---|---|---|---|
| GET | /api/v1/chats |
Get All Chats | Yes |
| GET | /api/v1/chats/users |
Search Available Users | Yes |
| POST | /api/v1/chats/c/:receiverId |
Create or Get a One on One Chat | Yes |
| POST | /api/v1/chats/group |
Create a Group Chat | Yes |
| GET | /api/v1/chats/group/:chatId |
Get Group Chat Details | Yes |
| PATCH | /api/v1/chats/group/:chatId |
Rename Group Chat | Yes |
| DELETE | /api/v1/chats/group/:chatId |
Delete Group Chat | Yes |
| POST | /api/v1/chats/group/:chatId/:participantId |
Add New Participant in group chat | Yes |
| DELETE | /api/v1/chats/group/:chatId/:participantId |
Remove Participant from group chat | Yes |
| PATCH | /api/v1/chats/remove/:chatId |
Delete One on One chat | Yes |
| Method | Endpoint | Description | Protected |
|---|---|---|---|
| GET | /api/v1/messages/:chatId |
Get All Messages | Yes |
| POST | /api/v1/messages/:chatId |
Send message | Yes |
| DELETE | /api/v1/messages/:chatId/:messageId |
Delete Message | Yes |
| Method | Endpoint | Description | Protected |
|---|---|---|---|
| GET | /api/v1/healthcheck |
Get Health Status | Yes |
- Add a pub-sub model to handle More traffic