![Screenshot3](https://private-user-images.githubusercontent.com/134631360/320176339-90453df8-ea55-4c0e-8725-87e8500640b6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyNjc5NTksIm5iZiI6MTcyNDI2NzY1OSwicGF0aCI6Ii8xMzQ2MzEzNjAvMzIwMTc2MzM5LTkwNDUzZGY4LWVhNTUtNGMwZS04NzI1LTg3ZTg1MDA2NDBiNi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMVQxOTE0MTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mYTY3YTlmZGRlNDQ4Nzk4YWRhZWYwNDRkNzQ4ZTRhMzM4MWZkYTI4N2FkZWZmNDZhOGE2OTgxNjcxOTk0YThmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.y09iJTNWuKctvZjzHAMAwipl7rza37VtWYit8PV06pI)
CoupOnline is a web application version of the popular card game Coup. It has been developed using Vite React for the frontend, Express Node.js for the backend, and MongoDB for the database. Utilizes socket.io to facilitate communication between users and frontend. Uses cookies to remember user information.
Coup Online The backend spins down when not in use, and takes about a minute to spin up before login or create account button presses are processed.
CoupOnline follows the rules of the original card game Coup.
- Rooms: Players can enter a room code and connect with others.
- Usernames: Players can select custom usernames when they enter the game.
- Global Leaderboard Players can see a global statistics.
- Player Accounts/Profiles Players can access their own records.
- Gameplay Log Players can see logs of each users turn.
- Express Node.js
- React Vite
- MongoDB
- Socket.IO
- Publishing Games: After a game is completed, the results are published to the database.
- Game Chat
- Public Lobbies
- Matchmaking
- Custom Visuals: Including animations, card images, profile pictures, and room aesthetics.
- Suspend/Resume Game: Ability to pause and resume ongoing games.
- Stepwise Replay: Replay previous games step by step.
- Ready Status: Indication of player readiness for the next phase or game.
![ScreenshotLogin](https://private-user-images.githubusercontent.com/97869609/319374163-58dbf0c1-37cf-4c09-9095-e83642c1fa27.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyNjc5NTksIm5iZiI6MTcyNDI2NzY1OSwicGF0aCI6Ii85Nzg2OTYwOS8zMTkzNzQxNjMtNThkYmYwYzEtMzdjZi00YzA5LTkwOTUtZTgzNjQyYzFmYTI3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIxVDE5MTQxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY1ZjFhYzUwMzQ1NWE1YmE3MDY2YWIzOTZjMDFkN2ZkODk5YmY0M2Y4OTMxZWVlYWRiNmQ3MWEzYWIyNWZkNjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Jb9UVwKORKlTTexhegFXwmXgy2uNWaLs09JlfzW-JXw)
Users will begin at the login page, where they can enter a registered username to login to their account. At this time, there is no password or verification system, accounts can be accessed by entering a valid username. Once logged in, a cookie will be saved into the browser session which will remember the logged in account.
![ScreenshotCreation](https://private-user-images.githubusercontent.com/134631360/320179874-dd943578-6d48-404e-bed4-21c6687c9952.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyNjc5NTksIm5iZiI6MTcyNDI2NzY1OSwicGF0aCI6Ii8xMzQ2MzEzNjAvMzIwMTc5ODc0LWRkOTQzNTc4LTZkNDgtNDA0ZS1iZWQ0LTIxYzY2ODdjOTk1Mi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMVQxOTE0MTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02MzBjZjVhZDQ3Y2ZjMWZiMzZkNWI3YjViMzJkYjg0NWE5Yzg2MWMxNzFjNmM1NDcwMmUyZjA0YmM3YTlmNWNmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.URnrSogm5x7kMX1vM2UA0nOfbg-KaxMBk8sI8iW9ZUs)
If you do not have an account, you can click the "Create an Account" button to navigate to the account creation page. Please note that we do not utilize or require personal information, and recommend you do not use your real name or email address when creating an account. Emails must be in a valid email format (nut do not need to be a valid email) and usernames must be unique (duplicate usernames are not permitted).
![ScreenshotJoin](https://private-user-images.githubusercontent.com/134631360/320183614-ebb8f30d-e2e4-4088-9228-cc7f61d4702c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvb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JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMVQxOTE0MTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lNDYwNzNlMTRmNWJlN2RmN2RhOTBhMWVhN2I4ZjE4Mzk1MDliOTM0ZDkxY2E2M2RlYmY3ZWRiY2Q3MjhlZWY0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.t7NRvJFSI715LcopVSEg5xdNoGVzU5dbtAgxksNwSCA)
Once logged in to an account, the user is brought to the join room page. From here, the user can join a lobby by entering a lobby name in the text field. When the join room button is clicked, the user will be placed in either a new or existing lobby. Once in a lobby, the user can see all players currently in the lobby. Once two or more players are in a lobby, any player can start the game by clicking the "Start Game" button.
![Screenshot3](https://private-user-images.githubusercontent.com/134631360/320176339-90453df8-ea55-4c0e-8725-87e8500640b6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyNjc5NTksIm5iZiI6MTcyNDI2NzY1OSwicGF0aCI6Ii8xMzQ2MzEzNjAvMzIwMTc2MzM5LTkwNDUzZGY4LWVhNTUtNGMwZS04NzI1LTg3ZTg1MDA2NDBiNi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMVQxOTE0MTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mYTY3YTlmZGRlNDQ4Nzk4YWRhZWYwNDRkNzQ4ZTRhMzM4MWZkYTI4N2FkZWZmNDZhOGE2OTgxNjcxOTk0YThmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.y09iJTNWuKctvZjzHAMAwipl7rza37VtWYit8PV06pI)
Once a game begins, players will be brought to the main game screen. There are six elements on the UI screen.
- Player Cards Remaining: A list of all players in the game showing the number of cards they have remaining.
- Current Turn Info: a summary of actions taken during the current turn
- Discarded Cards: A list showing all cards discarded during the course of the game
- Recent Turn History: Complete history of past actions
- Player Info: The main section a player interacts with during their turn. It shows the number of coins a player has, the cards they are holding, and actions that can be taken at the current point in the game.
- References: Includes a table listing all cards and actions, and a set of complete game rules.
![ScreenshotProfile](https://private-user-images.githubusercontent.com/97869609/319374087-45f4f0e6-9d0a-42ff-80a1-08ded899fc71.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyNjc5NTksIm5iZiI6MTcyNDI2NzY1OSwicGF0aCI6Ii85Nzg2OTYwOS8zMTkzNzQwODctNDVmNGYwZTYtOWQwYS00MmZmLTgwYTEtMDhkZWQ4OTlmYzcxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIxVDE5MTQxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJjYTk2NTAzZWRhMGRjZjMwYjAzZDE3MTRlYTg5YzI3YmMwZDgyMzZlMzQ4ZjBhOWQxYTg0MDEzZmExNWNhNDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.5IJwE8_GuqyjLvx4vNih2BRSBzADe38voEweYLlrM4s)
![ScreenshotProfile](https://private-user-images.githubusercontent.com/134631360/320183454-0ba82526-5b84-4329-8286-30af62d38983.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyNjc5NTksIm5iZiI6MTcyNDI2NzY1OSwicGF0aCI6Ii8xMzQ2MzEzNjAvMzIwMTgzNDU0LTBiYTgyNTI2LTViODQtNDMyOS04Mjg2LTMwYWY2MmQzODk4My5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMVQxOTE0MTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zMTVkNDg4MjNjYmEwZWNiZjk4NmNlMDI5ODFkNzAxMjUwMDE5OGViODhiZmY1N2E3ZDZiZWU3MzZmZjA3N2VlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.w-jdyzbvR-oqZbMGwiGtifZC7ulHzya_xVvhMSzWfKc)
- Clone the repository:
git clone https://github.com/batec2/CoupOnline
- Navigate to the project frontend and install dependencies and start the frontend:
- Create a .env file for the frontend with these entries
VITE_SERVER_URL="http://localhost:8080"
cd frontend
npm i
npm run dev
- Navigate to the project backend, install dependencies and start the backend:
cd backend
npm i
nodemon server.js
- Open your web browser and navigate to http://localhost:5173.