A modern, high-performance website built with Astro SSR and powered by Directus headless CMS. This project provides a flexible content management system with a lightning-fast frontend.
- Frontend: Astro with SSR (Server-Side Rendering)
- CMS: Directus - Open-source headless CMS
- Database: PostgreSQL 15.6
- Cache: Redis 7.2
- Infrastructure: Docker & Docker Compose
- SDK: Directus JavaScript SDK for seamless API integration
Before you begin, ensure you have the following installed:
- Node.js: v20.x or higher
- Docker: Latest stable version
- Docker Compose: v2.x or higher
- Git: For version control
-
Clone the repository
git clone <repository-url> cd bd-directus-astro
-
Set up environment variables Create a
.envfile in the root directory with the following variables:# Database POSTGRES_DB=directus POSTGRES_USER=directus POSTGRES_PASSWORD=your_secure_password # Directus DIRECTUS_KEY=your_random_key_here DIRECTUS_SECRET=your_random_secret_here DIRECTUS_ADMIN_EMAIL=admin@example.com DIRECTUS_ADMIN_PASSWORD=admin_password # Public URLs PUBLIC_DIRECTUS_URL=http://localhost:8055 # Optional: Enable CMS-backed rendering (default: true) PUBLIC_CMS_ENABLED=true # Optional: Static token for RSS imports (create in Directus: Settings > Access Tokens) DIRECTUS_STATIC_TOKEN=your-static-token-here DIRECTUS_EVENTS_TOKEN=your-events-token-here
-
Start the application
docker-compose up -d
-
Access the services
- Website: http://localhost:4321
- Directus Admin: http://localhost:8055
-
First-time setup
- Log into Directus at http://localhost:8055
- Use the credentials from your
.envfile - Start creating content collections and content!
- Server-Side Rendering: Fast page loads with Astro SSR
- Headless CMS: Flexible content management with Directus
- Image Optimization: Automatic image processing for Directus assets
- Docker-based: Consistent development and deployment environment
- Redis Caching: Improved performance with intelligent caching
- Schema Version Control: Track and deploy CMS schema changes
- Health Checks: Automatic service health monitoring and recovery
- Automated Event Imports: RSS feed integration with BitcoinOnly.events for DC, Maryland, and Virginia
- Event Management: Comprehensive event system with venues, tags, RSVP links, and image handling
- Podcast Platform: Full podcast episode management with audio player
- BitPlebs Community Page: Dedicated page for DC BitPlebs meetup events
- iCalendar Export: Subscribe to events via calendar applications (events.ics)
- BTCMap Integration: Interactive map of Bitcoin-accepting merchants
- Newsletter Subscription: Integrated newsletter signup
- Contact Form: Built-in contact form for community engagement
- Multiple Meetup Pages: Regional pages for DC BitDevs, Shenandoah, Southern Maryland, and more
- Nostr Integration: Social profile links and community connections
- Book Club: Dedicated page for Bitcoin book club events
bd-directus-astro/
βββ site/ # Astro frontend application
β βββ src/
β β βββ pages/ # Astro pages (routes)
β β β βββ index.astro # Homepage
β β β βββ events.astro # Events calendar
β β β βββ events.ics.ts # iCalendar feed
β β β βββ bitplebs/ # DC BitPlebs pages
β β β βββ podcast/ # Podcast pages
β β β βββ bookclub.astro # Book club page
β β β βββ contact.astro # Contact form
β β β βββ nostr.astro # Nostr info
β β βββ layouts/ # Layout components
β β βββ components/ # Reusable components
β β β βββ EventsList.astro
β β β βββ PodcastList.astro
β β β βββ BTCMap.astro
β β β βββ sections/ # Page sections
β β βββ lib/ # Utilities and Directus client
β β β βββ directus.ts # Directus SDK client
β β β βββ utils.ts # Helper functions
β β βββ config/ # Configuration
β β β βββ site.ts # Site-wide settings
β β βββ assets/ # Images and static assets
β βββ astro.config.mjs # Astro configuration
β βββ Dockerfile # Astro container definition
βββ scripts/ # Utility scripts
β βββ import-rss-events.js # RSS event importer
β βββ schema-snapshot.sh # Export schema
β βββ schema-apply.sh # Apply schema
β βββ backup-database.sh # Database backup
β βββ directus-reset.sh # Reset Directus
βββ directus/
β βββ extensions/ # Custom Directus extensions
β βββ data/ # Persistent database data (gitignored)
β βββ uploads/ # User-uploaded files (gitignored)
βββ docker-compose.yml # Service orchestration
βββ schema.yaml # Directus schema definition
βββ snapshot.json # Directus schema snapshot
βββ README-*.md # Additional documentation
- Homepage (
/) - Featured events, stats, and community highlights - Events (
/events) - Full calendar of upcoming Bitcoin events - BitPlebs (
/bitplebs) - DC BitPlebs community meetup page - Podcast (
/podcast) - Episode archive with audio player - Meetups (
/meetups) - Regional meetup groups across DMV - Merchants (
/merchants) - BTCMap of Bitcoin-accepting businesses - Book Club (
/bookclub) - Community book club information - Contact (
/contact) - Get in touch with the community - Nostr (
/nostr) - Nostr integration and community links
- iCalendar Feed (
/events.ics) - Subscribe to events in your calendar app - Dynamic Event Pages (
/bitplebs/[id]) - Detailed event information - Podcast Episodes (
/podcast/[slug]) - Individual episode pages with player - Newsletter Subscription - Integrated throughout the site
- Social Links - X (Twitter), Nostr, GitHub integration
Site-wide settings are managed in site/src/config/site.ts:
- Navigation menu structure
- Footer links and sections
- Social media links
- Newsletter configuration
- Meetup group information
Edit this file to customize navigation, footer content, and social integrations.
This project includes an automated RSS import system for Bitcoin events:
# Import events from BitcoinOnly.events RSS feeds
npm run import-events
# OR
node scripts/import-rss-events.jsThe import script:
- Fetches events from RSS feeds (DC, Maryland, Virginia)
- Parses event details (date, time, venue, description)
- Scrapes RSVP links from event pages (Luma, Meetup)
- Downloads and uploads event images to Directus
- Creates or updates venues automatically
- Tags events (e.g., "bitplebs" for DC BitPlebs events)
- Skips past events and duplicates
- Updates existing events with missing information
Configuration: Edit RSS_FEEDS array in scripts/import-rss-events.js to add/modify sources.
Authentication: Requires a Directus static token set in .env:
DIRECTUS_EVENTS_TOKEN=your-token-here
# OR use:
DIRECTUS_STATIC_TOKEN=your-token-hereGenerate a static token in Directus: Settings > Access Tokens > Create New Token
- Architecture Guide: Detailed technical architecture and design decisions
- Troubleshooting Guide: Common issues and solutions
- Quick Start Guide: 30-minute production setup β‘
- Full Deployment Guide: Comprehensive deployment documentation
- Infrastructure Overview: Complete infrastructure reference
- Ansible Guide: Infrastructure automation with Ansible
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop all services
docker-compose down
# Rebuild containers
docker-compose up -d --build
# Access Astro container shell
docker-compose exec astro sh
# Access Directus container shell
docker-compose exec directus sh# Export current Directus schema to schema.yaml (recommended)
./scripts/schema-snapshot.sh
# Apply schema.yaml to Directus instance
./scripts/schema-apply.sh# Import events from RSS feeds
node scripts/import-rss-events.js
# Backup database
./scripts/backup-database.sh
# Reset Directus (removes all data)
./scripts/directus-reset.sh/- Homepage with featured content/events- Full event calendar with upcoming events/events.ics- iCalendar feed for calendar apps/bitplebs- DC BitPlebs community page/bitplebs/[id]- Individual BitPlebs event pages/podcast- Podcast episode list/podcast/[slug]- Individual episode pages with audio player/bookclub- Book club information/meetups- Regional meetup groups/merchants- BTCMap of Bitcoin-accepting merchants/contact- Contact form/nostr- Nostr community information
- Create a feature branch from
main - Make your changes
- Update documentation if needed
- Test your changes locally
- Submit a pull request
[Add your license information here]
- Check the Troubleshooting Guide
- Review the Architecture Documentation
- Check Directus documentation: https://docs.directus.io
- Check Astro documentation: https://docs.astro.build