This guide will walk you through the steps to install and run the Multiplayer UNO Game project on your local machine.
Before you begin, ensure you have the following software installed on your machine:
- Node.js and npm (Node Package Manager)
- MongoDB (either installed locally or using a cloud service like MongoDB Atlas)
- Git
First, clone the repository from GitHub to your local machine:
git clone https://github.com/yourusername/multiplayer-uno.git
cd multiplayer-uno
-
Navigate to the
backend
directory:cd backend
-
Install the backend dependencies:
npm install
-
Create a
.env
file in thebackend
directory and add the following environment variables:MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret PORT=5000
Replace
your_mongodb_connection_string
with your actual MongoDB connection string andyour_jwt_secret
with a secret key for JWT authentication. -
Start the backend server:
npm start
The backend server should now be running on
http://localhost:5000
.
-
Navigate to the
frontend
directory:cd ../frontend
-
Install the frontend dependencies:
npm install
-
Create a
.env
file in thefrontend
directory if needed for any configuration. -
Start the frontend development server:
npm run dev
The frontend application should now be running on
http://localhost:5173
.
With both the backend and frontend servers running, open your browser and navigate to http://localhost:5173
to access the UNO game. You should be able to sign up, log in, create or join game rooms, and start playing.
If you encounter any issues during installation, consider the following steps:
- Check Dependencies: Ensure that all dependencies are installed correctly by running
npm install
in both thebackend
andfrontend
directories. - Environment Variables: Ensure that your
.env
file contains the correct values for your MongoDB connection string and JWT secret. - Server Logs: Check the terminal output for any error messages from the backend or frontend servers.
- Port Conflicts: Make sure that ports
5000
(backend) and5173
(frontend) are not being used by other applications.
If you have any questions or need further assistance, please open an issue on the GitHub repository or contact us via Email.
Thank you for installing and contributing to the Multiplayer UNO Game project!