Installation
The easiest way to get started with Huuma is to use the Huuma CLI. Here's a step-by-step guide to creating your first project.
Prerequisites
Before you begin, ensure you have:
- Deno installed (version 2.1.0 or higher)
- A terminal or command prompt
- A code editor
Installing the Huuma CLI
First, install the Huuma CLI globally using Deno:
deno install -A -f -g -r -n huuma jsr:@huuma/cliThis command installs the Huuma CLI globally, making it available as the `huuma` command in your terminal.
This command installs the Huuma CLI globally, making it available as the huuma command in your terminal.
Creating a New Project
To create a new Huuma project, run:
huuma projectYou'll be prompted to provide a project name and select a project type:
Project name: my-huuma-app
Select the type of application to initialize:
---------------
0 - website
---------------Type 0 and press Enter to select the website template.
The CLI will create a new directory with your project name and set up a basic Huuma application structure:
my-huuma-app/
├── assets/
├── pages/
│ ├── page.tsx
│ ├── root.tsx
│ └── layout.tsx
├── src/
├── app.ts
├── dev.ts
└── deno.jsonProject Structure
assets/: Static files like images, CSS, and other assetspages/: Page components for your applicationpage.tsx: The main page componentroot.tsx: The root layout componentlayout.tsx: Shared layout component
src/: Application source code and utilitiesapp.ts: Main application entry pointdev.ts: Development server entry pointdeno.json: Deno configuration file with tasks and dependencies
Running Your Project
Navigate to your project directory and start the development server:
cd my-huuma-app
deno task devYour application will be available at http://localhost:8000.
The development server includes:
- Hot reloading: Changes are reflected immediately
- TypeScript compilation: Automatic type checking
- Error reporting: Clear error messages in the browser
Making Your First Changes
Edit the files in the pages/ directory to modify your application. For example, to modify the main page, edit pages/page.tsx:
import { JSX } from "@huuma/ui/jsx-runtime";
export default () => {
return (
<>
<main class="container mx-auto px-4 py-8">
<h1 class="text-4xl font-bold text-blue-600 mb-4">
Welcome to My Huuma App
</h1>
<p class="text-lg text-gray-600">
This is my first Huuma application! 🚀
</p>
<div class="mt-8">
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
Get Started
</button>
</div>
</main>
</>
);
};Building for Production
To build your application for production, run:
deno task bundleThis will generate optimized files for deployment with:
- Minified JavaScript and CSS
- Tree-shaken code
- Optimized assets
To start the production server:
deno task startAlternative Installation Methods
Using Existing Project
You can also add Huuma to an existing Deno project:
deno add @huuma/uiThen configure your deno.json:
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "@huuma/ui"
},
"imports": {
"@huuma/ui": "jsr:@huuma/ui@^0.1.0"
}
}Manual Setup
For more control, you can set up Huuma manually:
Create project structure:
mkdir my-huuma-app cd my-huuma-appInitialize deno.json:
{ "name": "my-huuma-app", "version": "1.0.0", "exports": "./app.ts", "tasks": { "dev": "deno run --allow-read --allow-net --allow-env --watch dev.ts", "start": "deno run --allow-read --allow-net --allow-env app.ts" }, "imports": { "@huuma/ui": "jsr:@huuma/ui@^0.1.0" }, "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "@huuma/ui" } }Create your entry files and start building!
Troubleshooting
Common Issues
Permission errors: Make sure you have the necessary permissions when running Deno commands:
deno run --allow-read --allow-net --allow-env your-file.tsModule not found:
Ensure your import map is correctly configured in deno.json
TypeScript errors:
Check that your jsxImportSource is set to @huuma/ui in the compiler options
Getting Help
- 📖 Check the Quick Start guide for step-by-step tutorials
- 🔧 Review Configuration for advanced setup options
- 💡 Browse Examples for practical usage patterns
- 🐛 Report issues on GitHub
Next Steps
Now that you have Huuma installed and running, explore these resources:
- Quick Start Guide - Build your first interactive component
- Configuration - Customize your development environment
- Examples - Learn from real-world usage patterns
- Component Library - Discover available UI components
- API Documentation - Deep dive into Huuma's APIs
Welcome to the Huuma ecosystem! 🎉