Skip to content
Getting Started

Getting Started

Prerequisites

  • Go 1.22+ (the project uses Go modules)
  • NVIDIA API key for AI generation and critique (free tier available at build.nvidia.com)
  • Optional: Unsplash, Pexels, and Pixabay API keys for the image pipeline

Quick Start

# Clone the repository
git clone https://github.com/anik-apps/milesahead.git
cd milesahead

# Copy and edit the configuration
cp config.example.yaml config.yaml
# Edit config.yaml with your API keys and settings

# Build and run
go build -o milesahead ./cmd/milesahead
./milesahead

The server starts on port 9090 by default. Visit http://localhost:9090 for the public site and http://localhost:9090/admin/login for the admin dashboard.

Configuration

All settings live in a single config.yaml file. Environment variables can be interpolated with ${VAR_NAME} syntax.

SectionKeyDescription
serverportHTTP port (default 9090)
serverdomainPublic domain name
adminpassword_hashbcrypt hash of admin password
dbpathPath to SQLite database file
aigenerator_modelModel for article generation (e.g. nvidia/llama-3.3-nemotron-super-49b-v1.5)
aicritic_modelModel for article verification (e.g. meta/llama-3.3-70b-instruct)
aihf_api_tokenNVIDIA API key
aihf_base_urlAPI base URL (e.g. https://integrate.api.nvidia.com/v1)
aicritic_thresholdMinimum critic score to auto-approve (default 75)
aimax_retriesMax generation retries on failure
aicache_ttlAI response cache TTL in seconds
aiunsplash_keyUnsplash API key for image search
aipexels_keyPexels API key for image search
aipixabay_keyPixabay API key for image search
scannerdefault_intervalDefault scan interval in minutes
scanneruser_agentHTTP User-Agent for scanning
sitepersona_nameAI persona name (default Scout)
mailsmtp.*SMTP settings for outbound email
mailimap.*IMAP settings for inbound email feedback
newslettersend_timeDaily newsletter send time (e.g. 08:00)
newslettertimezoneTimezone for newsletter scheduling
votesalert_thresholdMinimum votes before alerting
votesalert_ratioDownvote ratio that triggers an alert
votesalert_windowAlert window in hours

Admin Password Hash

Generate a bcrypt hash for your admin password:

htpasswd -nbBC 12 "" "your-password" | tr -d ':\n' | sed 's/$2y/$2a/'

Or use any online bcrypt generator and paste the hash into config.yaml under admin.password_hash.

Seeding Reference Pages

The project ships with 41 credit card reference pages in cmd/seed-cards/cards.json. Seed them into the database:

go run ./cmd/seed-cards -db ./data/milesahead.db

Use -force to overwrite existing cards:

go run ./cmd/seed-cards -db ./data/milesahead.db -force

Adding Sources

Sources are managed through the admin dashboard at /admin. Each source needs:

  • Name – display name for attribution
  • URL – base URL of the blog
  • RSS URL (optional) – RSS feed URL for scanning
  • Scrape Selector (optional) – CSS selector for HTML scraping fallback
  • Scan Interval (optional) – override the default interval in minutes