Doppelkopf
An in-browser implementation of the traditional German Doppelkopf card game.
Live Demo
Try the Live Demo at doppelkopf.party
Features
This game is still a work in progress. You will see that it's playable but some features are still missing that you might know from other Doppelkopf games:
- Single player mode
- Playing multiple rounds
- Score calculation
- Announcements & Bids
- Extra points for winning a Doppelkopf, catching a fox, Charlie
- Playing solo
- Weddings
- Custom rules
Development
The game is implemented using TypeScript and vue.js. It's capable to run as a standalone web application that does not rely on being connected to a backend.
The backend part is written in Python and using the Flask microframework. It's a tiny application that's only serving administrative tasks (e.g. feature toggles) and collects some high-level metrics about games that have been played.
Getting Started
Frontend
To work on the frontend, go to the frontend/
directory
cd frontend
Make sure you use node v16 or greater.
Install frontend dependencies:
npm install
Serve the frontend development server on localhost:5173.
npm run dev
Run the tests before and after making changes:
npm run test
Backend
Install backend dependencies:
cd backend
pipenv install --dev
If this is the first time you're setting up the backend, you need to create an admin
user that you can use to log in with. Currently, the backend is hard-wired to look for a user called admin
so don't change that. For the password you're free to chose whatever you fancy. Something like this:
make create_user username=admin password=admin
Start the backend development server on localhost:5000:
make run
Run the tests before and after making changes:
make test
Testing
We're very serious about testing. All bug fixes and new features should come with new tests. Backend tests are implemented with pytest, frontend unit tests with Jest and frontend end-to-end tests with nightwatch.js.
docker-compose
build
Testing the Make sure docker-compose
and docker
are properly installed.
Using docker-compose
you can start the proxy server that serves the frontend application as well as the backend application at once.
Run the local build:
- Make sure that you've got a
.env
file in thebackend/
directory (you can copy the.env.sample
one and adapt its values) - run
docker-compose build
export APP_ENVIRONMENT=local && docker-compose up
Run the production build:
- Make sure that you've got a
backend.env
file in the current directory - run
docker-compose build
(or pull viadocker-compose pull
) export APP_ENVIRONMENT=prod && docker-compose up -f docker-compose.yml -f docker-compose.prod.yml
More Helpful Commands
Build the frontend application for production, with minification:
npm run build