Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WORDLE - DJANGO WEB APPLICATION

Author: Akarshan Poudel Origin: Web port of the command-line Wordle game, rebuilt on Django with accounts and per-player stats.

1. PROJECT OVERVIEW


A browser-based Wordle clone. Visitors create an account, guess a random 5-letter word in 6 tries, and get colored tile feedback (green/yellow/gray) after each guess. Every finished round is logged against the player's account, and a stats page shows win rate, streaks, and a guess-distribution breakdown - the same idea as the original terminal game, with accounts and history layered on top.

2. SYSTEM ARCHITECTURE

wordle_web/
└── game/
    ├── data/
    │   └── words.txt
    ├── static/game/
    │   └── style.css
    ├── templates/game/
    │   ├── board.html
    │   ├── login.html
    │   ├── signup.html
    │   └── stats.html
    ├── forms.py
    ├── game_logic.py
    ├── models.py
    ├── tests.py
    └── views.py

Game state for the round currently being played lives in the Django session (no database write per guess). Once a round ends - win or loss - one GameResult row is written, and the stats page is computed from that table with a simple query + aggregation, rather than a separately maintained counter that could drift out of sync.

3. FEATURES IMPLEMENTED


  • Accounts: sign up, log in, log out (Django's built-in auth)
  • Playing the game requires being logged in, since results are tied to an account
  • Same input guarding as the original: wrong length, non-letters, and words outside the dictionary are all rejected without costing an attempt
  • Colored tile feedback (correct / present / absent) instead of the terminal's ✓ / * / . symbols
  • Stats page: games played, win rate, current streak, best streak, and a guess-distribution bar chart (how many wins took 1 try, 2 tries...)
  • Recent games list

4. HOW TO RUN


i. (Recommended) create and activate a virtual environment: python -m venv venv venv\Scripts\activate (Windows) source venv/bin/activate (macOS/Linux)

ii. Install dependencies: pip install -r requirements.txt

iii. Set up the database (creates db.sqlite3, empty and ready to use): python manage.py migrate

iv. Run the development server: python manage.py runserver

v. Open http://127.0.0.1:8000/ in a browser, sign up, and play.

Optional - to manage players/games from Django's admin site: python manage.py createsuperuser then visit http://127.0.0.1:8000/admin/

5. TESTS


game/tests.py covers both the pure game logic and the full request flow (signup, an invalid guess, a win, a loss, streak math, the anonymous redirect). Run them with: python manage.py test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages