Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions .astro/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"_variables": {
"lastUpdateCheck": 1757341086717
}
}
File renamed without changes.
7 changes: 3 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -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
183 changes: 58 additions & 125 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 <repository-url>
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 `<style>` section
- Add more Web3 functionality in the JavaScript section

## Contributing
## Requirements

This is a community-driven project. Join our Discord to discuss features, propose changes, and contribute to the codebase.
- Node.js 18+
- MetaMask or Web3 wallet
- Modern browser with Web3 support

## License

See [LICENSE](LICENSE) file for details.
MIT
File renamed without changes.
Loading
Loading