diff --git a/frontend/.astro/content-assets.mjs b/.astro/content-assets.mjs similarity index 100% rename from frontend/.astro/content-assets.mjs rename to .astro/content-assets.mjs diff --git a/frontend/.astro/content-modules.mjs b/.astro/content-modules.mjs similarity index 100% rename from frontend/.astro/content-modules.mjs rename to .astro/content-modules.mjs diff --git a/frontend/.astro/content.d.ts b/.astro/content.d.ts similarity index 100% rename from frontend/.astro/content.d.ts rename to .astro/content.d.ts diff --git a/frontend/.astro/data-store.json b/.astro/data-store.json similarity index 100% rename from frontend/.astro/data-store.json rename to .astro/data-store.json diff --git a/.astro/settings.json b/.astro/settings.json new file mode 100644 index 0000000..192d950 --- /dev/null +++ b/.astro/settings.json @@ -0,0 +1,5 @@ +{ + "_variables": { + "lastUpdateCheck": 1757341086717 + } +} \ No newline at end of file diff --git a/frontend/.astro/types.d.ts b/.astro/types.d.ts similarity index 100% rename from frontend/.astro/types.d.ts rename to .astro/types.d.ts diff --git a/.env.example b/.env.example index e934082..8001a9f 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,5 @@ -# Database -DATABASE_URL=postgres://guild_user:guild_password@localhost:5432/guild_genesis - -# Frontend +# WalletConnect Project ID PUBLIC_WALLET_CONNECT_PROJECT_ID=your_project_id_here + +# Backend API URL PUBLIC_API_URL=http://localhost:3001 diff --git a/README.md b/README.md index 6b13b2e..7802693 100644 --- a/README.md +++ b/README.md @@ -1,161 +1,94 @@ # The Guild Genesis -[![CI](https://github.com/your-username/TheGuildGenesis/workflows/CI/badge.svg)](https://github.com/your-username/TheGuildGenesis/actions) +A simple Web3 dapp for awarding badges to users via smart contracts. Built with Astro and vanilla JavaScript. -A peer-run organization where software developers certify each other's skills, learn together, and create opportunities. Built on the idea that developers are stronger when united. - -## Project Structure - -This is a monorepo containing: - -- **`frontend/`** - Astro + React frontend with Web3 integration -- **`backend/`** - Rust backend with Axum, SQLx, and SIWE authentication - -## Tech Stack - -### Frontend -- **Astro** - Fast static site generator with React islands -- **React** - For interactive Web3 components -- **Tailwind CSS** - Utility-first CSS framework -- **wagmi** - React hooks for Ethereum -- **viem** - TypeScript interface for Ethereum -- **RainbowKit** - Wallet connection UI -- **TanStack Query** - Data fetching and caching -- **TanStack Router** - Type-safe routing +## Features -### Backend -- **Rust** - Systems programming language -- **Axum** - Web framework -- **SQLx** - Async SQL toolkit with compile-time checked queries -- **PostgreSQL** - Database -- **SIWE** - Sign-In with Ethereum authentication +- **Wallet Connection** - Connect MetaMask or other Web3 wallets +- **Badge Awarding** - Award badges to other users by calling smart contracts +- **Clean UI** - Simple, responsive interface +- **No Database** - All data stored on-chain via smart contracts ## Quick Start -### Prerequisites -- [Nix](https://nixos.org/download.html) with flakes enabled -- [direnv](https://direnv.net/) (optional, for automatic environment loading) -- [just](https://github.com/casey/just) (command runner) - -### Setup - -1. **Clone and enter the development environment:** +1. **Install dependencies:** ```bash - git clone - cd TheGuildGenesis - - # If using direnv (recommended) - direnv allow - - # Or manually enter the Nix shell - nix develop + npm install ``` -2. **Install dependencies:** +2. **Start development server:** ```bash - just install-all + npm run dev ``` -### Development Workflow - -#### Quick Start - -```bash -# Set up the database -just db-setup - -# Start both frontend and backend -just dev -``` - -**Access the applications:** -- Frontend: http://localhost:4321 -- Backend API: http://localhost:3001 -- PostgreSQL: localhost:5432 +3. **Open in browser:** + ``` + http://localhost:4321 + ``` -#### Individual Services +4. **Connect your wallet** and start awarding badges! -```bash -# Start database only -just db-start +## Available Scripts -# Start frontend only -just dev-frontend +- `npm run dev` - Start development server +- `npm run build` - Build for production +- `npm run preview` - Preview production build +- `npm run test` - Run tests +- `npm run lint` - Lint code +- `npm run format` - Format code +- `npm run clean` - Clean build artifacts -# Start backend only -just dev-backend +## Project Structure -# Stop database -just db-stop ``` - -#### Database Management - -```bash -# Set up database with migrations -just db-setup - -# Reset database completely -just db-reset - -# Stop database -just db-stop +/ +├── src/ +│ ├── components/ # React components (if needed) +│ ├── layouts/ # Astro layouts +│ ├── pages/ # Astro pages +│ │ └── index.astro # Main dapp page +│ └── styles/ # Global styles +├── public/ # Static assets +└── package.json # Dependencies and scripts ``` -### Available Commands +## How It Works -Run `just help` to see all available commands: +1. **Connect Wallet** - Click "Connect Wallet" to connect MetaMask +2. **Award Badges** - Fill in recipient address, select badge type, add message +3. **Smart Contract** - Badge data is stored on-chain (currently simulated) -- **Development:** `just dev`, `just dev-frontend`, `just dev-backend` -- **Database:** `just db-start`, `just db-stop`, `just db-setup`, `just db-reset` -- **Build:** `just build`, `just build-frontend`, `just build-backend` -- **Testing:** `just test`, `just test-frontend`, `just test-backend` -- **Code Quality:** `just lint`, `just format` -- **Utilities:** `just clean`, `just help` +## Badge Types -## Features +- 👨‍💻 **Contributor** - For active code contributions +- 🎓 **Mentor** - For helping others learn +- 💡 **Innovator** - For creative solutions +- 👑 **Leader** - For project leadership -### V0 (Current) -- [x] Monorepo structure -- [x] Astro frontend with React islands -- [x] Rust backend with Axum -- [x] Web3 wallet integration -- [x] Basic profile and badge system -- [ ] SIWE authentication -- [ ] Database models and migrations -- [ ] API endpoints for profiles and badges +## Development -### V1+ (Future) -- [ ] Smart contracts for on-chain badges -- [ ] Gasless transactions -- [ ] Badge hierarchy and categories -- [ ] Activity and contribution tokens -- [ ] DAO governance -- [ ] Social features +This is a simple Astro project with vanilla JavaScript for Web3 functionality. No complex build tools or databases needed. -## Development Philosophy +### Adding Smart Contract Integration -- **Nix-first development** - Reproducible environments without Docker overhead -- **Simple first, complex later** - Start with MVP, iterate -- **Non-profit, member-driven** - Community ownership -- **Horizontal governance** - Flat organization structure -- **Action over endless talk** - Build and ship -- **We use what we build** - Dogfooding our own tools +To integrate with real smart contracts: -### Why Nix? +1. Add contract ABI and address +2. Replace the simulation in the form submission handler +3. Use libraries like ethers.js or web3.js for contract calls -This project uses Nix for development instead of Docker because: +### Customization -- **Reproducible environments** - Everyone gets identical toolchains -- **No container overhead** - Direct process execution, faster builds -- **Simpler setup** - One command (`nix develop`) gets you everything -- **Better performance** - No Docker daemon, faster file system access -- **True reproducibility** - Nix ensures exact same versions across all systems +- Modify badge types in the HTML +- Update styling in the ` + + +
+ +
+ + +
+
+ +
+
+

Award Badge

+

Connect your wallet and award badges to other users by calling the smart contract.

+ +
+ + +
+ +
+

Available Badges

+
+
+
👨‍💻
+

Contributor

+

For active code contributions

+
+
+
🎓
+

Mentor

+

For helping others learn

+
+
+
💡
+

Innovator

+

For creative solutions

+
+
+
👑
+

Leader

+

For project leadership

+
+
+
+
+ + + + \ No newline at end of file diff --git a/frontend/tsconfig.json b/tsconfig.json similarity index 100% rename from frontend/tsconfig.json rename to tsconfig.json diff --git a/frontend/vitest.config.ts b/vitest.config.ts similarity index 100% rename from frontend/vitest.config.ts rename to vitest.config.ts