Skip to content

mattfox/sidestacker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Side-Stacker

sidestacker

This uses Django for the backend, Sanic for websockets, a little bit of Javascript and HTMX for the frontend, and PostgreSQL for the database and async notifications (SQLite would work just fine for the database except the interprocess communication uses Postgres LISTEN/NOTIFY).

This is purposefully kept very simple- no Javascript build process and no static files to serve.

Setup

Make a virtualenv and install requirements.

git clone [email protected]:mattfox/sidestacker.git
cd sidestacker
./setup-dev.sh

Make a PostgreSQL user and database.

createuser --pwprompt sidestacker  # Record the password
createdb --owner sidestacker sidestacker_db

Make life easier with an .envrc file. Call source .envrc or better yet, have Direnv do it for you.

cat > .envrc << EOF
source venv/bin/activate
export DATABASE_URL=postgres://sidestacker:[email protected]/sidestacker_db
export SECRET_KEY=something really random (like from https://duckduckgo.com/?t=h_&q=password+30+strong&ia=answer)
EOF

Create database tables.

cd app/
python manage.py migrate

Operation

To run the servers:

cd app/
python manage.py runserver

and

sanic server --port 8001

The Plan

Matt's notes on how to write this:

  1. ✓ Django project basics (virtualenv, can fetch page from runserver)
  2. ✓ Game model stubs
  3. ✓ Game model tests (new moves, game completion cases)
  4. ✓ Implement game model methods (make test pass)
  5. ✓ Simple URLs, views, templates (associate session with game, match making, only initial state supported)
  6. ✓ Support whole game lifecycle (waiting for match, taking turns, completion)
  7. ✓ Consider design (layout, colours, mobile)
  8. ✓ Javascript, websockets, Sanic, PostgreSQL notify (update game view without refresh; page refresh reloads game state)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published