Welcome to TypeHour, a fast-paced multiplayer typing racing game built for a take-home assessment for PlayHour.ai. This repository contains the frontend code for the game, showcasing a combination of cutting-edge web technologies and delightful animations.
TypeHour is a multiplayer game where players compete to type through a given paragraph as quickly and accurately as possible. The first player to complete the paragraph wins!
- Join or Create a Game:
- Enter an existing game ID or create a new game.
- Race to Type:
- Type the provided paragraph as quickly and accurately as possible.
- Progress is displayed in real-time for all players.
- Win:
- The first player to complete the paragraph is the winner, but all players can see their scores and rankings at the end.
- RxJS: For reactive state management and handling real-time updates efficiently.
- Storybook: For building and testing UI components in isolation.
- Storybook Documentation: View Storybook Components
- Framer Motion: For smooth animations and transitions.
- Vite: A fast and modern frontend build tool.
- Socket.IO: For real-time communication between the client and server.
Follow these steps to set up and run the project locally:
Make sure you have the following installed:
- Node.js (v16 or later)
- npm or yarn
-
Clone the Repository
git clone https://github.com/ore-codes/typehour-webapp.git cd typehour-webapp
-
Install Dependencies
npm install # or yarn install
-
Set Up Environment Variables
Create a.env
file in the root directory with the following content:VITE_SERVER_URL=http://localhost:3000
Replace
http://localhost:3000
with your backend server URL if it's running elsewhere. -
Run the Development Server
npm run dev # or yarn dev
Open your browser and navigate to
http://localhost:5173
to play the game locally.
To view and interact with the UI components used in the game:
npm run storybook
# or
yarn storybook
Storybook will be accessible at http://localhost:6006
.
- Real-Time Multiplayer: Powered by Socket.IO for seamless interactions between players.
- Reactive UI: Built using RxJS to handle live updates in player progress and game states.
- Interactive Animations: Framer Motion makes the game visually engaging and smooth.
- Component Isolation: Storybook ensures high-quality, reusable UI components.
- Modern Build Tooling: Vite enables lightning-fast development and builds.
Explore the complete UI documentation for TypeHour components:
View Storybook
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License.
Thank you for checking out TypeHour! 🎉