Skip to content

nosdav/create-nosdav

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

create-nosdav

Create NosDav profiles and apps with unlimited templates from the community ecosystem.

Quick Start

# Create a new profile
npx create-nosdav init my-profile

# Create apps with built-in templates
cd my-profile
npx create-nosdav app todo --template preact-todo
npx create-nosdav app dashboard --template dashboard

# Use community templates from GitHub
npx create-nosdav app auth-app --template github:nosdav/preact-auth-starter
npx create-nosdav app blog --template gh:user/[email protected]

Features

πŸš€ Unlimited Templates - Access thousands of community templates from any Git repository βš›οΈ Modern Development - Preact, HTM, and ES modules with no build step required
πŸ“ Multi-File Support - Templates can include multiple components, utilities, and assets πŸ’Ύ Smart Caching - Templates cached locally for fast repeated use 🎯 Simple Workflow - No transpilers, bundlers, or complex tooling πŸ”— NosDav Integration - Apps automatically register in your profile's type index

Template Sources

Built-in Templates

npx create-nosdav list
  • basic - Simple static HTML app
  • crud - CRUD operations with localStorage
  • dashboard - Analytics dashboard with live stats
  • preact-todo - Modern todo app with Preact & HTM

Community Templates (Git Repositories)

GitHub Shortcuts:

# GitHub shorthand
npx create-nosdav app my-app --template github:user/template-repo
npx create-nosdav app my-app --template gh:user/repo

# With specific version/branch
npx create-nosdav app my-app --template github:user/[email protected]
npx create-nosdav app my-app --template github:user/repo@main

Full Git URLs:

# Any Git repository
npx create-nosdav app my-app --template https://github.com/user/template.git
npx create-nosdav app my-app --template https://gitlab.com/user/template.git
npx create-nosdav app my-app --template [email protected]:user/repo.git

Commands

init [name]

Initialize a new NosDav profile with decentralized identity structure.

npx create-nosdav init my-profile
cd my-profile

Options:

  • -d, --dir <directory> - Target directory (default: current)

Creates:

  • Profile metadata (index.json)
  • Public type index (settings/publicTypeIndex.json)
  • Directory structure for apps and data
  • Crypto-secure identity keys

app <name>

Create a new app from any template source.

# Built-in templates
npx create-nosdav app todo --template preact-todo
npx create-nosdav app dashboard --template dashboard

# Community templates  
npx create-nosdav app auth --template github:nosdav/auth-starter
npx create-nosdav app blog --template https://github.com/user/blog.git@v2

Options:

  • -t, --template <template> - Template source (local name, github:user/repo, git URL)
  • -d, --dir <directory> - Profile directory (default: current)

list

List available built-in templates.

npx create-nosdav list

Multi-File Templates

Templates can include multiple files for complex applications:

templates/preact-todo/
β”œβ”€β”€ index.html          # Entry point with imports
β”œβ”€β”€ components.js       # Preact components  
β”œβ”€β”€ utils.js           # Utilities and helpers
└── styles.css         # Optional styles

Example multi-file app:

npx create-nosdav app todos --template preact-todo

Creates:

public/apps/todos/
β”œβ”€β”€ app.json           # App metadata
β”œβ”€β”€ index.html         # HTML entry point
β”œβ”€β”€ components.js      # TodoApp component
β”œβ”€β”€ utils.js          # Storage utilities
└── assets/           # Static resources

Profile Structure

my-profile/
β”œβ”€β”€ index.json              # Profile identity & metadata
β”œβ”€β”€ index.html              # Profile homepage  
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ apps/               # Your applications
β”‚   β”‚   β”œβ”€β”€ todo/           # Multi-file app
β”‚   β”‚   β”‚   β”œβ”€β”€ index.html
β”‚   β”‚   β”‚   β”œβ”€β”€ components.js
β”‚   β”‚   β”‚   └── utils.js
β”‚   β”‚   └── dashboard/      # Single-file app
β”‚   β”‚       └── index.html
β”‚   β”œβ”€β”€ images/             # Profile assets
β”‚   └── todo/               # Default data storage
└── settings/
    └── publicTypeIndex.json # App & data registry

App Registration

Apps are automatically registered in your profile's type index for discoverability:

{
  "type": "TypeRegistration",
  "forClass": "WebApp", 
  "instance": "../public/apps/todo/app.json",
  "registeredWith": "../public/apps/todo/"
}

Template Caching

Git templates are cached locally for performance:

~/.create-nosdav/cache/
β”œβ”€β”€ a1b2c3d4e5f6.../     # github:user/repo@main
└── f6e5d4c3b2a1.../     # github:user/[email protected]

Cache behavior:

  • First use: Clone from Git repository
  • Subsequent uses: "Using cached template"
  • Different branches/tags create separate cache entries
  • Automatic cleanup removes .git directories

Creating Templates

Simple Template (Single File)

my-template/
└── index.html          # Template with {{variables}}

Advanced Template (Multi-File)

my-template/
β”œβ”€β”€ index.html          # Entry point
β”œβ”€β”€ components.js       # Reusable components
β”œβ”€β”€ utils.js           # Shared utilities  
β”œβ”€β”€ styles.css         # Styling
└── assets/            # Static resources
    └── logo.png

Variable substitution:

<title>{{title}}</title>
<h1>Welcome to {{name}}</h1>

Template Repository

Share templates by creating a Git repository:

# Create template repo
git init my-awesome-template
# Add template files
git add .
git commit -m "Initial template"
git push origin main

# Others can use it
npx create-nosdav app cool-app --template github:yourname/my-awesome-template

Community Ecosystem

Discover Templates:

  • Browse GitHub topics: nosdav-template, create-nosdav-template
  • Check community showcases and examples
  • Share your own templates with the community

Template Ideas:

  • Authentication systems with various providers
  • Dashboard templates for different use cases
  • E-commerce storefronts
  • Blog and content management
  • Real-time chat applications
  • Data visualization tools

Development

Local Development:

git clone https://github.com/nosdav/create-nosdav.git
cd create-nosdav
npm install
npm link

# Test locally
create-nosdav init test-profile
cd test-profile
create-nosdav app demo --template preact-todo

Template Testing:

# Test local template
create-nosdav app test --template ./path/to/template

# Test Git template  
create-nosdav app test --template github:user/repo@branch

Advanced Usage

Template with specific branch:

npx create-nosdav app app1 --template github:user/repo@feature-branch
npx create-nosdav app app2 --template github:user/[email protected]

Private repositories:

# Using SSH (requires Git credentials)
npx create-nosdav app private --template [email protected]:user/private-template.git

# Using HTTPS with token (set in Git config)  
npx create-nosdav app private --template https://github.com/user/private-repo.git

Multiple profiles:

npx create-nosdav init work-profile --dir ~/work
npx create-nosdav init personal-profile --dir ~/personal

# Create apps in specific profiles
npx create-nosdav app project --template github:company/template --dir ~/work/work-profile

Requirements

  • Node.js 16+
  • Git (for community templates)
  • Modern web browser (for running apps)

License

MIT


Ready to build the decentralized web? πŸš€

Start with npx create-nosdav init my-profile and explore the unlimited template ecosystem!

About

create nosdav app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •