Technical Documentation · Internal Use Only
GOALS: The Definition of Determination
GOALS · AWS Deployment Guide
Overview & Setup
Deployment Steps
Maintenance
Payment & Commerce
GOALS · AWS Deployment GuideThe GOALS website is a static site — HTML, CSS, JavaScript, and images. No backend server is required for content delivery. The AWS stack below delivers it globally at high speed with HTTPS, for approximately $2–6 per month.
| AWS Service | Purpose | Est. Monthly Cost |
|---|---|---|
| Amazon S3 | Stores and serves all HTML, CSS, JS, and image files | ~$0.02/mo |
| Amazon CloudFront | Global CDN — caches files at 400+ edge locations worldwide | ~$1–5/mo |
| AWS Certificate Manager | Free SSL/TLS certificate for HTTPS on your custom domain | Free |
| Amazon Route 53 | DNS management — connects your domain to CloudFront | ~$0.50/mo |
| AWS Lambda | Server-side Square payment processing | ~Free |
| API Gateway | HTTPS endpoint for Lambda payment handler | ~Free |
Total estimated AWS cost: $2–6/month for a fully hosted, global, HTTPS-enabled website with enterprise-grade CDN delivery and a serverless payment backend.
GOALS · AWS Deployment GuideBefore deploying, confirm you have the following ready. Missing any of these will block progress.
Important: SSL certificates for CloudFront must be created in the US East (N. Virginia) — us-east-1 region. This is an AWS requirement regardless of where your bucket is located.
GOALS · AWS Deployment GuideS3 is where all your website files live. Think of it as a cloud folder that AWS serves to visitors globally.
Go to console.aws.amazon.com → Search for S3 → Click "Create bucket"
Bucket name: Enter your exact domain name (e.g. goalsbook.com). The bucket name must match your domain exactly.
Block Public Access: Uncheck "Block all public access" — check the acknowledgment box. This allows CloudFront to access your files.
Click "Create bucket", then go to Permissions → Bucket Policy and paste:
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
}]
}Via AWS Console: Open your bucket → Click Upload → Add all .html files → Add css/ folder → Add images/ folder → Click Upload.
Via AWS CLI (faster): Navigate to your project folder in terminal and run:
# Sync entire project to S3 aws s3 sync . s3://goalsbook.com --delete
In your S3 bucket → Properties tab → scroll to Static website hosting → click Edit
Select Enable → Index document: index.html → Error document: index.html
Save changes → Copy the Bucket website endpoint URL shown (you'll need it for CloudFront)
Critical: Switch your AWS region to US East (N. Virginia) — us-east-1 before proceeding. This is required for CloudFront SSL certificates.
AWS Console → search Certificate Manager → Request a certificate → Request a public certificate
Add domain: goalsbook.com → Click Add another name → add www.goalsbook.com
Validation method: DNS validation → Click Request
If using Route 53: Click "Create records in Route 53" (automatic). Otherwise add the CNAME record to your registrar manually.
Wait 5–30 minutes for status to change to Issued
AWS Console → CloudFront → Create distribution
Origin domain: Paste your S3 website endpoint URL (from Step 3) — paste manually, do not use dropdown
Viewer protocol policy: Redirect HTTP to HTTPS
Alternate domain names: Add goalsbook.com and www.goalsbook.com
Custom SSL certificate: Select the certificate from Step 4
Default root object: index.html → Click Create distribution (takes 5–15 min)
Copy your CloudFront Domain Name (e.g. d1234abcdef.cloudfront.net) for the next step
If using Route 53: Route 53 → Hosted zones → your domain → Create record → Type A → Alias ON → Alias to CloudFront distribution → select your distribution. Repeat for www.
If using external registrar (GoDaddy, Namecheap): Add CNAME record: Name = www, Value = your CloudFront domain. For root domain, add an ALIAS/ANAME record pointing to CloudFront.
DNS propagation can take 15 minutes to 48 hours. Use dnschecker.org to verify propagation status.
https://goalsbook.com — homepage loads with book cover visiblehttp:// version — automatically redirects to HTTPSAll checks passing? Your site is live on AWS. Proceed to Section 13 for Square payment integration.
GOALS · AWS Deployment GuideWhen site files change, follow this two-step process to push updates live.
Upload updated files to S3 via Console or CLI:
aws s3 sync . s3://goalsbook.com --delete
Invalidate the CloudFront cache (required — otherwise visitors see old version):
aws cloudfront create-invalidation \ --distribution-id YOUR_DISTRIBUTION_ID \ --paths "/*"
Invalidations take 1–3 minutes to propagate. First 1,000 paths/month are free.
| Service | What You Pay For | Est. Monthly Cost |
|---|---|---|
| S3 Storage | Storing ~5MB of files | < $0.01 |
| CloudFront | 1,000–10,000 visitors/month | $1–5 |
| Route 53 | 1 hosted zone | $0.50 |
| ACM Certificate | SSL cert for HTTPS | Free |
| Lambda + API Gateway | Payment processing calls | ~Free |
Check S3 bucket policy is correctly set. Confirm "Block all public access" is OFF. Confirm index.html is set as default root object in CloudFront.
Create a CloudFront invalidation for /*. Wait 1–3 minutes, then hard refresh your browser (Ctrl+Shift+R / Cmd+Shift+R).
Confirm ACM certificate was created in us-east-1. Confirm status is Issued (not Pending) before attaching to CloudFront.
DNS changes take up to 48 hours. Use dnschecker.org to verify propagation. Confirm CloudFront alternate domain names include both root and www versions.
GOALS · AWS Deployment GuideAccept real credit card payments, process charges securely server-side, and deposit funds directly to your bank account — all using Square at 2.9% + $0.30 per online transaction with no monthly fee.
Why Square? No monthly fees, no setup fees, no contract. For a $19.99 paperback sale, Square keeps ~$0.88 — you receive ~$19.11. Funds deposit to your bank next business day.
Go to developer.squareup.com → Sign in or create a free account
Click + New Application → Name it "GOALS Book Website"
Go to Credentials tab — copy these three values:
# Square Credentials (save these securely) Application ID: sq0idb-XXXXXXXXXXXXXXXXXXXXXXXX ← used in browser (public) Access Token: EAAAl-XXXXXXXXXXXXXXXXXXXXXXXX ← Lambda ONLY (secret!) Location ID: LXXXXXXXXXXXXXXXXX ← from Locations tab
CRITICAL SECURITY RULE: The Access Token must NEVER appear in your HTML, CSS, or JavaScript files. It lives ONLY inside your AWS Lambda environment variables. The Application ID is safe to put in the browser.
Open order.html and find the CONFIGURATION block at the top of the script section. Replace the placeholder values:
// order.html — CONFIGURATION block const SQUARE_APP_ID = 'sq0idb-YOUR_ACTUAL_APP_ID'; const SQUARE_LOCATION_ID = 'LXXXXXXXXXXXXXXXXX'; const LAMBDA_ENDPOINT = 'https://abc123.execute-api.us-east-1.amazonaws.com/process-payment';
Switch the Square SDK script from sandbox to production:
<!-- SANDBOX (testing — current): --> <script src="https://sandbox.web.squarecdn.com/v1/square.js"></script> <!-- PRODUCTION (switch to this when live): --> <script src="https://web.squarecdn.com/v1/square.js"></script>
Install Square SDK and package for Lambda:
mkdir goals-payment-lambda && cd goals-payment-lambda cp /path/to/lambda/process-payment.js ./index.js npm init -y npm install square zip -r function.zip index.js node_modules/
AWS Console → Lambda → Create function with these settings:
Function name: goals-process-payment Runtime: Node.js 20.x Memory: 256 MB Timeout: 15 seconds Handler: index.handler
Upload function.zip → Go to Configuration → Environment variables and add:
SQUARE_ACCESS_TOKEN = EAAAl-YOUR_SECRET_ACCESS_TOKEN SQUARE_LOCATION_ID = LXXXXXXXXXXXXXXXXX SQUARE_ENVIRONMENT = sandbox ← change to 'production' when live ALLOWED_ORIGIN = https://yourdomain.com
AWS Console → API Gateway → Create API → Choose HTTP API
Add Integration → Lambda → select goals-process-payment → Route: POST /process-payment
Configure CORS:
Allow origins: https://yourdomain.com Allow methods: POST, OPTIONS Allow headers: Content-Type
Deploy → Copy the Invoke URL — paste this as LAMBDA_ENDPOINT in order.html:
https://abc1defg23.execute-api.us-east-1.amazonaws.com/process-payment# Square Sandbox Test Cards Visa (success): 4111 1111 1111 1111 Exp: any future · CVV: any 3 digits Mastercard (success): 5105 1051 0510 5100 Exp: any future · CVV: any 3 digits Card declined: 4000 0000 0000 0002 Insufficient funds: 4000 0000 0000 9995
In Square Developer Dashboard → switch app to Production mode → copy production Access Token and Application ID
Update Lambda env vars: SQUARE_ACCESS_TOKEN = production token, SQUARE_ENVIRONMENT = production
In order.html: update SQUARE_APP_ID to production ID, switch SDK script to web.squarecdn.com, delete sandbox notice div
Re-upload and invalidate cache:
aws s3 cp order.html s3://your-bucket-name/order.html aws cloudfront create-invalidation --distribution-id YOUR_CF_ID --paths "/order.html"
Bank Deposits: Set up your bank account in Square Dashboard → Account & Settings → Bank Accounts. Square deposits funds next business day. You'll receive an email breakdown of each deposit.
GOALS · AWS Deployment GuideEvery completed purchase automatically saves a full order record to the database. The Admin Dashboard at admin.html gives you a live view of all orders, buyers, revenue, and fulfillment status from any browser.
Navigate to: https://yourdomain.com/admin.html
Password updated to Goals2026!SD — already changed in admin.html and uploaded to S3. ✅
| Feature | What It Shows |
|---|---|
| Overview | Total revenue, books sold, order count, average order value — live |
| Sales by Format | Hardcover vs Paperback bar graph |
| Orders by Status | Pending / Paid / Shipped / Delivered breakdown |
| All Orders Table | Searchable, filterable by status and format |
| Order Detail Modal | Full buyer info, shipping address, Square payment ID, receipt link |
| Fulfillment Tools | Update order status, add tracking number, internal notes |
| Customers View | Every buyer: name, email, orders, books, total spent, city |
| CSV Export | Download all orders as a spreadsheet for accounting/shipping |
# Every order record stores:
order_number → GOALS-123456 (auto-generated)
first_name / last_name → Buyer name
email → Buyer email (Square receipt sent here)
phone → Buyer phone (optional)
format → Hardcover or Paperback
quantity → Number of copies ordered
unit_price → Price per copy
total_amount → Total charged (unit × qty)
signed_copy → none / signed / personalized
personalization → Inscription text
order_notes → Buyer additional notes
address_line1/city/state/zip/country → Full shipping address
status → pending / paid / processing / shipped / delivered / cancelled
payment_status → pending / completed / failed / refunded
square_payment_id → Square transaction ID
square_receipt_url → Link to buyer's Square receipt
tracking_number → Shipping tracking (added by you after shipping)
fulfillment_notes → Internal notes
shipped_at → Timestamp when marked shippedSecurity: For production, restrict admin.html access by IP whitelist via S3 bucket policy, or implement AWS Cognito authentication. Do not share the admin URL publicly.
GOALS · AWS Deployment GuideCombined AWS infrastructure costs plus Square payment processing fees per transaction.
| Service | Cost | Notes |
|---|---|---|
| S3 Storage | ~$0.03/mo | Site files (~5MB) at $0.023/GB |
| CloudFront CDN | ~$0.50–$2/mo | First 1TB free, then $0.085/GB |
| Route 53 DNS | $0.50/mo | Per hosted zone |
| ACM SSL Certificate | FREE | Free with CloudFront |
| Lambda (payment processor) | ~FREE | First 1M requests/mo free. 1,000 orders ≈ $0.002 |
| API Gateway | ~FREE | First 1M calls/mo free (HTTP API) |
| AWS TOTAL / MONTH | ~$1–$3 | At low to moderate traffic |
| Square — Paperback ($19.99) | ~$0.88/sale | 2.9% + $0.30 = $0.88 → you keep $19.11 |
| Square — Hardcover ($34.99) | ~$1.31/sale | 2.9% + $0.30 = $1.31 → you keep $33.68 |
| 100 Paperback Sales | $1,911 to you | $1,999 revenue − $88 Square fees |
Bottom line: Your entire website infrastructure costs approximately $1–$3 per month. For every 100 paperbacks sold at $19.99, you deposit $1,911 to your bank. No Amazon cut. No Barnes & Noble cut. No middlemen.
GOALS · AWS Deployment GuideComplete every item below before going live. Check each box as you confirm it is done. Do not launch until all 12 items are checked.
Goals2026!SD in admin.html ✅You're ready to launch. Once every box above is checked, the GOALS website is live, payments are processing, and every order is tracked automatically. Funds deposit to your bank the next business day. Check admin.html daily during launch week to monitor orders and mark shipments as you fulfill them.
Support Resources
console.aws.amazon.com/support
Square Support: squareup.com/help
AWS Docs: docs.aws.amazon.com
Square Docs: developer.squareup.com/docs