Digital Autonomous Organization for *Space: Members can accrue non-tradable SpaceTime tokens and earn or purchase SpaceMoney tokens, each provide magnified powers for creating and voting on proposals.
git clone https://github.com/starspacegroup/athena.git
cd athena
npm install
Copy .env.example to .env and fill in your values:
cp .env.example .env
Update the following variables:
DISCORD_CLIENT_ID: Your Discord OAuth client IDDISCORD_CLIENT_SECRET: Your Discord OAuth client secretDISCORD_REDIRECT_URI: OAuth callback URL (e.g., http://localhost:5173/api/auth/callback)SPACETIME_TOKEN_ADDRESS: SpaceTime token contract address on PolygonSPACEMONEY_TOKEN_ADDRESS: SpaceMoney token contract address on PolygonSESSION_SECRET: Random secret for session encryptionnpm run dev
Visit http://localhost:5173 to see the application.
athena/
├── src/
│ ├── lib/
│ │ ├── components/ # Reusable components (future use)
│ │ ├── server/ # Server-side utilities
│ │ │ └── session.ts # Session management
│ │ ├── stores/ # Svelte stores
│ │ │ ├── auth.ts # Authentication state
│ │ │ └── tokens.ts # Token balances state
│ │ └── wallet.ts # Wallet connection utilities
│ ├── routes/
│ │ ├── api/ # API endpoints
│ │ │ ├── auth/ # Authentication endpoints
│ │ │ └── tokens/ # Token operation endpoints
│ │ ├── dashboard/ # Dashboard page
│ │ ├── tokens/
│ │ │ ├── purchase/ # Purchase tokens page
│ │ │ └── transfer/ # Transfer tokens page
│ │ ├── +layout.svelte # Root layout
│ │ └── +page.svelte # Home/login page
│ ├── app.d.ts # TypeScript declarations
│ └── app.html # HTML template
├── static/ # Static assets
├── .env.example # Environment variables template
├── package.json # Dependencies
├── svelte.config.js # SvelteKit configuration
├── tsconfig.json # TypeScript configuration
├── vite.config.ts # Vite configuration
└── wrangler.toml # Cloudflare configuration
npm run build.svelte-kit/cloudflarenpm install -g wrangler
wrangler login
npm run build
wrangler pages publish .svelte-kit/cloudflare
Set these in the Cloudflare Pages dashboard under Settings > Environment variables:
DISCORD_CLIENT_IDDISCORD_CLIENT_SECRETDISCORD_REDIRECT_URI (use your production URL)SPACETIME_TOKEN_ADDRESSSPACEMONEY_TOKEN_ADDRESSSESSION_SECRETNavigate to the Dashboard to see your current token balances for:
Currently, the token balances and transactions use mock data. To connect to real smart contracts:
.envsrc/lib/wallet.ts to use the real contract addressesThe current implementation uses in-memory session storage which will reset on server restart. For production, consider:
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License