Monorepo for Davao Football Open Play (dfop.breindel.me):
packages/shared(@dfop/shared): Domain types, CSV parser (Name, Skill, Preferred Position), fuzzy player matcher, dynamic 7/9/11-a-side Team Maker engine (prioritizing fewest games played today + skill & positional line balancing + manual pins/swaps), and player performance index / leaderboard calculator.backend(@dfop/backend): AWS Lambda API handler (APIGatewayProxyEventV2) + DynamoDB single-table repository (@aws-sdk/client-dynamodb/@aws-sdk/lib-dynamodb) + local development server (localhost:4000).frontend(@dfop/frontend): React 18 + Vite + TypeScript + Tailwind CSS matchday web application built around the Davao Football Open Play crest (dfoplogo.png).infra(@dfop/infra): AWS CDK v2 stack (DfopStackinap-southeast-1) provisioning DynamoDB, Cognito User Pool (Admin-only), API Gateway HTTP API v2 + JWT Authorizer, Lambda (NodejsFunction), S3 Bucket, and CloudFront Distribution fordfop.breindel.me..github/workflows/deploy.yml: Path-filtered GitHub Actions CI/CD workflow.
# 1. Install dependencies across all workspaces
npm install
# 2. Run unit & integration tests across shared, backend, and CDK infra
npm test
# 3. Start the local backend API server (port 4000, pre-seeded with DFOP demo session)
npm run dev:backend
# 4. In another terminal, start the Vite frontend dev server (port 5173)
npm run dev:frontendUpload a .csv file in the Admin Console (or click Download Sample CSV) with the following columns:
Name,Skill,Preferred Position
Marco Santos,Advanced,MID
Paolo Reyes,Advanced,FWD
Enzo Villanueva,Intermediate,DEF
Carlo Mendoza,Intermediate,GK- Skill:
Beginner,Intermediate, orAdvanced - Preferred Position:
GK,DEF,MID,FWD, orANY - Returning Players: Matched case-insensitively by normalized name. Their
SkillandPreferred Positionare updated from the latest CSV while preserving their all-time stats. Similar names (edit distance <= 2) are flagged in the Admin UI so you can link them with one click.
Since DNS for breindel.me is managed outside Route 53 (e.g., Cloudflare / Namecheap):
-
Create an ACM Certificate in
us-east-1(CloudFront requires certificates inus-east-1):aws acm request-certificate \ --domain-name dfop.breindel.me \ --validation-method DNS \ --region us-east-1
Add the validation CNAME record shown in the ACM console to your DNS provider until the certificate status is
ISSUED. -
Deploy the CDK Stack (
ap-southeast-1):export AWS_REGION=ap-southeast-1 export ACM_CERTIFICATE_ARN="arn:aws:acm:us-east-1:<ACCOUNT_ID>:certificate/<CERT_ID>" npm run cdk:deploy
-
Point your External DNS CNAME: Copy the
CloudFrontDomainNameoutput fromcdk deploy(e.g.d111111abcdef8.cloudfront.net) and create a CNAME record in your DNS provider:- Name:
dfop - Target:
<CloudFrontDomainName>(if using Cloudflare, set Proxy status to DNS Only or Full (Strict) SSL).
- Name:
-
Create your Admin User in Cognito:
USER_POOL_ID="ap-southeast-1_cwgXrRA5j" aws cognito-idp admin-create-user \ --region ap-southeast-1 \ --user-pool-id "$USER_POOL_ID" \ --username "breindelm6@gmail.com" \ --user-attributes Name=email,Value=breindelm6@gmail.com Name=email_verified,Value=true \ --message-action SUPPRESS aws cognito-idp admin-set-user-password \ --region ap-southeast-1 \ --user-pool-id "$USER_POOL_ID" \ --username "breindelm6@gmail.com" \ --password "YourStrongPassword123" \ --permanent
The workflow in .github/workflows/deploy.yml uses dorny/paths-filter to detect changed files:
- Changes in
backend/**,infra/**, orpackages/shared/**triggercdk deploy DfopStack. - Changes in
frontend/**,infra/**, orpackages/shared/**build the React SPA, syncfrontend/distto S3, and invalidate CloudFront.
Configure the following in your GitHub repository (Settings -> Secrets and variables -> Actions):
- Secrets:
AWS_ROLE_ARN(recommended OIDC IAM role ARN) orAWS_ACCESS_KEY_ID+AWS_SECRET_ACCESS_KEYACM_CERTIFICATE_ARN(yourus-east-1ACM certificate ARN fordfop.breindel.me)
- Variables (optional):
AWS_REGION(defaults toap-southeast-1)DOMAIN_NAME(defaults todfop.breindel.me)