An open API service indexing awesome lists of open source software.

https://github.com/webexsamples/lockout-game


https://github.com/webexsamples/lockout-game

Last synced: 9 months ago
JSON representation

Awesome Lists containing this project

README

          

![Lockout Game Header](./frontend/src/lockout.png)

# ๐Ÿ” Lockout Game

**Lockout** game โ€” a Webex-integrated, real-time multiplayer word game inspired by _Codenames_, reimagined with a **hacker vs cybersecurity AI theme**.

Players join teams, take on roles, ready up, and launch into a game session directly within a Webex meeting using **Socket.IO + LobbyContext-powered React frontend**.

---

## ๐Ÿš€ Gameplay Theme โ€“ Lockout

In the digital underworld, two rival hacker groups โ€” **Bluewave** and **Redshift** โ€” compete to extract sensitive data from a hostile AI system known as **Sentinel**.

- ๐Ÿง  **Hackers** (Team Leads): Give strategic clues
- ๐Ÿค– **AI Agents** (Teammates): Decode clues and extract files
- ๐Ÿ’€ **Cybersecurity Traps**: One wrong guess, game over
- ๐Ÿ•ธ **Honeypots**: Decoys planted by Sentinel

Only one team will breach the vault. Will you outsmart the AI, or fall into its trap?

---

## ๐Ÿงฉ Architecture Overview

This frontend is a **Vite + React application** using:

- **React Context API** (no Redux, no external state libraries)
- **MUI v6** for component design
- **Socket.IO** for real-time updates
- **Webex Embedded Apps SDK** for user and meeting identity

---

## ๐Ÿ”ง Key Features

| Feature | Description |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| ๐Ÿ” **LobbyContext** | All lobby state (participants, roles, team, ready status) is managed globally via React Context |
| ๐Ÿ”„ **WebSocket Updates** | All state changes are real-time via `Socket.IO` |
| ๐Ÿ’ฌ **Team Role Assignment** | One Hacker per team; players can switch teams or roles |
| โœ… **Ready Up System** | Players mark themselves "Ready"; game won't start until conditions are met |
| ๐Ÿ—ก **Self-contained Components** | UI components like `LobbyDetails`, `LobbyParticipants`, and `LobbyActions` are all context-aware and reusable |
| โšก **Hot Module Reload Safe** | All context is split properly for HMR support |

---

## ๐Ÿ“š How to Use `LobbyContext` in Components

```js
import { useLobbyContext } from '../context/useLobbyContext';

const MyComponent = () => {
const {
lobby,
user,
joinLobby,
toggleReady,
isUserTeamLead,
updateDisplayName,
} = useLobbyContext();

return

Welcome, {user?.display_name}
;
};
```

> Must be rendered within a `` scope.

---

## ๐Ÿงช Developer Tip โ€“ Testing a Component in Isolation

```jsx
import { LobbyContext } from '../context/LobbyContext';


;
```

---

## ๐ŸŽž Game Start Conditions (Enforced by Backend)

- โœ… **Each team has one Hacker (team lead)**
- โœ… **Teams are balanced**
- โœ… **All players are Ready**

Optionally, the **Game Host** can use **Force Start** (bypasses balance check but not readiness).

---

## ๐Ÿ“œ Contribution Notes

- Use `Grid2` from `@mui/material` with the `size={{ xs, sm }}` prop.
- Follow Prettier config:
```json
{
"singleQuote": true,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"endOfLine": "auto"
}
```
- All Python backend code is formatted via Ruff.
- Context-based code is preferred over prop-drilling or hooks with duplicate state.

---

Made with โค๏ธ by the Webex Developer Relations Team