A comprehensive web application that helps gamers find teammates for games like CSGO or Valorant. Users can create accounts, set up profiles with their gaming preferences, create or join lobbies, and chat with other players in real-time.
- Secure registration and login functionality
- JWT-based authentication
- Password hashing with bcrypt
- Session management
- Game ranks for different games
- Language preferences
- Gaming interests
- Online status tracking
- Profile visibility settings
- Activity history
- Create lobbies for specific games (up to 5 players)
- Join existing lobbies
- Lobby status tracking (open/full/closed)
- Lobby invitations
- Password protection for private lobbies
- WebSocket implementation using Socket.io
- Lobby group chat
- Private messaging between users
- Typing indicators
- Online status updates
- Message history
- Search for players by game rank, language, interests, and online status
- Search for lobbies by game, rank, language, and status
- Dynamic filtering options
- Real-time results display
- HTML5
- CSS3
- JavaScript (Vanilla JS)
- Socket.io Client
- Node.js
- Express
- MongoDB with Mongoose
- Socket.io
- JSON Web Tokens (JWT)
- bcrypt for password hashing
lobby-finder-project/
├── public/ # Frontend files
│ ├── css/ # CSS stylesheets
│ ├── js/ # JavaScript files
│ │ ├── main.js # Main JavaScript file
│ │ ├── auth.js # Authentication functions
│ │ ├── profile.js # Profile management functions
│ │ ├── lobby.js # Lobby management functions
│ │ ├── chat.js # Real-time chat functions
│ │ └── search.js # Search and filter functions
│ ├── pages/ # HTML pages
│ │ ├── login.html # Login page
│ │ ├── register.html # Registration page
│ │ ├── profile.html # User profile page
│ │ ├── lobbies.html # Lobby browser page
│ │ └── search.html # Search page
│ └── index.html # Landing page
├── server/ # Backend files
│ ├── config/ # Configuration files
│ │ └── db.js # Database connection
│ ├── controllers/ # Request handlers
│ │ ├── userController.js # User-related controllers
│ │ ├── profileController.js # Profile-related controllers
│ │ └── lobbyController.js # Lobby-related controllers
│ ├── middleware/ # Middleware functions
│ │ └── authMiddleware.js # Authentication middleware
│ ├── models/ # Database models
│ │ ├── userModel.js # User model
│ │ ├── profileModel.js # Profile model
│ │ └── lobbyModel.js # Lobby model
│ ├── routes/ # API routes
│ │ ├── userRoutes.js # User-related routes
│ │ ├── profileRoutes.js # Profile-related routes
│ │ └── lobbyRoutes.js # Lobby-related routes
│ ├── socket/ # WebSocket implementation
│ │ └── socketServer.js # Socket.io server
│ └── server.js # Main server file
├── .env # Environment variables
├── package.json # Project dependencies
└── README.md # Project documentation
- Clone the repository
git clone https://github.com/yourusername/lobby-finder-project.git
cd lobby-finder-project
- Install dependencies
npm install
- Create a
.envfile in the root directory with the following variables:
NODE_ENV=development
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
- Start the server
npm start
- Open your browser and navigate to
http://localhost:5000
POST /api/users- Register a new userPOST /api/users/login- Login userGET /api/users/profile- Get user profile (protected)PUT /api/users/profile- Update user profile (protected)
POST /api/profiles- Create or update profile (protected)GET /api/profiles/me- Get current user's profile (protected)GET /api/profiles/user/:userId- Get profile by user IDPUT /api/profiles/gameranks- Add game rank (protected)DELETE /api/profiles/gameranks/:game- Remove game rank (protected)
POST /api/lobbies- Create a new lobby (protected)GET /api/lobbies- Get all lobbiesGET /api/lobbies/:id- Get lobby by IDPUT /api/lobbies/:id- Update lobby (protected)DELETE /api/lobbies/:id- Delete lobby (protected)POST /api/lobbies/:id/join- Join lobby (protected)POST /api/lobbies/:id/leave- Leave lobby (protected)POST /api/lobbies/:id/invite- Invite user to lobby (protected)POST /api/lobbies/:id/messages- Add message to lobby chat (protected)
connect- Client connected to serverdisconnect- Client disconnected from server
onlineUsers- List of online usersuserStatusChanged- User status update
joinLobby- Join a lobbyleaveLobby- Leave a lobbylobbyChatMessage- Send message to lobby chatnewLobbyChatMessage- New message in lobby chatuserJoinedLobby- User joined lobbyuserLeftLobby- User left lobby
privateMessage- Send private messagenewPrivateMessage- New private message received
lobbyTyping- User typing in lobby chatprivateTyping- User typing in private chatuserTyping- Typing indicator update
- JWT (JSON Web Token) authentication flow with token generation and validation
- Secure password hashing using bcrypt with salt rounds for enhanced security
- Middleware-based route protection for authenticated endpoints
- Token-based session management with refresh capabilities
- Persistent login state maintained through localStorage
- MongoDB schema for user profiles with embedded game ranks
- RESTful API endpoints for CRUD operations on profile data
- Game ranks stored as an array of objects with game name and rank fields
- Profile data persistence between sessions
- User preferences saved as structured objects
- Profile image handling with URL storage
- Language and interests stored as string arrays for efficient filtering
- MongoDB schema supports multiple game ranks per user
- CRUD operations for managing game ranks:
- Adding new game ranks (
PUT /api/profiles/gameranks) - Removing existing game ranks (
DELETE /api/profiles/gameranks/:game) - Updating game ranks with the same game name
- Adding new game ranks (
- Conflict resolution for duplicate game entries
- UI components for displaying and editing game ranks
- Server-side validation for game rank data
- Real-time lobby status updates using Socket.io
- Lobby persistence in MongoDB with reference to creator
- Player management within lobbies (join/leave operations)
- Invitation system for inviting friends to lobbies
- Lobby filtering based on game, region, and status
- Dedicated chat rooms for each lobby
- Socket.io for WebSocket-based real-time communication
- Private messaging between users with persistent message history
- Lobby chat rooms with real-time updates
- Socket authentication using JWT tokens
- Reconnection handling with automatic retry mechanisms
- Error handling for socket connection issues
- Fallback mechanisms for loading Socket.IO library
- Cross-browser compatibility for WebSocket connections
- Responsive design using CSS Grid and Flexbox
- Dynamic content loading without page refreshes
- Real-time updates for UI elements based on socket events
- Form handling with validation feedback
- Notification system for important events
- Dark-themed gaming interface with neon accents
- MongoDB for persistent data storage
- Mongoose ODM for schema validation and query building
- RESTful API architecture for data operations
- Socket.io for real-time data synchronization
- Client-side data caching for performance optimization
- Error handling with appropriate HTTP status codes
- Voice chat integration
- Team/clan creation and management
- Tournament organization
- Integration with game APIs for automatic rank updates
- Advanced matchmaking algorithms
- Mobile app version