Tarot Card Shuffle Draw is a free and open-source project that shuffles and returns a selection of Tarot cards. Users can choose different decks, specify the number of cards to draw, and include reversed cards in the draw. Public domain illustrations of the cards are presented with the results. This port of the application is deployed as AWS Lambda microservices orchestrated with API Gateway and backed with S3 and CloudFront. There are other ports available - see Alternative Deployment Ports below. You have a choice of deploying with or without a preassigned 'proper DNS' Route 53 entry and TLS certificate.
- Deck Options: Full Deck, Major Arcana only, Minor Arcana only.
- Reversed Cards: Option to include reversed cards in the draw.
- Random Draw: Utilizes high-quality randomness using
crypto/rand
. - Web Interface: User-friendly web interface for easy interaction.
- Microservice architecture: Separate functions for each API.
- AWS CLI configured with necessary permissions.
- AWS SAM CLI installed.
- GoLang installed.
-
Build and Deploy the SAM Application:
By default a predefined DNS entry is required. If you don't want this, see alternative below.
Example command:
sam build && sam deploy \
--stack-name TarotCardDrawApp \
--capabilities CAPABILITY_IAM \
--region eu-west-2 \
--resolve-s3 \
--parameter-overrides ParameterKey=DomainName,ParameterValue=$DOMAINNAME \
ParameterKey=HostedZoneId,ParameterValue=$HOSTEDZONEID
OR
-
Build and Deploy the SAM Application without a pre-assigned DNS entry:
Unfortunately, as at August 2024, there appears to be a bug with SAM that means that using the command flag
--template-file
to specify a template named something other than the defaulttemplate.yaml
means that the source code and assets are uploaded rather than the built binaries and assets for the lambdas. If you wish to deploy without a preassigned DNS entry then you should rename/move the providedtemplate.yaml
and change the name oftemplate-no-domain.yaml
totemplate.yaml
. You can then deploy without the parameter-overrides above, e.g.
sam build && sam deploy \
--stack-name TarotCardDrawApp \
--capabilities CAPABILITY_IAM \
--region eu-west-1 \
--resolve-s3
Then
-
Upload Images to S3:
If you are on a 'nix system you can use the provided script to upload images.
sh dev_tooling/images_to_s3.sh
-
Invalidate CloudFront Cache:
Invalidate the CloudFront cache to ensure updated content is served. If you are on a 'nix system you can use the provided script:
sh dev_tooling/cloudfront-invalidation.sh
Service endpoint will be available at the output ApiUrl
and additionally at the preassigned DNS entry if provided.
- Choose the deck type: Select Full Deck, Major Arcana only, or Minor Arcana only.
- Select reversed cards option: Decide whether to include reversed cards.
- Specify the number of cards to draw.
- Click "Draw Cards" to see the results.
- GET /: Displays the options page.
- POST /draw: Handles drawing cards based on user input.
- GET /license: Displays the license page.
To delete the deployed stack and associated resources:
Make sure the image bucket is empty and then:
sam delete --stack-name TarotCardDrawApp --region "$AWS_REGION"
There is a cross platform command line port (sorry, no illustrations!) available with binaries packaged for various operating systems - see tarot-card-shuffle-draw
There is a dockerised port with accompanying Helm chart that can be run in plain docker or installed on Kubernetes - see tarot-card-shuffle-draw-web.