Table of Contents

Chapter 8: Implementation

"Hongik Ingan: Clear APIs enable everyone to build on the WIA foundation."

8.1 Installation

NPM Installation
================

npm install @anthropic/wia-home

Or with yarn:
yarn add @anthropic/wia-home

Or with pnpm:
pnpm add @anthropic/wia-home


Basic Setup
===========

import { WIAHome } from '@anthropic/wia-home';

// Create home
const home = new WIAHome({
  name: 'My Shop',
  domain: 'myshop.wia.shop'
});

// Start server
await home.start();

console.log('Live at:', home.domain);


Configuration Options
=====================

const home = new WIAHome({
  // Basic
  name: 'My Shop',
  domain: 'myshop.wia.shop',

  // Server
  server: {
    port: 'auto',
    maxConnections: 100,
    sleepMode: true,
    sleepAfter: 5  // minutes
  },

  // Features
  features: {
    shop: true,
    blog: true,
    booking: true
  },

  // Security
  security: {
    ddos: { rateLimit: 100 },
    waf: { sqlInjection: true, xss: true }
  },

  // Low spec mode
  lowSpecMode: {
    limits: {
      maxMemory: 256,
      maxCpu: 20
    }
  }
});

8.2 Core API

WIAHome Class
=============

// Static methods
WIAHome.analyze(url)      // Analyze site
WIAHome.clone(url, opts)  // Clone site
WIAHome.quickStart(opts)  // Quick start
WIAHome.fromIntent(text)  // Intent-based
WIAHome.fromTemplate(id)  // From template
WIAHome.migrate(config)   // Migration


Instance Methods
================

// Server control
home.start()              // Start server
home.stop()               // Stop server
home.restart()            // Restart

// Status
home.status               // 'running' | 'stopped'
home.domain               // 'myshop.wia.shop'
home.uptime               // seconds


Properties
==========

// Statistics
home.stats.visitors       // Visitor counts
home.stats.pageViews      // Page view counts
home.stats.orders         // Order counts

// Resources
home.resources.cpu        // CPU usage %
home.resources.memory     // Memory usage bytes
home.resources.bandwidth  // Bandwidth stats


Events
======

home.on('server_started', callback)
home.on('server_stopped', callback)
home.on('visitor_connected', callback)
home.on('page_viewed', callback)
home.on('order_received', callback)
home.on('booking_received', callback)
home.on('security_alert', callback)
home.on('error', callback)

8.3 Content API

Pages
=====

// Create
await home.pages.create({
  title: 'About',
  slug: 'about',
  content: '# About Us\n\nWe are...'
});

// Read
const page = await home.pages.get('about');

// Update
await home.pages.update('about', {
  content: '# About Us\n\nUpdated content...'
});

// Delete
await home.pages.delete('about');

// List
const pages = await home.pages.list();


Blog
====

// Create post
await home.blog.createPost({
  title: 'First Post',
  content: 'Hello world...',
  tags: ['news']
});

// List posts
const posts = await home.blog.listPosts({
  tag: 'news',
  limit: 10
});

// Update post
await home.blog.updatePost(postId, {
  content: 'Updated...'
});


Media
=====

// Upload
const media = await home.media.upload(file);

// List
const mediaList = await home.media.list();

// Delete
await home.media.delete(mediaId);

// Optimize
await home.media.optimize(mediaId);

8.4 Shop API

Products
========

// Add product
await home.shop.addProduct({
  name: 'Chocolate Cake',
  price: 35000,
  description: 'Rich chocolate...',
  images: [imageRef],
  inventory: 10
});

// List products
const products = await home.shop.listProducts();

// Update product
await home.shop.updateProduct(productId, {
  price: 38000
});

// Remove product
await home.shop.removeProduct(productId);


Payment
=======

// Configure payment
home.shop.setPayment({
  korean: {
    kakaoPay: true,
    naverPay: true
  },
  bankTransfer: {
    enabled: true,
    accounts: [...]
  }
});


Orders
======

// List orders
const orders = await home.shop.orders.list({
  status: 'pending'
});

// Update status
await home.shop.orders.updateStatus(
  orderId, 'shipped'
);

// Process refund
await home.shop.orders.refund(orderId, {
  amount: 35000,
  reason: 'Customer request'
});

8.5 Booking API

Setup
=====

home.booking.setup({
  availability: {
    days: ['mon', 'tue', 'wed', 'thu', 'fri'],
    hours: { start: '09:00', end: '18:00' },
    slotDuration: 30
  },
  services: [
    { name: 'Consultation', duration: 30, price: 0 },
    { name: 'Full Service', duration: 60, price: 50000 }
  ]
});


Bookings
========

// Get available slots
const slots = await home.booking.getAvailableSlots({
  date: '2025-12-20',
  serviceId: 'consultation'
});

// List bookings
const bookings = await home.booking.list({
  date: '2025-12-20'
});

// Confirm booking
await home.booking.confirm(bookingId);

// Cancel booking
await home.booking.cancel(bookingId, {
  reason: 'Customer request',
  notifyCustomer: true
});


Notifications
=============

home.booking.setNotifications({
  newBooking: {
    channels: ['kakao', 'sms'],
    toOwner: true,
    toCustomer: true
  },
  reminder: {
    channels: ['kakao'],
    beforeHours: 24
  }
});

8.6 TypeScript Support

Full Type Definitions
=====================

import {
  WIAHome,
  WIAHomeConfig,
  Product,
  Order,
  Booking,
  Page,
  BlogPost,
  MediaRef,
  Theme
} from '@anthropic/wia-home';

// All methods fully typed
const home = new WIAHome({
  name: 'My Shop'
});

// Type-safe operations
const product: Product = await home.shop.addProduct({
  name: 'Item',
  price: 10000,
  // TypeScript checks all fields
});


Type Examples
=============

interface WIAHomeConfig {
  name: string;
  domain?: WIADomain;
  server?: Partial;
  features?: {
    shop?: boolean;
    blog?: boolean;
    booking?: boolean;
  };
  // ...
}

interface Product {
  id: ProductId;
  name: string;
  price: number;
  currency: string;
  description: string;
  images: MediaRef[];
  inventory: number;
  // ...
}

8.7 Mobile Support

Mobile Hosting
==============

Your smartphone can be the server too!

import { WIAHomeMobile } from '@anthropic/wia-home/mobile';

const home = new WIAHomeMobile({
  batteryAware: true,
  wifiOnly: true,
  backgroundMode: true
});

await home.start();


Battery Optimization
====================

Mobile-specific features:
  [OK] Run only on WiFi
  [OK] Pause on low battery
  [OK] Background execution
  [OK] Wake on request


React Native
============

import { WIAHomeRN } from '@anthropic/wia-home/react-native';

// Same API, mobile optimized
const home = new WIAHomeRN({
  name: 'My Mobile Shop'
});

Conclusion

WIA-HOME provides a complete platform for creating your own website without any hosting costs. From P2P networking to e-commerce to security, everything is built-in and easy to use.

Following the Hongik Ingan philosophy, WIA-HOME ensures that everyone - from small bakeries to freelancers to students - can have their own digital home, forever free from platform dependency.

The Promise of WIA-HOME:

1. No landlord - Your PC is the server
2. Forever yours - Platform-independent
3. Zero cost - Free hosting forever
4. Simple - 5 minutes to launch
5. Secure - Family guards your home

A sturdy fence for the WIA family,
A home that stands against any storm.

- WIA-HOME -

Chapter Summary


Previous: Chapter 7 - Security | Return to Table of Contents