mondaynightpoker-server is the backend application for the Monday Night Poker site (see: mondaynight.bid). The front-end code can be found at github.com/weters/mondaynightpoker-vue.
For more information about the architecture of this open-source project, see the architecture document.
- Acey Deucey
- Bourré
- Guts
- Pass the Poop
- Standard Edition
- Diarrhea Edition
- Pairs Edition
- Poker
- Pot-Limit Texas Hold'em
- Little L
- Seven-card games
- Seven-Card Stud
- Follow the Queen
- Baseball
- High Chicago
- Low Card Wild
- Coupons and Clippings
- 7 Card Chiggs
- Go 1.24+
- golangci-lint v2
- Docker
- Google reCAPTCHA v3 Secret
- Create the dev database
$ make dev-database
- Create your public and private keys for JWT signing
$ make keys
- Make an admin user
$ go run ./cmd/admin -c user
- Run the server
$ MNP_RECAPTCHA_SECRET=X go run ./cmd/server
- Verify the server is running
$ curl http://localhost:5080/health
- Start the Vue.js front-end. Repo can be found at github.com/weters/mondaynightpoker-vue
The service can be configured through two methods:
- YAML Configuration: By default, the service will look for
config.yaml. You can also change the filename by setting aMNP_CONFIG_FILEenvironment variable. - Environment Variables: All configuration settings can be set by environment variables. Every variable is prefixed by
MNP_andcamelCaseis transformed toSNAKE_CASE. Example,jwt.publicKeywill becomeMNP_JWT_PUBLIC_KEY.
Any environment variables take precedence over values defined in YAML. The default configuration values are defined below.
host: https://mondaynight.bid
# Browser origins allowed for both CORS (REST) and the WebSocket upgrade.
# When empty, only `host` is permitted.
allowedOrigins:
- https://mondaynight.bid
- https://beta.mondaynight.bid
log:
disableAccessLogs: false
level: info
database:
dsn: postgres://postgres@localhost:5432/postgres?sslmode=disable
migrationsPath: ./sql
jwt:
publicKey: .keys/public.pem
privateKey: .keys/private.key
recaptchaSecret: '-'
startGameDelay: 10
playerCreateDelay: 60
email:
from: Monday Night Poker <no-reply@mondaynight.bid>
sender: no-reply@mondaynight.bid
username: dealer@mondaynight.bid
password: ""
host: mail.privateemail.com:587
templatesDir: templates
disable: falseNote on
allowedOrigins: this single list is enforced by both the CORS layer (REST) and the WebSocket upgrade check, so the two can never disagree about which browser origins are permitted. When developing locally against a front-end on a different origin (e.g.http://localhost:8080), add that origin toallowedOriginsor setMNP_ALLOWED_ORIGINS=http://localhost:8080— a missing entry now blocks REST as well as the WebSocket.
You can generate a YAML file with the defaults by running:
$ go run ./cmd/generate-config