Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor extensions in README; add simple Makefile #10

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

usage: ## Show usage for this Makefile
@cat Makefile | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'

deploy: ## Deploy the application to LocalStack
bin/deploy.sh

web: ## Open the Web app in the browser (after the app is deployed)
DOMAIN_NAME=$$(awslocal cloudfront list-distributions | jq -r '.DistributionList.Items[0].DomainName'); \
echo "CloudFront URL: https://$$DOMAIN_NAME"; \
open "https://$$DOMAIN_NAME"

save-state: ## Save the application state to a local file
localstack state export app-state.zip

load-state: ## Load the application state from a local file
localstack state import app-state.zip

clean: ## Clean up any temporary files
rm *.zip

.PHONY: usage deploy web save-state load-state clean
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Serverless Quiz App

This project showcases a fully serverless quiz application designed to demonstrate LocalStack's capabilities in supporting local cloud development, debugging, and testing throughout the entire software development lifecycle (SDLC). The application enables users to create quizzes, participate by submitting answers, and view leaderboards for top scores. It leverages various LocalStack features to highlight the platform's capabilities, including:
This project showcases a fully serverless quiz application designed to demonstrate LocalStack's capabilities in supporting local cloud development, debugging, and testing throughout the entire software development lifecycle (SDLC).
The application enables users to create quizzes, participate by submitting answers, and view leaderboards for top scores.
It leverages various LocalStack features to highlight the platform's capabilities, including:

- Emulating cloud environments locally with **Core Cloud Emulator**.
- Utilizing **Resource Browsers** for inspecting local resources.
Expand Down Expand Up @@ -29,12 +31,16 @@ The following resources are being deployed:
- **CloudFront**: Delivers frontend assets from S3 globally for fast user access.
- **S3**: Hosts static frontend assets in `webapp` bucket for CloudFront distribution.

## Prerequisites

Some of the features in this sample app require a LocalStack Pro license - make sure your Auth Token is configured in your terminal session.

## Start LocalStack

Start your LocalStack container with the following configuration:

```bash
EXTRA_CORS_ALLOWED_ORIGINS=* DISABLE_CUSTOM_CORS_APIGATEWAY=1 localstack start
EXTRA_CORS_ALLOWED_ORIGINS='*' DISABLE_CUSTOM_CORS_APIGATEWAY=1 DISABLE_CUSTOM_CORS_S3=1 localstack start
```

If you run into specific CORS issues, disable it using a [browser extension](https://webextension.org/listing/access-control.html).
Expand Down
Empty file modified bin/deploy.sh
100644 → 100755
Empty file.
Loading