@@ -39,26 +39,107 @@ This is a monorepo containing:
3939
4040### Prerequisites
4141- [ Docker] ( https://www.docker.com/ )
42+ - [ Node.js] ( https://nodejs.org/ ) (for frontend development)
43+ - [ Astro CLI] ( https://docs.astro.build/en/getting-started/ ) (for frontend development)
4244- [ Foundry] ( https://book.getfoundry.sh/getting-started/installation ) (for smart contracts)
4345
46+ ### Environment Setup
47+
48+ Create a ` .env ` file in the project root with the following variables:
49+
50+ ``` bash
51+ # Database
52+ DATABASE_URL=postgresql://guild_user:guild_password@localhost:5433/guild_genesis
53+
54+ # Frontend Environment Variables
55+ PUBLIC_WALLET_CONNECT_PROJECT_ID=your_wallet_connect_project_id
56+ PUBLIC_API_URL=http://localhost:3001
57+ PUBLIC_BADGE_REGISTRY_ADDRESS=0x...
58+ PUBLIC_EAS_CONTRACT_ADDRESS=0x...
59+ PUBLIC_ACTIVITY_TOKEN_ADDRESS=0x...
60+ PUBLIC_SCHEMA_ID=0x...
61+
62+ # Discord Bot (if using)
63+ DISCORD_TOKEN=your_discord_bot_token
64+ DISCORD_CLIENT_ID=your_discord_client_id
65+ DISCORD_GUILD_ID=your_discord_guild_id
66+
67+ # Optional: Skip migrations in development
68+ SKIP_MIGRATIONS=1
69+
70+ # Optional: Disable SQLx compile-time validation
71+ SQLX_OFFLINE=true
72+ ```
73+
74+ ** Required for Production:**
75+ - ` DATABASE_URL ` - PostgreSQL connection string
76+ - ` PUBLIC_WALLET_CONNECT_PROJECT_ID ` - Get from [ WalletConnect Cloud] ( https://cloud.walletconnect.com/ )
77+ - Contract addresses - Deploy smart contracts first
78+
79+ ** Optional for Development:**
80+ - ` SKIP_MIGRATIONS=1 ` - Skip automatic migrations (run manually)
81+ - ` SQLX_OFFLINE=true ` - Disable SQLx compile-time validation
82+
4483### Development Workflow
4584
46- #### Quick Start
85+ #### Option 1: Docker Compose (Recommended)
86+
87+ We provide multiple Docker Compose configurations for different environments:
4788
89+ ``` bash
90+ # Development with hot reload
91+ make dev
92+
93+ # Production build
94+ make prod
95+
96+ # Run tests
97+ make test
98+
99+ # Database only
100+ make db
101+
102+ # Stop all services
103+ make stop
104+ ```
105+
106+ #### Option 2: Local Development
107+
108+ ** Backend:**
48109``` bash
49110cd backend
50111cargo install sqlx-cli --no-default-features --features rustls,postgres
51112cargo sqlx prepare -- --bin guild-backend
52113```
53114
115+ ** Frontend:**
116+ ``` bash
117+ cd frontend
118+ npm install
119+ npm run dev
120+ ```
121+
122+ ** Database:**
123+ ``` bash
124+ docker compose up -d postgres
125+ ```
126+
127+ ### Docker Compose Environments
128+
129+ - ** ` docker-compose.dev.yml ` ** - Development with hot reload, volume mounts, and dev tools
130+ - ** ` docker-compose.prod.yml ` ** - Production with optimized builds and restart policies
131+ - ** ` docker-compose.test.yml ` ** - Testing environment with test-specific configurations
132+ - ** ` docker-compose.db-only.yml ` ** - Just PostgreSQL for local development
133+
134+ Use ` make ` commands or specify files directly:
54135``` bash
55- docker- compose up -d
136+ docker compose -f docker- compose.dev.yml up --build
56137```
57138
58139** Access the applications:**
59- - Frontend: http://localhost:4321
140+ - Frontend: http://localhost:3000
60141- Backend API: http://localhost:3001
61- - PostgreSQL: localhost:5432
142+ - PostgreSQL: localhost:5433
62143
63144#### Smart Contracts Development
64145
@@ -131,9 +212,9 @@ event BadgeCreated(bytes32 indexed name, bytes32 description, address indexed cr
131212- [x] Web3 wallet integration
132213- [x] Basic profile and badge system
133214- [x] Smart contracts for on-chain badges
134- - [ ] SIWE authentication
215+ - [x ] SIWE authentication
135216- [ ] Database models and migrations
136- - [ ] API endpoints for profiles and badges
217+ - [x ] API endpoints for profiles and badges
137218
138219### V1+ (Future)
139220- [ ] Gasless transactions
0 commit comments