This guide provides step-by-step instructions for creating and setting up the Exonomy App repository as described in the functional specification.
-
Create a new folder for the project:
mkdir exonomy-app cd exonomy-app
-
Initialize the repository:
git init
-
Create a new Nuxt project using Bun as the JavaScript runtime:
npx nuxi init . --js-runtime bun
-
When prompted:
- Accept the default project name:
exonomy
. - Use
Bun
as the JavaScript runtime.
- Accept the default project name:
-
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.
-
Install Nuxt dependencies with Bun:
bun install
-
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
}
}
Referencing the functional specification, install the following key dependencies:
-
Pinia for state management:
bun add pinia
-
IPFS for decentralized file storage:
bun add ipfs
-
OrbitDB for decentralized database management:
bun add orbit-db
-
Capacitor for native app functionality:
bun add @capacitor/core @capacitor/cli @capacitor/ios @capacitor/android
-
Ionic Framework for UI components:
bun add @ionic/vue @ionic/core ionicons
-
Nuxt and Ionic Integration Plugins to enable seamless operation between the frameworks:
bun add @nuxt/ionic nuxt-vue-capacitor
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,
},
});
-
Initialize Capacitor:
npx cap init
-
Add iOS and Android platforms:
npx cap add ios npx cap add android
-
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;
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;
}
}
});
-
Verify the structure of the project. The following files and folders should exist:
.nuxt/
nuxt.config.ts
capacitor.config.ts
package.json
pages/
store/
-
Stage the changes:
git add .
-
Commit the changes:
git commit -m "Initial project setup with Nuxt, Bun, and dependencies"
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.