-
Notifications
You must be signed in to change notification settings - Fork 0
Home
= Welcome to Crude Cards =
== Introduction == Welcome to the Crude Cards Wiki! This guide provides documentation for our real-time card game project built using modern web technologies like React, Next.js, and NestJS. Whether you're a developer, designer, or curious user, you'll find helpful information here.
== Key Features == - Real-Time Gameplay: Supports multiplayer with WebSocket integration. - Cross-Platform Support: Play on desktop or mobile seamlessly. - Customizable Game Rules: Modify the rules to fit your party’s style. - Educational Purpose: Learn full-stack development with fun examples.
== Project Structure ==
The project is organized into the following directories:
+--- /backend | +--- /controllers | +--- /models | +--- /services +--- /frontend | +--- /components | +--- /pages | +--- /styles +--- /shared
+--- /constants +--- /utils
Each directory serves a specific purpose in the overall architecture. Detailed information is available in their respective sections.
== Getting Started ==
=== Installation Steps ===
To set up the project locally, follow these steps:
1. Clone the repository: [source,bash] ---- git clone https://github.com/ConstructWorks/cards.git ---- 2. Navigate to the project directory: [source,bash] ---- cd cards ---- 3. Install the required dependencies: [source,bash] ---- pnpm install ---- 4. Run the development server: [source,bash] ---- pnpm dev ----
Visit http://localhost:3000 to view the game in your browser.
== Game Rules ==
Setup: - Players join a game session via a room code. - A "Dealer" is selected for each round.
Gameplay: - The Dealer plays a black card with a prompt. - The other players choose the funniest white card from their hand. - The Dealer selects the winning card.
Winning: - Points are awarded to the player whose card is chosen. - The first player to reach the predefined number of points wins.
== Technical Stack ==
[cols="3,3,6", options="header"] |=== | Layer | Technology | Purpose
|===
== Code Example: WebSocket Integration ==
Here’s a sample WebSocket integration using Socket.io:
import { Server } from 'socket.io';
- const io = new Server(server, {
-
- cors: {
- origin: '*',
}
});
- io.on('connection', (socket) => {
-
console.log('A user connected');
- socket.on('joinRoom', (roomCode) => {
- socket.join(roomCode); console.log(User joined room: ${roomCode});
});
- socket.on('sendMessage', (message) => {
- io.to(message.room).emit('receiveMessage', message);
});
- socket.on('disconnect', () => {
- console.log('A user disconnected');
});
});
== Frequently Asked Questions ==
Q1: How do I customize the game rules?
You can modify the rule settings in the /shared/constants/game-rules.js file.
Q2: Is this project mobile-friendly?
Yes, the game is fully responsive and works seamlessly across different devices.
Q3: How can I contribute to this project?
Feel free to fork the repository, create a feature branch, and submit a pull request.
== Contribution Guidelines ==
We welcome contributions! Please follow these steps:
- Fork the repository.
- Create a feature branch: git checkout -b feature/new-feature.
- Commit your changes: git commit -m 'Add new feature'.
- Push to the branch: git push origin feature/new-feature.
- Submit a pull request.
== Useful Links ==
- [Official Documentation](https://docs.construct.works)
- [GitHub Issues](https://github.com/ConstructWorks/cards/issues)
- [Community Forum](https://community.construct.works)
== License ==
This project is licensed under...