PacPlatform is a multiplayer Pac-Man game and social platform built using the LERN stack (LiteDB, Express.js, React.js, Node.js). LiteDB is a lightweight, in-memory database created by the author of this project.
- Multiplayer Pac-Man: Real-time multiplayer Pac-Man game using WebSocket connections.
- Social Platform:
- Add friends and compare stats
- Search and view other users' profiles
- RESTful API: Backend provides a RESTful API for data management.
- WebSocket Support: Backend handles both HTTP and WebSocket connections for real-time gameplay.
- Frontend: React.js
- Backend: Node.js with Express.js. Implements a RESTful API and WebSocket server.
- Database: LiteDB. Created by the author of this project.
- WebSockets: Socket.IO for real-time communication
- Testing: Cypress for end-to-end (e2e) tests
- Documentation: JSDoc for backend documentation
- Clone the repository:
git clone https://github.com/MastrMatt/PacPlatform.git - Ensure a liteDB instance is running on port 9255. Instructions on how to install and run liteDB can be found here.
- Install backend dependencies:
cd backend && npm install - Start the backend server:
npm run dev - Install frontend dependencies:
cd ../frontend && npm install - Start the frontend development server:
npm run dev - Navigate to the port where the frontend server is running in your browser.
To start a game, follow these steps:
- Log in to your account on the PacPlatform website.
- Create a game lobby from the homepage.
- Share the lobby code with your friends.
- Your friends can join the game by entering the lobby code.
- The game will start when all players have joined.
To add friends on PacPlatform, follow these steps:
- Log in to your account on the PacPlatform website.
- Click on the "Search" tab on the navigation bar.
- Search for the username of the friend you want to add.
- Click on the "Send Friend Request" button.
To view other users' profiles and compare stats, follow these steps:
- Log in to your account on the PacPlatform website.
- Click on the "Search" tab on the navigation bar.
- Search for the username of the user whose profile you want to view.
- Click on the "View" button.
- View the user's stats, including their high score, games played, and score per game ratio.
- Compare your stats with theirs to see who's the ultimate Pac-Man champion.
End-to-end tests are implemented using Cypress. To run the tests:
- Install Cypress:
npm install cypress --save-dev - Run Cypress:
npx cypress open
Backend documentation is generated using JSDoc.
- Enhance the Pac-Man game:
- Add music
- Implement additional features (e.g., cherries, teleportation)
- Expand the platform with more games
Matthew Neba / @MastrMatt
This project is licensed under the MIT License.
Contributions to this project are welcome. Please submit pull requests or open issues to discuss potential improvements or report bugs.