84 lines
1.9 KiB
Markdown
84 lines
1.9 KiB
Markdown
# Portal Client - Quick Start
|
|
|
|
## 🚀 5-Minute Setup
|
|
|
|
### 1. Run Setup Script
|
|
```bash
|
|
./setup.sh
|
|
```
|
|
|
|
### 2. Start Portal Server
|
|
```bash
|
|
cd ../portal-server
|
|
cargo run -- --from-env --verbose
|
|
```
|
|
|
|
### 3. Start Portal Client
|
|
```bash
|
|
cd ../portal
|
|
source .env && trunk serve
|
|
```
|
|
|
|
### 4. Open Browser
|
|
```
|
|
http://127.0.0.1:8080
|
|
```
|
|
|
|
## 🔧 Manual Setup
|
|
|
|
### Portal Server (.env)
|
|
```bash
|
|
cd ../portal-server
|
|
cp .env.example .env
|
|
# Edit .env with your keys:
|
|
API_KEYS=dev_key_123,test_key_456
|
|
STRIPE_SECRET_KEY=sk_test_your_key
|
|
STRIPE_PUBLISHABLE_KEY=pk_test_your_key
|
|
IDENTIFY_API_KEY=your_identify_key
|
|
```
|
|
|
|
### Portal Client (.env)
|
|
```bash
|
|
cd ../portal
|
|
# .env file (already created):
|
|
PORTAL_API_KEY=dev_key_123 # Must match server API_KEYS
|
|
```
|
|
|
|
## 🐛 Troubleshooting
|
|
|
|
### 401 Unauthorized?
|
|
- ✅ Check `PORTAL_API_KEY` matches server `API_KEYS`
|
|
- ✅ Run `source .env && trunk serve` (not just `trunk serve`)
|
|
- ✅ Verify server is running on port 3001
|
|
|
|
### Portal won't load?
|
|
- ✅ Install: `cargo install trunk`
|
|
- ✅ Add target: `rustup target add wasm32-unknown-unknown`
|
|
- ✅ Build first: `trunk build`
|
|
|
|
### Environment variables not working?
|
|
- ✅ Use: `source .env && trunk serve`
|
|
- ✅ Or: `PORTAL_API_KEY=dev_key_123 trunk serve`
|
|
- ✅ Or edit `index.html` directly with your API key
|
|
|
|
## 📞 Test API Connection
|
|
|
|
```bash
|
|
# Test server is working
|
|
curl -X GET http://127.0.0.1:3001/api/health \
|
|
-H "x-api-key: dev_key_123"
|
|
|
|
# Should return: {"status":"ok"}
|
|
```
|
|
|
|
## 🔄 Development Workflow
|
|
|
|
1. **Terminal 1**: `cd ../portal-server && cargo run -- --from-env --verbose`
|
|
2. **Terminal 2**: `cd ../portal && source .env && trunk serve`
|
|
3. **Browser**: `http://127.0.0.1:8080`
|
|
|
|
## 📚 More Help
|
|
|
|
- [Full README](README.md) - Complete documentation
|
|
- [Portal Server Setup](../portal-server/SETUP.md) - Server configuration
|
|
- [Portal Server README](../portal-server/README.md) - Server documentation |