To clone and run this application, you'll need Git and Mise installed on your computer.
From your command line:
git clone https://github.com/JamBalaya56562/blog.gitcd blog && bun iThis project uses DynamoDB for page view tracking. A container runtime is required — wslc is used when available, otherwise Docker. Set RUNTIME to force one.
# Start DynamoDB Local in the background and create the table
mise daemons start dbThe db daemon is declared in [daemons] in mise.toml; mise hands the
container to pitchfork and returns once the table
exists. To watch the database's own log instead, run it in the foreground and
stop it with Ctrl-C:
# Run DynamoDB Local (amazon/dynamodb-local) in the foreground
mise run db:startThe rest of the steps stand on their own:
# Create the DynamoDB table if it does not exist
mise run db:push
# Dump every page view row as JSON
mise run db:scan
# Stop DynamoDB Local container
mise run db:stopThe container runs -inMemory, so view counts reset when it stops.
The endpoint, region and table name come from [env] in mise.toml, so there
is nothing to generate and nothing to copy from an example file. Override them
for one machine in mise.local.toml, which is not committed.
No AWS access keys are needed. The local container accepts any signature, and on AWS the credentials come from the Lambda execution role.
Both daemons are declared in [daemons] in mise.toml; mise registers them with
pitchfork, which runs them in the background:
# Start DynamoDB Local, then the dev server once the table is ready
mise daemons start dev
# Start DynamoDB Local on its own
mise daemons start db
# Watch the output, then stop both again
mise daemons logs -f dev
mise daemons stop dev dbThe dev daemon depends on db, so it waits for the table rather than racing
it. Stopping db stops the container. This is also the server the committed
.claude/launch.json attaches the Claude Code browser preview to; it starts
nothing of its own.
To run the dev server in the foreground instead, start the database first and then:
bun devEvery page waits on the database, so bun dev against a stopped container
stalls rather than fails.
bun test:unitmise e2emise e2e builds first, because Playwright serves the build with bun start,
and brings DynamoDB Local up through the db daemon. A daemon that is already
running is reused; a blog-dynamodb container started outside it — mise run db:start in another terminal — is replaced rather than reused, because
db:start cannot tell a live container from one an interrupted run left behind.
Run bun test:e2e directly when the build and the database are already up.
bun lint:fixbun run buildbun startDevelopment values live in [env] in mise.toml and are applied to anything
run from this directory. On AWS they come from the Lambda function's own
configuration instead — see lambda.tf.
| Variable | Description | Default |
|---|---|---|
DYNAMODB_TABLE_NAME |
DynamoDB table name. Unset disables view tracking | blog-page-views |
DYNAMODB_ENDPOINT |
DynamoDB endpoint override. Set for local development only | - |
AWS_REGION |
AWS region | ap-northeast-1 |
CONTENT_SOURCE |
Content source ("local" or "github") |
"local" |
GITHUB_OWNER |
GitHub repository owner | - |
GITHUB_REPO |
GitHub repository name | - |
GITHUB_BRANCH |
GitHub branch name | "main" |
GITHUB_CONTENT_PATH |
Root path for content in the repository | "content" |
Visual Studio Code is the recommended IDE for working on this project, as it has been configured.
Once opening, you can run Extensions: Show Recommended Extensions to install the recommended extensions for good development is automatically configured.
A dev container is a running container with a well-defined tool/runtime stack and its prerequisites.
You can try out dev containers with GitHub Codespaces or Visual Studio Code Dev Containers.
GitHub Codespaces
GitHub Codespaces is a cloud-based development environment that allows you to work on this project directly in your browser.
You can click the badge above or here to get started.
Follow these steps to open this project in a Codespace:
- Click the Code drop-down menu.
- Click on the Codespaces tab.
- Click Create codespace on main.
For more info, check out the GitHub documentation.
VSCode Dev Containers
Follow these steps to open this project in a container using the VSCode Dev Containers extension:
-
If this is your first time using a dev container, please ensure your system meets the pre-reqs (i.e. have Docker installed) in the getting started steps.
-
To use this repository, open a locally cloned copy of the code:
- Clone this repository to your local filesystem.
- Press F1 and select the Dev Containers: Open Folder in Container... command.
- Select the cloned copy of this folder, wait for the container to start, and try things out!
Want to report a bug, contribute some code, or improve the documentation? Excellent!
Read up on our guidelines for contributing and Code of Conduct.
Then check out one of our issues labeled as 😵💫help wanted or good first issue.
This software uses the following open source packages:
- Amazon DynamoDB
- AWS Lambda Web Adapter
- AWS SDK for JavaScript
- Biome
- Bun
- HAPPY DOM
- Mise
- Next.js
- Node.js
- Playwright
- React
- Tailwind CSS
- TypeScript
The MIT License Copyright (c) 2023-2026 JamBalaya56562. Please have a look at the LICENSE for more details.