Major documentation restructure to improve discoverability and reduce duplication. ## Changes **Deleted (Archived/Consolidated)**: - Removed duplicate getting started guides - Archived outdated planning documents - Consolidated corpus and configuration docs - Removed obsolete vision/spec files (superseded by vision.md) - Cleaned up scrapyard and old PDFs **New Structure**: - docs/about/ - Project overview and introduction - docs/guides/ - User guides (moved from root) - docs/specs/ - Technical specifications - docs/sdk/ - SDK documentation (Go) - docs/references/ - API references - docs/archive/ - Archived historical docs - applications/aphoria/docs/advanced/ - Advanced topics - applications/aphoria/docs/reference/ - CLI reference - applications/aphoria/docs/archive/ - Archived aphoria docs **Updated**: - README.md - New root README with clear navigation - CONTRIBUTING.md - Contribution guidelines - CLAUDE.md - Updated paths to new structure - roadmap.md - Added recent completions ## Files Changed - 57 files changed - 1,977 insertions(+) - 961 deletions(-) **Net change**: +1,016 lines (added CONTRIBUTING.md, README.md, reorganized content) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
110 lines
2.6 KiB
Markdown
110 lines
2.6 KiB
Markdown
# Corpus Quick Start Guide
|
|
|
|
## TL;DR - API is Already Running!
|
|
|
|
The corpus API is currently serving data at:
|
|
- **URL:** `http://localhost:18180/v1/aphoria/corpus`
|
|
- **Database:** `~/.aphoria/corpus-db`
|
|
- **Data:** 2 RFC items (TLS cert verification, JWT audience validation)
|
|
|
|
## Test It Right Now
|
|
|
|
```bash
|
|
# Get all RFC corpus items
|
|
curl -s 'http://localhost:18180/v1/aphoria/corpus?sources[]=rfc' | jq '.items[].subject'
|
|
|
|
# Expected output:
|
|
# "rfc://5246/tls/certificate_verification"
|
|
# "rfc://7519/audience_validation"
|
|
```
|
|
|
|
## Import Production Wiki
|
|
|
|
```bash
|
|
cd ~/Workspace/stemedb
|
|
target/release/aphoria corpus import wiki ~/Workspace/orchard9/wiki/content
|
|
```
|
|
|
|
## Start Dashboard
|
|
|
|
```bash
|
|
cd applications/aphoria-dashboard
|
|
npm run dev
|
|
# Open: http://localhost:3000/corpus
|
|
```
|
|
|
|
## Restart API Later (if needed)
|
|
|
|
```bash
|
|
cd ~/Workspace/stemedb
|
|
STEMEDB_DB_DIR=$HOME/.aphoria/corpus-db \
|
|
STEMEDB_WAL_DIR=$HOME/.aphoria/corpus-db/wal \
|
|
target/release/stemedb-api
|
|
```
|
|
|
|
## Query Examples
|
|
|
|
```bash
|
|
# Get all sources (RFC, OWASP, vendor, community)
|
|
curl 'http://localhost:18180/v1/aphoria/corpus'
|
|
|
|
# Filter by multiple sources
|
|
curl 'http://localhost:18180/v1/aphoria/corpus?sources[]=rfc&sources[]=owasp'
|
|
|
|
# Filter by category
|
|
curl 'http://localhost:18180/v1/aphoria/corpus?category=security'
|
|
|
|
# Pagination
|
|
curl 'http://localhost:18180/v1/aphoria/corpus?limit=10&offset=0'
|
|
```
|
|
|
|
## Response Format
|
|
|
|
```json
|
|
{
|
|
"items": [
|
|
{
|
|
"subject": "rfc://5246/tls/certificate_verification",
|
|
"predicate": "enabled",
|
|
"value": "true",
|
|
"source": "rfc://",
|
|
"tier": 0,
|
|
"category": "security",
|
|
"explanation": "TLS certificate verification MUST be enabled...",
|
|
"authority_source": "RFC 5246 Section 7.4.2"
|
|
}
|
|
],
|
|
"total_matching": 2,
|
|
"sources_included": ["rfc://"]
|
|
}
|
|
```
|
|
|
|
## Files to Know
|
|
|
|
- **Corpus DB:** `~/.aphoria/corpus-db/` (shared across projects)
|
|
- **Project DB:** `.aphoria/db/` (per-project)
|
|
- **Import CLI:** `aphoria corpus import wiki <path>`
|
|
- **API Config:** Set `STEMEDB_DB_DIR` to choose database
|
|
|
|
## Troubleshooting
|
|
|
|
**Dashboard shows empty results?**
|
|
- Check API is running on port 18180
|
|
- Verify API is using corpus database: `ps aux | grep stemedb-api`
|
|
- Check API logs for database path
|
|
|
|
**API won't start?**
|
|
- Make sure corpus DB exists: `ls ~/.aphoria/corpus-db/`
|
|
- Check port not in use: `lsof -i :18180`
|
|
- View logs: `tail -f /tmp/api-corpus.log`
|
|
|
|
**Need to reimport wiki?**
|
|
```bash
|
|
rm -rf ~/.aphoria/corpus-db
|
|
target/release/aphoria corpus import wiki <path>
|
|
```
|
|
|
|
---
|
|
|
|
✅ **Current Status:** API running, corpus database populated, ready for dashboard!
|