Skip to content

Quick Start Guide

Get started with Alternate Futures in minutes. This guide will walk you through your first deployment to decentralized infrastructure.

What You'll Learn

By the end of this guide, you'll have:

  • Installed the Alternate Futures CLI
  • Authenticated with the platform
  • Deployed your first site to IPFS
  • Understood the basics of decentralized deployment

Time to complete: 5-10 minutes

Prerequisites

Before you begin, make sure you have:

  • An Alternate Futures account - Sign up here (free, no credit card required)
    • You can sign in with email, Google, GitHub, or a Web3 wallet
  • Node.js 18 or later - Download here if you don't have it
    • Check your version with node --version
  • A project to deploy (optional for learning)
    • Any static site (HTML, CSS, JavaScript)
    • Built output folder (usually dist, build, or public)
    • Don't have one? We'll create a simple example below

Using the Web App

Coming Soon

The web application is currently in development. In the meantime, you can use the CLI or SDK to access the full platform.

Installation

bash
# Install the CLI globally
npm install -g @alternatefutures/cli
bash
# Install the SDK in your project
npm install @alternatefutures/sdk

Step 2: Authenticate

There are two ways to authenticate with Alternate Futures:

bash
# Login interactively
af login

This will open your browser where you can sign in with:

  • Email (magic link - no password needed)
  • Google account
  • GitHub account
  • Web3 wallet (MetaMask, Coinbase Wallet, etc.)

After signing in, the CLI automatically saves your credentials. You're ready to deploy!

If you prefer API keys or need to automate deployments:

  1. Visit https://app.alternatefutures.ai/api-keys
  2. Click "Create New Key"
  3. Give it a name (e.g., "My Development Key")
  4. You will be presented with options for setting permissions on your key:
    • If you're going through the tutorials, choose "All" for full access
    • For security purposes in production, limit permissions to only necessary functions for its use (e.g., sites:write for deployments only)
  5. Copy the key (it starts with af_...)
  6. Set it as an environment variable:
bash
# Set API key as environment variable
export AF_API_KEY=af_your_key_here

# Or add to your .bashrc/.zshrc for persistence
echo 'export AF_API_KEY=af_your_key_here' >> ~/.bashrc
typescript
import { AlternateFuturesSdk } from '@alternatefutures/sdk';

// Initialize with API key
const af = new AlternateFuturesSdk({
  apiKey: process.env.AF_API_KEY
});

Security Best Practices

Never commit API keys to version control. Here's why and how to keep them safe:

What are environment variables? Environment variables store sensitive information (like API keys) outside your code files. This keeps secrets safe and lets you use different keys in development vs. production.

How to use them:

  1. Store your key in a .env file:
    AF_API_KEY=af_your_key_here
  2. Add .env to your .gitignore file so Git doesn't track it
  3. Your code reads from process.env.AF_API_KEY instead of hardcoding the key

Why this matters:

  • If you commit keys to Git, they're visible in your repository history forever
  • Anyone with access to your repo could steal your keys and rack up charges on your account
  • .gitignore tells Git to ignore certain files (like .env) when committing

New to these concepts?

Troubleshooting Authentication

"Command not found: af"

  • Make sure you installed the CLI: npm install -g @alternatefutures/cli
  • Try restarting your terminal
  • Check installation with npm list -g @alternatefutures/cli

"Login failed" or browser doesn't open

"Invalid API key"

  • Double-check you copied the entire key (starts with af_)
  • Make sure there are no extra spaces
  • Generate a new key if needed

Step 3: Deploy Your First Site

Now for the exciting part—deploying to decentralized infrastructure!

What does "deploy" mean? Deployment is the process of uploading your website files to a server so others can access them online. You'll upload to a decentralized network where your files are distributed across many computers worldwide, instead of using a traditional server (like AWS or a web hosting company).

Why is this different?

  • Traditional hosting: Your site lives on one company's servers. If they go down or delete your account, your site disappears.
  • Decentralized hosting: Your site is stored across hundreds of independent computers. No single company controls it, so it can't be taken down.

What you'll need: Just your website files in a folder (called the "build output" or "dist folder").

Don't Have a Site Ready?

No problem! You have two options:

We provide ready-to-deploy templates for popular frameworks. Choose one that fits your project:

React (Vite)

bash
# Clone the React template
git clone https://github.com/alternatefutures/template-react my-site
cd my-site

# Install dependencies
npm install

# Build for production
npm run build

# Deploy (build output is in ./dist)
af sites deploy ./dist --network ipfs

Template Repository | React Docs | Vite Docs

Next.js (Static Export)

bash
# Clone the Next.js template
git clone https://github.com/alternatefutures/template-nextjs my-site
cd my-site

# Install dependencies
npm install

# Build static export
npm run build

# Deploy (build output is in ./out)
af sites deploy ./out --network ipfs

Template Repository | Next.js Docs

Vue.js (Vite)

bash
# Clone the Vue template
git clone https://github.com/alternatefutures/template-vue my-site
cd my-site

# Install dependencies
npm install

# Build for production
npm run build

# Deploy (build output is in ./dist)
af sites deploy ./dist --network ipfs

Template Repository | Vue.js Docs | Vite Docs

Astro

bash
# Clone the Astro template
git clone https://github.com/alternatefutures/template-astro my-site
cd my-site

# Install dependencies
npm install

# Build for production
npm run build

# Deploy (build output is in ./dist)
af sites deploy ./dist --network ipfs

Template Repository | Astro Docs

SvelteKit (Static Adapter)

bash
# Clone the SvelteKit template
git clone https://github.com/alternatefutures/template-sveltekit my-site
cd my-site

# Install dependencies
npm install

# Build static export
npm run build

# Deploy (build output is in ./build)
af sites deploy ./build --network ipfs

Template Repository | SvelteKit Docs

Hugo (Static Site Generator)

bash
# Clone the Hugo template
git clone https://github.com/alternatefutures/template-hugo my-site
cd my-site

# Build for production (requires Hugo installed)
hugo

# Deploy (build output is in ./public)
af sites deploy ./public --network ipfs

Template Repository | Hugo Docs

VitePress (Documentation)

bash
# Clone the VitePress template
git clone https://github.com/alternatefutures/template-vitepress my-site
cd my-site

# Install dependencies
npm install

# Build for production
npm run docs:build

# Deploy (build output is in ./docs/.vitepress/dist)
af sites deploy ./docs/.vitepress/dist --network ipfs

Template Repository | VitePress Docs

Framework Not Listed?

Any static site generator works with Alternate Futures! Just build your site and deploy the output directory. Common output folders: dist/, build/, out/, public/.

Option 2: Create a Simple HTML Site

If you just want to test quickly without a framework:

Creating a basic HTML site

bash
# Create a test directory
mkdir my-first-site
cd my-first-site

# Create a simple HTML file
cat > index.html << 'EOF'
<!DOCTYPE html>
<html>
<head>
    <title>My First Decentralized Site</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            max-width: 800px;
            margin: 50px auto;
            padding: 20px;
            text-align: center;
        }
        h1 { color: #4A90E2; }
    </style>
</head>
<body>
    <h1>🚀 Hello Decentralized Web!</h1>
    <p>This site is hosted on IPFS using Alternate Futures.</p>
    <p>No centralized servers. No single point of failure.</p>
</body>
</html>
EOF

# Create a dist folder (where build output typically goes)
mkdir dist
cp index.html dist/

Great! You now have a simple site ready to deploy. Continue to the next section to deploy it.

Deploy to a Storage Network

Now let's deploy your site to a decentralized storage network. You have three options:

Choosing a Storage Network

For this tutorial, use IPFS - it's the easiest to start with and works great for testing and learning.

What are these networks?

  • IPFS (InterPlanetary File System) - Like peer-to-peer file sharing but for your website. Instead of living on one server, your site lives everywhere. Best for: Testing, frequently updated sites. Cost: ~$0.15/GB/month
  • Filecoin - A marketplace where you rent storage from miners who compete to store your data cheaply. Best for: Large files, backups. Cost: ~$0.03/GB/month
  • Arweave - Pay once, store forever. Your data is permanent and can never be deleted. Best for: NFT metadata, permanent archives. Cost: ~$6/GB one-time

Want to learn more? See our storage network comparison guide or glossary entries for IPFS, Filecoin, and Arweave.

bash
# Deploy to IPFS (recommended for getting started)
af sites deploy ./dist --network ipfs

# You should see output like:
# ✓ Uploading files to IPFS...
# ✓ Deployment successful!
# ✓ CID: bafybei...
# ✓ URL: https://ipfs.io/ipfs/bafybei...
bash
# Deploy to Filecoin (best for large files)
af sites deploy ./dist --network filecoin
bash
# Deploy to Arweave (permanent storage)
af sites deploy ./dist --network arweave
typescript
// Deploy a site
const site = await af.sites.create({
  name: 'My First Site',
  source: './dist',
  network: 'ipfs'
});

console.log('Site URL:', site.url);
console.log('CID:', site.cid);

What Just Happened?

When you deployed, Alternate Futures:

  1. Bundled your files - Packaged all files in the ./dist folder
  2. Uploaded to IPFS - Sent them to the InterPlanetary File System
  3. Generated a CID - Created a unique Content Identifier (like a fingerprint for your site)
  4. Pinned the content - Ensured your files stay available on the network
  5. Gave you a URL - Your site is now live and accessible worldwide!

What's a CID? It's a unique identifier for your content, like bafybei.... It's based on your content itself, so identical content always has the same CID.

View Your Deployments

bash
# List all your sites
af sites list

# Output shows:
# - Site name
# - Network (ipfs, filecoin, arweave)
# - CID
# - URL
# - Deployment date
typescript
// List all sites
const sites = await af.sites.list();

sites.forEach(site => {
  console.log(`${site.name}: ${site.url}`);
});

Troubleshooting Deployment

"No such file or directory: ./dist"

  • Make sure the directory exists
  • Use the correct path to your build output
  • Try an absolute path: af sites deploy /full/path/to/dist --network ipfs

"Deployment failed" or timeout errors

  • Check your internet connection
  • Verify you're authenticated: af login
  • Try again—network issues can be temporary
  • Try a smaller deployment first to test

"No files found to deploy"

  • Make sure your directory isn't empty
  • Check for hidden .gitignore or .npmignore excluding files
  • List the directory contents: ls -la ./dist

Success!

Your site is now live on decentralized infrastructure! The URL works from anywhere in the world, and your content can't be taken down by any single company or server failure.

Try visiting your URL in a browser—you should see your site live!

Understanding Storage Networks

You deployed to IPFS, but Alternate Futures supports three decentralized storage networks. Here's a quick comparison:

NetworkBest ForCostPermanence
IPFSTesting, frequent updates, dynamic content~$0.15/GB/monthWhile pinned
FilecoinLarge files, backups, cost-sensitive projects~$0.03/GB/monthContract-based
ArweaveNFTs, archives, immutable content~$6/GB one-timePermanent

Quick Guide:

  • Just learning? Use IPFS
  • Building an NFT project? Use Arweave
  • Need cheap storage for large files? Use Filecoin
  • Production website? Use IPFS with Arweave backup

Learn more in the Sites Guide or Storage Management Guide.

Next Steps

Congratulations! You've deployed your first site to decentralized infrastructure. Here's what to explore next:

Core Features

Configuration

Developer Tools

Advanced

Need Help?

What You Learned

In this quickstart, you:

  • ✅ Installed the Alternate Futures CLI
  • ✅ Authenticated with the platform
  • ✅ Created a simple website
  • ✅ Deployed it to IPFS
  • ✅ Understood what CIDs are and how decentralized hosting works
  • ✅ Got your first site live on decentralized infrastructure

You're now ready to build on the decentralized web! 🚀

Released under the MIT License.