Skip to content

Instantly share code, notes, and snippets.

@exonomyapp
Last active January 9, 2025 21:30
Show Gist options
  • Save exonomyapp/597ffad0f0c1220e074e38e7612bfab1 to your computer and use it in GitHub Desktop.
Save exonomyapp/597ffad0f0c1220e074e38e7612bfab1 to your computer and use it in GitHub Desktop.
Step-by-Step instructions for setting up Exonomy repo

Exonomy App Installation Guide

This guide provides step-by-step instructions for creating and setting up the Exonomy App repository as described in the functional specification.

Step 1: Initialize a Git Repository

  1. Create a new folder for the project:

    mkdir exonomy-app
    cd exonomy-app
  2. Initialize the repository:

    git init

Step 2: Set Up the Project with Nuxt and Bun

  1. Create a new Nuxt project using Bun as the JavaScript runtime:

    npx nuxi init . --js-runtime bun
  2. When prompted:

    • Accept the default project name: exonomy.
    • Use Bun as the JavaScript runtime.
  3. Nuxt will generate the following structure and files:

    • .nuxt/ folder for Nuxt's runtime.
    • nuxt.config.ts: Configuration for the Nuxt project.
    • pages/ folder for application pages.
    • package.json: Project metadata updated by Nuxt.
  4. Install Nuxt dependencies with Bun:

    bun install
  5. Bun automatically creates additional files during the initialization process. Below are the contents of these files for reference:

index.ts:

console.log("Hello via Bun!");

package.json:

{
  "name": "exonomy",
  "module": "index.ts",
  "type": "module",
  "devDependencies": {
    "@types/bun": "latest"
  },
  "peerDependencies": {
    "typescript": "^5.0.0"
  }
}

README.md:

# exonomy

To install dependencies:

```bash
bun install

To run:

bun run index.ts

This project was created using bun init in bun v1.1.43. Bun is a fast all-in-one JavaScript runtime.


**tsconfig.json:**
```json
{
  "compilerOptions": {
    // Enable latest features
    "lib": ["ESNext", "DOM"],
    "target": "ESNext",
    "module": "ESNext",
    "moduleDetection": "force",
    "jsx": "react-jsx",
    "allowJs": true,

    // Bundler mode
    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "verbatimModuleSyntax": true,
    "noEmit": true,

    // Best practices
    "strict": true,
    "skipLibCheck": true,
    "noFallthroughCasesInSwitch": true,

    // Some stricter flags (disabled by default)
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "noPropertyAccessFromIndexSignature": false
  }
}

Step 3: Install Additional Dependencies

Referencing the functional specification, install the following key dependencies:

  1. Pinia for state management:

    bun add pinia
  2. IPFS for decentralized file storage:

    bun add ipfs
  3. OrbitDB for decentralized database management:

    bun add orbit-db
  4. Capacitor for native app functionality:

    bun add @capacitor/core @capacitor/cli @capacitor/ios @capacitor/android
  5. Ionic Framework for UI components:

    bun add @ionic/vue @ionic/core ionicons
  6. Nuxt and Ionic Integration Plugins to enable seamless operation between the frameworks:

    bun add @nuxt/ionic nuxt-vue-capacitor

Step 4: Update Nuxt Configuration

Update the nuxt.config.ts file to include all necessary modules and configurations:

export default defineNuxtConfig({
  modules: [
    '@nuxt/ionic',
    'nuxt-vue-capacitor',
    '@pinia/nuxt'
  ],
  css: ['@ionic/core/css/ionic.bundle.css'],
  ionic: {
    integrations: true,
  },
  capacitor: {
    ios: true,
    android: true,
  },
});

Step 5: Set Up Capacitor

  1. Initialize Capacitor:

    npx cap init
  2. Add iOS and Android platforms:

    npx cap add ios
    npx cap add android
  3. Ensure that capacitor.config.ts is correctly configured (this file will be auto-generated):

import { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
  appId: 'com.exonomy.app',
  appName: 'Exonomy',
  webDir: '.output/public',
  bundledWebRuntime: false
};

export default config;

Step 6: Add Pinia Store

Create the store directory and define a basic Pinia store:

mkdir store

store/main.ts:

import { defineStore } from 'pinia';

export const useMainStore = defineStore('main', {
  state: () => ({
    message: 'Welcome to Exonomy!'
  }),
  actions: {
    updateMessage(newMessage: string) {
      this.message = newMessage;
    }
  }
});

Step 7: Verify and Commit Changes

  1. Verify the structure of the project. The following files and folders should exist:

    • .nuxt/
    • nuxt.config.ts
    • capacitor.config.ts
    • package.json
    • pages/
    • store/
  2. Stage the changes:

    git add .
  3. Commit the changes:

    git commit -m "Initial project setup with Nuxt, Bun, and dependencies"

Step 8: Begin Development

Develop the core features following the functional specification, including implementing:

  • Voucher management with metadata
  • Peer-to-peer transaction mechanisms
  • Integration with IPFS and OrbitDB for persistence
  • Capacitor configuration for mobile builds
  • Ionic integration for responsive UI

Additional steps and updates will be appended as the project progresses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment