This is a demonstration & sample application designed to be a full-stack web app (API + frontend but using no front-end frameworks).
It provides persistent web access to a simple product inventory.
It is built on several Azure technologies, including: Functions, Static Web Apps and CosmosDB .
The infrastructure is defined in infra/main.bicep
and can be deployed using the provided Makefile:
cd infra
make
# This will create a resource group, Cosmos DB account, database, container, and a Static Web App.
You can check deployment status and outputs:
make status
make outputs
To clean up Azure resources:
make clean
- Add Github secret:
AZURE_STATIC_WEB_APPS_API_TOKEN
- Manually trigger pipeline
Azure Static Web Apps CI/CD
or push some code to the repository connected to Azure Static Web Apps. As last option use Azure Portal to link your repo and trigger deployment. The Static Web App will be built and deployed automatically.
Use the Jupyter notebook in the notebook/
folder to seed sample data into Cosmos DB:
- Build and run the notebook container:
cd notebook docker compose up # Or run Jupyter Lab locally python3 -m pip install jupyterlab jupyter lab
- Open
cosmicsworks.ipynb
in Jupyter Lab. - Follow the notebook steps to:
- Authenticate to Azure
- Create Cosmos DB resources (if not already created)
- Configure Spark/Cosmos connection
- Create database and containers
- Ingest sample product data
- Query and validate data
- The API src/shared/context.js expects Cosmos DB endpoint and credentials to be set in environment variables (see Bicep outputs and Static Web App settings).
- The notebook can be used for both initial seeding and further data exploration.
- For more details, see the documentation in the notebook/README.md.