TShare is a full-stack sharing app where users can quickly share text, images, and PDFs using short 4-digit codes, plus join a public realtime chat room.
This README describes the full project and how to run both apps together.
tshare-Frontend/ # React + Vite client
tshare-Backend/ # Express + MongoDB + Socket.IO API
- Share text and retrieve it by 4-digit code
- Upload image, then fetch or download by code
- Upload PDF, preview inline, or download by code
- Admin login and panel for managing content and codes
- Public room realtime chat with Socket.IO
- Room validation and active/inactive room controls
- React 19
- React Router
- Socket.IO Client
- Vite
- Node.js + Express
- MongoDB + Mongoose
- Socket.IO
- Cloudinary + Multer
- Node.js 18+
- MongoDB database
- Cloudinary credentials
cd ../tshare-Backend
npm installMONGODB_URI=your_mongodb_connection_string
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
CORS_ORIGIN=http://localhost:5173
PORT=5000# normal node server
npm start
# or nodemon
npm run server
# or vercel local dev
npm run devBackend default URL for local dev: http://localhost:5000
cd ../tshare-Frontend
npm installVITE_BACKEND_URL=http://localhost:5000Frontend throws an error on startup if
VITE_BACKEND_URLis missing.
npm run devFrontend default URL: http://localhost:5173
npm run dev- start Vite dev servernpm run build- production buildnpm run preview- preview production buildnpm run lint- run ESLint
npm start- run Express servernpm run server- run with nodemonnpm run dev- run withvercel dev
/- landing page/sharePage- text sharing page/share-image- image sharing page/share-pdf- PDF sharing page/recievePage- receive shared content/admin/login- admin login/admin/panel- admin management panel/public-room- public realtime chat room
- Text:
POST /save,GET /get/:id - Images:
POST /image/upload,GET /image/:id,GET /image/download/:id - PDFs:
POST /pdf/upload,GET /pdf/:id,GET /pdf/preview/:id,GET /pdf/download/:id - Admin login/password:
POST /admin/login,PUT /admin/password - Admin text/image management: list, update, delete, code regeneration
- Public room admin: create/list/delete/toggle room status
- Public room client:
GET /public-room/validate/:code,GET /public-room/:code/messages
- Server path:
/socket.io/ - Core events:
join-room,send-message,room-joined,chat-message,user-joined,user-left
- Backend initializes default admin password as
admin123on first run (change it from admin panel). - Max upload size for image and PDF is 5MB.
- Cloudinary is required for image/PDF upload endpoints.