Node WebSocket API is an Express and Socket.IO backend for exhibition-form operations with JWT authentication, role-based access control, image uploads, and real-time admin notifications.
- Express 5 backend
- JWT-based authentication
- Role-based permissions for
admin,expert, andpromoter - MySQL-backed form storage
- Socket.IO notifications for create, update, and delete events
- Docker Compose setup with MySQL and phpMyAdmin
- Node.js
- Express
- Socket.IO
- MySQL
- JWT
- Joi
- Multer
- Docker Compose
backend/server.js: application bootstrap and route registrationbackend/routes/auth.js: login and registration endpointsbackend/routes/forms.js: protected form-management routesbackend/controllers/: auth and form business logicbackend/services/: auth middleware, upload handling, and socket integrationdocker-compose.yml: local stack for backend, MySQL, and phpMyAdmin
- User registration and login
- Protected form submission
- Admin-only listing, update, and delete operations
- File upload support for form records
- Real-time admin events for form lifecycle changes
- Node.js
- Docker with Compose plugin
- Clone the repository.
- Copy the environment templates:
cp .env.example .env
cp backend/.env.example backend/.env- Start the local stack:
docker compose up --build- Or run only the backend locally:
cd backend
npm install
npm run devRoot .env.example:
PORTPHPMYADMIN_PORTMYSQL_ROOT_PASSWORDMYSQL_DATABASEMYSQL_USERMYSQL_PASSWORD
Backend backend/.env.example:
PORTJWT_SECRETDB_HOSTDB_USERDB_PASSWORDDB_NAME
POST /api/loginPOST /api/registerGET /api/formsPOST /api/formsPUT /api/forms/:idDELETE /api/forms/:id
docker compose up --build
cd backend && npm run devNo automated test suite has been added yet.
Current validation is primarily done through local API checks, database-backed integration testing, and Socket.IO event verification.
- Keep
JWT_SECRETprivate and set it through environment files only - Do not commit real
.envfiles - Restrict admin-only routes to trusted users
No license has been specified yet.
Developed by Ali Balash.