Skip to content

CaravelLabs/AzureCosmosDB-Next.js-Starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Azure Cosmos DB Starter – Todo App

A simple Todo App built on Next.js and Azure Cosmos DB.

Environment Setup Instructions

Pre requisites

Azure Cosmos DB account, database and container. Please make sure the Partition Key for container is '/id'.

Getting Started Steps

  • Install dependencies from the root folder - npm install

  • Rename sample.env to .env and set appropriate variables.

    • COSMOSDB_ENDPOINT: This is the connection endpoint for the database.
    • COSMOSDB_KEY : This is the connection key for the database.
    • COSMOSDB_DATABASE_NAME : This is the name of the database to store todos.
    • COSMOSDB_CONTAINER_NAME : This is the name of the container to store todos.

You can obtain the connection string by navigating to your Azure Cosmos DB account page's key blade, and select Primary connection string. Copy the value to use.

  • Start the project - npm run dev


Technical Documentation

Tech Stack

Name Description
Next.js React framework
Azure Cosmos DB NoSQL database service in Azure
Azure App Service App Hosting PaaS
Chakra UI Simple, Modular & Accessible UI Components for your React Applications

Folder Structure

.
├── components
│   ├── AddTodo.js
│   ├── Layout.js
│   ├── Todo.js
│   └── Todos.js
├── pages
│   ├── _app.js
│   ├── index.js
│   └── todos
│       └── [id].js
├── public
│   └── favicon.ico
├── .env
├── .gitignore
├── README.md
├── package-lock.json
├── package.json
└── server.js

High Level Technical Architecture


Cost to host in Azure

Official estimate from Azure Pricing Calculator - Azure Pricing Calculator

Service Category Service Type Description Estimated Monthly Cost Estimated Upfront Cost
Compute Azure App Service Basic Tier; 1 B1 (1 Core(s), 1.75 GB RAM, 10 GB Storage) x 730 Hours; Linux OS; 0 SNI SSL Connections; 0 IP SSL Connections; 0 Custom Domains; 0 Standard SLL Certificates; 0 Wildcard SSL Certificates $12.41 $0
Database Azure Cosmos DB Azure Cosmos DB for NoSQL (formerly Core), Serverless, Always-free quantity disabled, Single Region Write (Single-Master) - East US (Write Region), 4 million RUs, 5 GB transactional storage, 2 copies of periodic backup storage, Dedicated Gateway not enabled $2.25 $0
Developer Tools Azure DevOps Basic Plan; 5 User(s) $0 $0
Total $14.66 $0

Disclaimer: The above cost is an estimate and may vary based on the actual usage. Caravel Labs or Microsoft is not responsible for additional costs incurred.

Template Codebase inspired from Azure's CosmosDB Starter Repo

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published