Giter Site home page Giter Site logo

sudoku's Introduction

Sudoku web app

Screen.Recording.2023-07-03.at.19.14.58.mov

Repo setup

Clone the repo

git clone [email protected]:edwilson543/sudoku.git
cd sudoku

Copy the example .env files

cp frontend/.env.example frontend/.env
cp backend/sudoku/.env.example backend/sudoku/.env

In frontend/.env comment out on of the with / without docker sections as relevant

DB setup:

System requirements:

  • postgres 14.9
createdb sudoku

App setup (with docker):

System requirements:

  • Docker 20.10.20

Running:

docker-compose build
docker-compose up

App setup (without docker):

System requirements:

  • Python 3.11
  • Node 18.16

Installation:

Backend:

cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements/app-requirements.txt
python manage.py migrate

Frontend:

cd frontend
npm install

Running:

In one shell:

cd backend
python manage.py runserver 8000

In another shell:

npm start

Then visit your localhost to play.

There's also a django admin which shows all players, games, sudokus and game moves.


Tech stack:

  • React for the frontend
  • Django for the backend
  • Django REST framework for the API allowing them to communicate

Features:

  • Gameplay
    • Make, erase & undo moves
    • Validation mode (highlights incorrect guesses when turned on)
    • Play sudokus of different sizes and varying difficulties
    • Light & dark themes
  • Backend
    • Sudoku solver using integer programming
    • Sudoku generation - the algorithm I came up with is:
      • Randomly shuffle a solved sudoku, ensuring the solution remains valid
      • Randomly remove a certain number of clues
      • Attempt solving the sudoku and check that the solution is unique
    • Player identification
    • Persistence of current game state and historic games

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.