Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Wordle/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
24 changes: 24 additions & 0 deletions Wordle/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
43 changes: 43 additions & 0 deletions Wordle/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Wordle Game

This is a Wordle-inspired game built using React and Tailwind CSS.

## Installation

To run this project locally:

1. Clone the repository:

```bash
git clone https://github.com/MT-jlem/OpenDevEd-Wordle &&
git checkout wordle-mustapha-jlem &&
cd wordle-game
```

2. Install the dependencies:

```bash
npm install
```

3. Start the development server:

```bash
npm run dev
```

## Development Approach

I started by implementing the game logic and creating a basic UI to test and iterate on. My first focus was handling user input, which included capturing keyboard events and processing the input to form a guess.

### Input Validation

To validate the input, I needed to ensure that the guessed words were valid. Initially, I considered setting up a backend service for this purpose, but given the scope of the project, I decided to use a third-party API for word validation instead. This allowed me to quickly implement the feature without the overhead of managing a backend.

### State Management

As the project grew, I needed to share state across different components, particularly for managing the game's progress (e.g., guesses, attempts). To keep things simple and avoid unnecessary complexity, I chose the Context API for state management. While there are dedicated state management libraries available, I felt that using one would be overkill for this project given its scale.

### Feedback and UI Enhancements

After setting up the core functionality, I focused on providing feedback to the user when submitting a word. This included visual cues for correct and incorrect guesses, as well as handling edge cases like invalid words or duplicate submissions. To enhance the user experience, I added animations and UI improvements using Tailwind CSS, making the game more engaging and responsive.
13 changes: 13 additions & 0 deletions Wordle/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Wordle</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading