This template provides a minimal setup to get started with Svelte.
A combination of Docker and Kubernetes are used to replicate a production-like environment locally. This improves the developer experience, as the developer can be confident that the functionality being developed locally will seamlessly integrate into production environments.
Docker is utilized to ensure that deployed resources are ephemeral as development is being conducted. This ensures that current development will be independent and unaffected by previous development.
Kubernetes is used to best replicate a production-like environment locally, if the application is to be deployed into K8s. MicroK8s is utilized as a wrapper to kubectl for a much smoother development experience.
Rapid development within this template revolves around the provided scripts within the scripts/
directory.
Script | Description |
---|---|
scripts/build.sh | Installs dependencies and builds new Docker images after code changes. |
scripts/deploy.sh | Spins up new containers and a test database. |
scripts/teardown.sh | Tears down existing resources. |
scripts/purge.sh | Cleans up existing containers and start from a clean, pristine state. |
The project is split across two tiers, a frontend and a database. The frontend directory contains a React project scaffolded by Remix. The db directory contains a Postgres database that is seeded on startup with the contents of the dump.sql
file.
The deployment of these two tiers is managed by Docker Compose via the configuration in docker-compose.yml
.
- Make changes to either the frontend or database. Execute the build script to generate new Docker images containing the changes.
# Build
scripts/build.sh
- Once new Docker images are available, they can be deployed via Docker Compose.
# Deploy
scripts/deploy.sh
- Tear down existing resources to make room for future changes.
# Teardown
scripts/teardown.sh
- To purge existing containers and get back to a pristine state, the purge script will clean up existing Docker images.
# Purge
scripts/purge.sh