A lightweight IoT project that hosts a modern React (Vite) web app directly on an ESP8266 using LittleFS.
This project turns your ESP8266 into a WiFi hotspot + captive portal, automatically redirecting users to a hosted website (portfolio/dashboard) without internet.
- 📡 ESP8266 acts as a WiFi Access Point
- 🌐 Captive Portal (auto opens site on connect)
- ⚡ Serves React (Vite) build from LittleFS
- 📁 Static file handling (HTML, JS, CSS, images)
- 📱 QR code support for instant WiFi connection
- 🔁 SPA routing fallback (React Router support)
- 📴 Fully offline web app
- ESP8266 (NodeMCU)
- Arduino IDE
- LittleFS
- React + Vite
- DNS Server (Captive Portal)
project/
├── sketch_may18a.ino # ESP8266 server code
├── data/ # React build files (LittleFS)
│ ├── index.html
│ ├── assets/
│ └── ...
-
Install ESP8266 board in Arduino IDE
-
Install required libraries:
- ESP8266WiFi
- ESP8266WebServer
- DNSServer
- LittleFS
In your React project:
npm run buildUpdate vite.config.js:
export default {
base: "./"
}- Rename
build/→data/ - Upload using:
Tools → ESP8266 LittleFS Data Upload
Flash your .ino file via Arduino IDE.
- Power the ESP8266
- Connect to WiFi:
Sabari_Webserver
- Captive portal will open automatically OR open manually:
http://192.168.4.1
Scan to connect:
WIFI:T:WPA;S:Sabari_Webserver;P:sabari123;;
- ESP8266 creates a WiFi hotspot
- DNS server redirects all domains → ESP IP
- Web server serves React build from LittleFS
- Captive portal tricks OS into auto-opening site
- Limited memory (optimize build size)
- No HTTPS support
- Performance depends on ESP8266 hardware
- OTA updates
- ESP32 support
- Gzip compression for faster load
- IoT device control dashboard
- PWA support
Pull requests are welcome! Feel free to open issues for improvements or bugs.
MIT License
Sabarivasan S.M Full Stack Developer | IoT Enthusiast