Skip to content

nnamtug/aws-sam-example-highscore-serverless

Repository files navigation

AWS SAM Example – High-Score Serverless Backend

This repository demonstrates how to set up a serverless leaderboard API using the AWS Serverless Application Model (SAM).
It provisions a fully managed backend with AWS Lambda, Amazon API Gateway, and Amazon DynamoDB — ideal for learning or testing AWS serverless architectures.

⚠️ Note: This project is not production-ready.
It’s an example for understanding the setup and deployment process, not a complete or optimized implementation.

Use it as a reference to explore infrastructure setup, CI/CD integration, or AWS SAM project structure for serverless applications.


Features

  • Store scores per user
  • Fetch a global leaderboard (top scores across all users)
  • Example scripts to build, deploy, seed, and query
  • Tear down resources when done

Prerequisites

Before you begin, make sure you have:


Installation & Deployment

  1. Check or change the target region in samconfig.toml

  2. Build the application:

    sam build
  3. Deploy the application:

    sam deploy
  4. Refresh local resource IDs (helps some helper scripts):

    ./refresh-resourceids.sh

Usage

  1. Hello World!
    ./run_hello_world.sh
  2. Get current leaderboard
    ./run_get_topscores.sh
  3. Create random scores
    ./run_create_scores.sh
  4. Check leaderboard again
    ./run_get_topscores.sh

Tear Down

When you’re done experimenting, clean up resources to avoid charges:

./delete-stack.sh

Notes

  • DynamoDB table and API Gateway are pay-per-request, but you may still incur small costs if left running.
  • The project is intentionally minimal and insecure (no authentication).
  • Use this as a sandbox to learn AWS SAM, not for production workloads.

About

Example AWS Serverless Application Model (SAM) high-score serverless backend — deploy a lambda-based leaderboard with AWS Lambda, API Gateway & DynamoDB.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors