Real-time spinning wheel app for presenter selection with Next.js 15 (App Router) + Socket.IO + Redis.
- Node.js 18+
- npm or yarn
- Docker and Docker Compose (for containerized development)
- Clone the repository:
git clone https://github.com/underscorekadji/wheel.git
cd wheel- Install dependencies:
npm install- Create environment file:
cp .env.example .env.local- Start the development server:
npm run dev- Open http://localhost:3000 in your browser.
For local development with hot reload:
- Clone the repository:
git clone https://github.com/underscorekadji/wheel.git
cd wheel- Start development services:
npm run docker-
Access the application:
- Via Nginx (recommended): http://localhost
- Direct app access: http://localhost:3000
-
View logs:
docker compose -f docker/dev/docker-compose.yml logs -f- Stop services:
npm run docker:downFor production deployment:
- Build and start production services:
docker compose -f docker/prod/docker-compose.yml up -d --build-
Access the application at http://localhost
-
Stop production services:
docker compose -f docker/prod/docker-compose.yml downUse the test script to quickly validate your Docker setup:
./docker/docker-test.sh- app: Next.js server (development: hot reload server, production: standalone server)
- redis: Redis server with persistence (port 6379)
- nginx: Reverse proxy with compression and security headers (port 80)
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production server
npm run format- Format code with Prettiernpm run lint- Run ESLintnpm run lint:fix- Fix ESLint issuesnpm run type-check- Check TypeScript typesnpm run check- Run all quality checks (format + lint + type-check)
npm run test- Run tests in watch modenpm run test:run- Run tests oncenpm run test:coverage- Run tests with coverage
npm run docker- Start development Docker servicesnpm run docker:down- Stop development Docker servicesnpm run verify- Run full CI pipeline locally (check + test + build)npm run clean- Clean build artifacts and caches
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Linting: ESLint + TypeScript ESLint
- Real-time: Socket.IO (planned)
- Database: Redis (planned)
/→ Start page (Create/Join forms)/room/{id}→ Room page (role detected via cookie)POST /api/room→ Room creation endpoint
- Role-based UI switching: Organizer (full control) vs Guest (read-only)
- Real-time sync via custom
useRoomSockethook - 60fps wheel animation, ≤2s first contentful paint
- Support for 3,000 concurrent WebSocket connections across 100 rooms
This project follows Conventional Commits enforced by Commitlint.
Example commit message: feat(component): add new button variant
This project uses Husky to run pre-commit hooks that enforce code quality standards. The following checks are automatically run before every commit:
- Code Formatting:
npm run format:check- Ensures all files follow Prettier formatting rules - Linting:
npm run lint- Runs ESLint to check for code quality and potential issues - Type Checking:
npm run type-check- Validates TypeScript types across the project
If any of these checks fail, the commit will be blocked until the issues are resolved.
Pre-commit hooks are automatically installed when you run npm install (via the prepare script). If you need to manually reinstall them:
npm run prepareIf a commit is blocked due to pre-commit check failures:
- Quick fix:
npm run format && npm run lint:fix - Check all issues:
npm run check - Type errors: Fix TypeScript errors manually
💡 Pro tip: Run npm run verify before pushing to ensure your changes pass all CI checks locally.
After fixing the issues, stage your changes and commit again.