Your personal storage box for Telegram. A full-stack MERN application that uploads images directly to your Telegram chat. Built with React, Express, and Node.js for fast and reliable file sharing.
- πΌοΈ Upload multiple images at once
- π€ Automatic upload to Telegram
- βοΈ Modern React frontend with routing
- π¨ Beautiful UI with Bootstrap
- π File type validation (JPG, JPEG, PNG only)
- π Production-ready with build scripts
Frontend:
- React 18
- React Router DOM
- Axios
- Bootstrap 5
Backend:
- Node.js
- Express
- Multer (file uploads)
- node-telegram-bot-api
- CORS
- Node.js (v20.10.0 or higher)
- A Telegram Bot Token
- A Telegram Chat ID
git clone <repository-url>
cd Image_Uploadernpm run install-allThis will install dependencies for both the server and the client.
Create a .env file in the root directory:
PORT=5000
TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here
TELEGRAM_CHAT_ID=your_telegram_chat_id_here
NODE_ENV=developmentBot Token:
- Open Telegram and search for @BotFather
- Send
/newbotand follow the instructions - Copy the token provided
Chat ID:
- Start a chat with your bot
- Send a message to the bot
- Visit:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates - Look for the
chat.idin the response
Run both client and server concurrently:
npm run dev- Frontend: http://localhost:3000
- Backend: http://localhost:5000
- Build the React app:
npm run build- Start the server:
npm startThe server will serve the built React app on the configured PORT.
| Script | Description |
|---|---|
npm start |
Run the production server |
npm run server |
Run the backend server with nodemon |
npm run client |
Run the React development server |
npm run dev |
Run both client and server concurrently |
npm run install-all |
Install all dependencies (root and client) |
npm run build |
Build the React app for production |
Image_Uploader/
βββ client/ # React frontend
β βββ public/
β βββ src/
β β βββ components/
β β β βββ Upload.js
β β β βββ Upload.css
β β β βββ ThankYou.js
β β β βββ ThankYou.css
β β βββ App.js
β β βββ index.js
β β βββ index.css
β βββ package.json
βββ uploads/ # Temporary upload directory (auto-created)
βββ server.js # Express server
βββ package.json # Server dependencies
βββ .env # Environment variables (not in git)
βββ .gitignore
βββ README.md
Upload images to Telegram.
Request:
- Method: POST
- Content-Type: multipart/form-data
- Body: Form data with
filesfield (array of images)
Response:
{
"success": true,
"message": "Files uploaded successfully"
}- Upload Component: Handles file selection and upload with validation
- ThankYou Component: Shows success message with animated checkmark
- React Router: Provides seamless navigation between pages
- Express API: RESTful API endpoint for file uploads
- Multer: Handles multipart/form-data file uploads
- Telegram Integration: Automatically sends uploaded files to Telegram
- File Cleanup: Removes temporary files after upload
- Create a new Heroku app
- Add environment variables in Heroku dashboard
- Deploy:
git push heroku mainMake sure to:
- Set
NODE_ENV=production - Configure all environment variables
- Run
npm run buildbefore deployment - The app will serve the built React app from the Express server
Issue: Files not uploading
- Check your Telegram credentials in
.env - Verify the bot has permission to send messages to the chat
Issue: CORS errors
- Ensure the backend server is running
- Check that the proxy is configured in
client/package.json
Issue: Port already in use
- Change the PORT in
.envfile - Kill the process using the port:
lsof -ti:5000 | xargs kill -9
MIT
asmith0713