# Workspace Rules for Ginxsom Development

## Important Reminders for Future Assistants

### SQLite Configuration
- **SQLite is compiled locally** in this project, not using system package
- Location: `sqlite3-build/` directory contains local SQLite 3.37.2 build
- The system SQLite package had version conflicts, so we built from source
- Database file: `db/ginxsom.db` (local to project)
- Always use local SQLite binary: `./sqlite3-build/sqlite3`

### Development Setup
- **All development is LOCAL** - work within the project directory
- Local nginx runs on port 9001 (not system nginx on port 80)
- Configuration: `config/local-nginx.conf` (NOT system nginx configs)
- FastCGI socket: `/tmp/ginxsom-fcgi.sock`
- Never modify system nginx files in `/etc/nginx/` during development

### File Structure
- Blob files stored in: `blobs/` directory
- Database: `db/ginxsom.db`
- Built binary: `build/ginxsom-fcgi`
- Logs: `logs/` directory (nginx access/error logs)

### Testing
- Test files are already in `blobs/`:
  - `708d0e8226ec17b0585417c0ec9352ce5f52c3820c904b7066fe20b00f2d9cfe.webp`
  - `f8b5b4904c79bb53b2b417bc9c939268ac2871f194e95523b7b66113862da15e.jpg`
- Test URLs: `http://localhost:9001/<sha256>` or `http://localhost:9001/<sha256>.<ext>`

### Build Process
- Compile with: `make`
- Start FastCGI: `./scripts/start-fcgi.sh`
- Start nginx: `nginx -p . -c config/local-nginx.conf`

### Common Issues
- If nginx fails to start, check for port conflicts or kill existing processes
- If FastCGI fails, check socket permissions and that binary exists
- Always use local paths, never assume system installations

  use ./restart-nginx.sh to restart nginx
  use ./start-fcgi.sh to start fcgi