A simple full-stack emoji reaction web app built with React (Vite) on the frontend, Express.js on the backend, and MariaDB for persistence. It allows users to react to content using one of five emojis. The app displays live reaction counts and stores them in the database.
- Vite + React frontend served via Nginx
- Express backend with REST API
- MariaDB database to store emoji counts
- Docker Compose orchestration for services
- Load balancing across multiple backend replicas via Nginx
docker,docker-composeandnpmpackages
- Create a data directory for MariaDB
mkdir mariadb_data- Install backend dependencies
cd backend
npm install- Build the frontend
cd ../frontend
npm install
npm run build- Start all services In the root directory:
docker compose up -dThis will start:
-
Nginx serving the built frontend on http://localhost
-
Express backend on http://localhost:3000
-
MariaDB database initialized with emoji reaction data
Open your browser and go to: http://localhost
- On load, the frontend requests current emoji counts from the backend (
/reactions) - Clicking an emoji sends a POST to
/reacton the backend - The backend increments the reaction count in the MariaDB database
- The UI updates immediately with the new count
- Frontend: React (Vite), served via Nginx
- Backend: Node.js, Express (deployed in 3 replicas)
- Database: MariaDB
- Containerization: Docker, Docker Compose
- Networking: Internal Docker bridge network (app-network)
- Load Balancer: Nginx proxies traffic to multiple backend containers
- Rebuild and restart:
docker compose down -v && docker compose up --build.
├── backend # Express backend with Dockerfile and init logic
├── db # SQL init script
├── frontend # Vite React frontend
├── nginx # Nginx config for serving frontend and proxying API
├── docker-compose.yml
└── README.md