Skip to main content

Platform Overview

Dzaleka Online Services is built on a modern, scalable architecture designed to serve the refugee community efficiently while remaining maintainable by non-technical contributors.

Architecture Overview

Technology Stack

Astro 5.x

Static site generator with partial hydration for optimal performance

React 18

Interactive components for dynamic functionality

Tailwind CSS

Utility-first CSS framework with custom design system

MDX

Markdown with JSX for content authoring

Core Dependencies

Project Structure

Content Collections Architecture

Content Collection Definition

Content is managed through Astro’s Content Collections with Zod schemas for type safety:

Content Collections Overview

All content collections use the same pattern: Markdown files with frontmatter validated by Zod schemas.

Example Content File

API Architecture

API Endpoints

The platform provides RESTful API endpoints using Astro’s API routes:

API Utilities

Available API Endpoints

/api/services

GET all services with filtering options

/api/events

GET events with date filtering

/api/jobs

GET job listings with status filters

/api/resources

GET resources with category filters

/api/news

GET news and announcements

/api/photos

GET photo gallery metadata

API Response Format

Design System

Tailwind Configuration

Component Library

Base UI Components

Feature Components

  • Header: Site navigation with mobile menu
  • Footer: Links, contact info, social media
  • ServiceCard: Display service information
  • EventCard: Show event details with date badges
  • JobCard: Job listing with metadata
  • SearchBar: Real-time search with MiniSearch
  • Pagination: Navigate through content pages
  • CategoryFilter: Filter content by categories

Search Implementation

MiniSearch Integration

Deployment Architecture

Netlify Configuration

Build Process

1

Content Processing

Astro loads all MDX files from content collections and validates them against Zod schemas
2

Static Generation

Pages are pre-rendered to static HTML with minimal JavaScript
3

Asset Optimization

Images are optimized, CSS is minified, JavaScript is bundled
4

API Routes

Serverless functions are generated for API endpoints
5

Deployment

Static files are deployed to Netlify CDN, functions to AWS Lambda

Performance Optimizations

  • Partial Hydration: Only interactive components load JavaScript
  • Image Optimization: Automatic responsive images with lazy loading
  • Code Splitting: Per-page JavaScript bundles
  • CDN Caching: Static assets cached globally
  • Prerendering: Most pages generated at build time

Data Flow

Content Management Workflow

1

Content Creation

Authors create/edit MDX files in src/content/ directories
2

Schema Validation

Frontmatter is validated against Zod schemas during development
3

Local Preview

Changes are visible immediately in development server
4

Git Commit

Content is committed to Git repository
5

Automated Build

Netlify detects changes and triggers build process
6

Deploy

New version is deployed to production automatically

Security Features

API Security

  • Rate Limiting: 60 requests per minute per IP
  • CORS Headers: Configured for safe cross-origin access
  • Input Validation: All API inputs validated with Zod
  • Error Handling: Safe error messages without exposing internals

Content Security

  • Schema Validation: All content validated before build
  • Sanitization: HTML and user inputs sanitized
  • HTTPS Only: All connections encrypted
  • CSP Headers: Content Security Policy headers configured

Monitoring & Analytics

Built-in Analytics

Metrics Tracked

  • Total content items by collection
  • Active vs inactive services
  • Open vs closed job postings
  • Upcoming vs past events
  • Featured content counts
  • API usage statistics

Development Setup

Local Development

Environment Variables

Extending the Platform

Adding a New Content Collection

1

Define Schema

Add schema to src/content.config.ts:
2

Create Collection

3

Export Collection

4

Create Content Directory

Create src/content/mycollection/ directory
5

Add Pages

Create listing and detail pages in src/pages/mycollection/

Adding a New API Endpoint

Best Practices

Content Authoring

  • Use descriptive filenames (lowercase, hyphens for spaces)
  • Include all required frontmatter fields
  • Optimize images before uploading (max 1MB)
  • Use relative paths for internal links
  • Test content locally before committing

Component Development

  • Keep components small and focused
  • Use TypeScript for type safety
  • Follow Astro’s component patterns
  • Minimize client-side JavaScript
  • Use semantic HTML

Performance

  • Lazy load images and heavy components
  • Minimize bundle sizes
  • Use partial hydration strategically
  • Optimize database queries in API routes
  • Cache API responses when appropriate

Troubleshooting

Common Issues

Check that all MDX files have required frontmatter fields and correct data types. Review src/content.config.ts for schema requirements.
You’ve exceeded 60 requests per minute. Wait for the rate limit window to reset or implement request throttling.
Ensure images are in the public/images/ directory and paths start with /images/. Check file permissions and extensions.
Verify search index is built correctly. Check that documents have searchable fields (title, description, tags).

Resources

Astro Documentation

Official Astro framework documentation

Tailwind CSS

Tailwind CSS documentation and guides

MDX

MDX syntax and component usage

Netlify Docs

Netlify deployment and configuration

For technical support or questions, contact the development team at dzalekaconnect@gmail.com