Project Overview
The Blog Marketing Platform is a modern, full-featured content management and marketing platform built with Astro, React, and TypeScript. The architecture follows a hybrid approach, leveraging Astro’s static site generation capabilities while using React for interactive components.Tech Stack
Frontend Framework
Astro 5.13.3 - Multi-page application with static generation
UI Library
React 19 - Interactive components and state management
Type Safety
TypeScript - Full type safety across the application
Styling
Tailwind CSS 4 - Utility-first CSS framework
Core Dependencies
- Framework
- UI & Styling
- State & Forms
- Rich Content
Project Structure
Complete Folder Structure
Complete Folder Structure
Key Directories Explained
/src/components/ - React Components
/src/components/ - React Components
All React components are organized by feature:
- admin/ - Admin dashboard UI (posts, users, analytics)
- ui/ - Reusable components (Button, Input, Modal, Card)
- layout/ - Header, Footer, navigation
- editor/ - MDX editor for creating posts
- profile/ - User profile and settings forms
/src/pages/ - Astro Pages (Routing)
/src/pages/ - Astro Pages (Routing)
Astro uses file-based routing:
index.astro→/blog/index.astro→/blogblog/[slug].astro→/blog/:slug(dynamic)admin/posts/index.astro→/admin/posts
.astro file can contain frontmatter, components, and HTML./src/services/ - API Layer
/src/services/ - API Layer
Service modules handle all backend communication:
authService.ts- Authentication (login, register)postsService.ts- Posts CRUD and advanced queriesusersService.ts- User managementcommentsService.ts- Comments systemrbacService.ts- Roles and permissions
/src/config/ - Configuration
/src/config/ - Configuration
api.ts- API endpoints, base URL, mock/real API toggle- Environment variables via
.env.local
Architecture Patterns
1. Hybrid Rendering
2. Client Directives
Astro components are static by default. Use client directives for interactivity:3. Service Layer Pattern
All API calls go through service modules with mock/real API switching:Build Configuration
- Astro Config
- TypeScript Config
astro.config.mjs
Performance Optimizations
Code Splitting
Automatic code splitting by route and manual chunks for large dependencies
Image Optimization
Lazy loading and responsive images with proper sizing
CSS Optimization
Purged unused CSS, critical CSS inlining
Bundle Analysis
Vendor chunks separated (React, charts, icons, motion)
The application uses static site generation (SSG) by default for optimal performance. Dynamic features are handled client-side with React.
Environment Configuration
Create a.env.local file in the project root:
.env.local
Development Workflow
Next Steps
Services Layer
Learn about the API service architecture
Components
Explore the component structure
State Management
Understand Zustand stores and state
API Reference
View the complete API documentation