Skip to content

tienledigital/pageel-core

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Pageel Core

Version: 1.0.0 | Updated: December 2025

A powerful, client-side Content Management System (CMS) for managing Markdown/MDX content and images directly on GitHub, Gitea, or Gogs repositories. Built with React 19 and TypeScript, featuring a modern Notion-inspired UI.

Pageel Logo

A modern Git-first CMS for Astro & Next.js

Pageel Dashboard Preview

Quick Links: Changelog β€’ Licenses β€’ Contributing


✨ Key Features

Feature Description
πŸ” No Backend Required Runs entirely in your browser, communicates directly with Git APIs
πŸ”’ Client-Side Encryption PAT encrypted with Web Crypto API (AES-GCM), stored in sessionStorage
🌍 Multi-Platform Support GitHub, Gitea, and Gogs (self-hosted)
🌐 Multi-Language English and Vietnamese (i18n ready)
🎨 Notion-Style UI Clean, minimalist, distraction-free interface
⚑ Optimistic Locking SHA-check prevents overwriting concurrent changes
πŸ”— Deep Linking URL query parameters sync with app state

🧭 Application Modules

1. πŸ“ Manage Posts (PostList)

The central hub for content management.

  • View Modes: Switch between dense data table or visual card grid with cover image previews
  • Smart Search: Instant filtering by title, author, tags, or any frontmatter field
  • Quick Actions:
    • Edit frontmatter properties inline
    • Split-pane Markdown editor with live preview
    • Upload new post file / Replace existing
    • Update cover image
    • Delete posts with confirmation
  • Sorting: Sort by name, date (asc/desc)
  • SHA Validation: Ensures file integrity before updates

2. πŸ–ΌοΈ Manage Images (ImageList)

Dedicated asset library for managing media files.

  • Gallery View: Visual grid with lazy-loaded thumbnails
  • Upload Features:
    • Bulk upload with drag & drop
    • Client-side compression (configurable max size/width)
    • Rename files before upload
  • Quick Actions:
    • View in lightbox with zoom
    • Copy public URL (relative or absolute based on project type)
    • Delete with confirmation
  • Filtering: Search by filename, sort by name/size

3. πŸ“‹ Post Template (TemplateGenerator)

Define and validate content structure.

  • Schema Generation:
    • Upload existing post to auto-generate validation schema
    • Scan repository to select from existing posts
  • Field Types: String, Date, Array, Object, Boolean, Number
  • Table Configuration:
    • Choose which frontmatter fields appear in Posts table
    • Configure column widths (percentage-based)
    • Max 5 visible columns
  • Sample Download: Export blank Markdown template with defined frontmatter

4. πŸ”„ Post Workflow (PostWorkflow)

Guided 3-step wizard for creating quality content.

Step 1 - Assets:

  • Bulk upload images with preview
  • Auto-compression based on settings
  • Rename images before commit

Step 2 - Content:

  • Upload Markdown file
  • Automatic frontmatter validation against template
  • Smart image path detection and mapping
  • Link uploaded images to frontmatter fields (e.g., image, cover)
  • Update body image references automatically

Step 3 - Publish:

  • Review all changes
  • Commit images first, then post
  • Customizable commit message templates
  • Success confirmation with quick actions

5. πŸ’Ύ Backup (BackupManager)

Data safety and export tools.

  • Archive Downloads:
    • Generate .zip of entire posts directory
    • Generate .zip of entire images directory
    • File size display before download
  • Config Export:
    • Download .acmrc.json configuration file from repository

6. βš™οΈ Settings (SettingsView)

Global application configuration.

Project Configuration:

Setting Description
Project Type "Web Project" (Astro/Next.js with domain) or "File Library" (raw GitHub links)
Posts Path Directory containing Markdown/MDX files
Images Path Directory containing media assets
Domain URL Production URL for asset links (Web Project mode)

Content Settings:

Setting Description
Post File Types Extensions to include (e.g., md,mdx)
Image File Types Extensions to include (e.g., jpg,png,webp,gif,svg)
Publish Date Source Use file date or system date for new posts

Image Optimization:

Setting Description
Compression Enabled Toggle client-side image compression
Max File Size Maximum KB before compression triggers
Max Width Resize images exceeding this width

Commit Templates:

Template Default Value
New Post Add: {filename}
Update Post Update: {filename}
New Image Add image: {filename}
Update Image Update image: {filename}

Other Options:

  • Import/Export local settings as JSON
  • Sync settings to .acmrc.json in repository
  • Delete remote config file
  • Language switcher (EN/VI)
  • Logout with optional settings reset

πŸ—οΈ Technical Architecture

Project Structure

pageel-core/
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.tsx             # Main application entry point
β”‚   β”‚   β”œβ”€β”€ index.tsx           # React DOM render
β”‚   β”‚   β”œβ”€β”€ types.ts            # TypeScript interfaces & types
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx       # Main layout with sidebar navigation
β”‚   β”‚   β”‚   β”œβ”€β”€ GitServiceConnect.tsx   # Login form component
β”‚   β”‚   β”‚   β”œβ”€β”€ SetupWizard.tsx     # Initial configuration wizard
β”‚   β”‚   β”‚   β”œβ”€β”€ PostList.tsx        # Posts management module
β”‚   β”‚   β”‚   β”œβ”€β”€ PostDetailView.tsx  # Single post editor
β”‚   β”‚   β”‚   β”œβ”€β”€ ImageList.tsx       # Images management module
β”‚   β”‚   β”‚   β”œβ”€β”€ TemplateGenerator.tsx   # Schema configuration
β”‚   β”‚   β”‚   β”œβ”€β”€ PostWorkflow.tsx    # New post creation wizard
β”‚   β”‚   β”‚   β”œβ”€β”€ BackupManager.tsx   # Backup/export tools
β”‚   β”‚   β”‚   β”œβ”€β”€ SettingsView.tsx    # Application settings
β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.tsx         # Navigation sidebar
β”‚   β”‚   β”‚   └── icons/              # 42 SVG icon components
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”œβ”€β”€ baseGitService.ts   # Shared Git service logic
β”‚   β”‚   β”‚   β”œβ”€β”€ baseGiteaService.ts # Gitea/Gogs shared adapter
β”‚   β”‚   β”‚   β”œβ”€β”€ githubService.ts    # GitHub API adapter
β”‚   β”‚   β”‚   β”œβ”€β”€ giteaService.ts     # Gitea API adapter
β”‚   β”‚   β”‚   └── gogsService.ts      # Gogs API adapter
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”‚   β”œβ”€β”€ crypto.ts           # Web Crypto API utilities (AES-GCM)
β”‚   β”‚   β”‚   β”œβ”€β”€ image.ts            # Image compression & validation
β”‚   β”‚   β”‚   └── parsing.ts          # Markdown/frontmatter parsing
β”‚   β”‚   β”‚
β”‚   β”‚   └── i18n/
β”‚   β”‚       β”œβ”€β”€ I18nContext.tsx     # React i18n context provider
β”‚   β”‚       └── translations.ts     # EN/VI translation strings
β”‚   β”‚
β”‚   β”œβ”€β”€ index.html              # HTML shell with CDN dependencies
β”‚   β”œβ”€β”€ vite.config.ts          # Vite development configuration
β”‚   β”œβ”€β”€ tsconfig.json           # TypeScript configuration
β”‚   └── package.json            # Dependencies
β”‚
β”œβ”€β”€ docs/
β”‚   └── guides/
β”‚       β”œβ”€β”€ CONTRIBUTING.md     # Contribution guidelines
β”‚       └── DEVELOPMENT.md      # Development guide
β”‚
β”œβ”€β”€ README.md
β”œβ”€β”€ CHANGELOG.md
└── LICENSES.md

Core Design Patterns

1. Adapter Pattern (IGitService Interface)

interface IGitService {
  getRepoContents(path: string): Promise<ContentInfo[]>;
  listFiles(path: string): Promise<RepoTreeInfo[]>;
  getFileContent(path: string): Promise<string>;
  uploadFile(path, file, commitMessage, sha?): Promise<any>;
  createFileFromString(path, content, commitMessage): Promise<any>;
  updateFileContent(path, content, commitMessage, sha): Promise<any>;
  deleteFile(path, sha, commitMessage): Promise<any>;
  getFileAsBlob(path: string): Promise<Blob>;
  // ... discovery methods
}
  • GithubAdapter - GitHub REST API v3
  • GiteaAdapter - Gitea API (self-hosted)
  • GogsAdapter - Gogs API (self-hosted)

2. Security Model

  • PAT encrypted with AES-GCM (256-bit key)
  • Key generated per session via crypto.getRandomValues()
  • Encrypted token stored in sessionStorage (cleared on tab close)
  • Key stored separately as exported JWK

3. State Management

Location Data
sessionStorage Encrypted PAT, crypto key, selected repo, service type
localStorage Settings (keyed by repo: postsPath_{repo}, projectType_{repo}, etc.)
URL Query String Active view/tab (?view=posts, ?view=images)
Remote .acmrc.json Repository-synced configuration file

4. Performance Optimizations

  • Git Tree API (Recursive): Fetches entire directory tree in single request
  • Lazy Loading: Images loaded on scroll (IntersectionObserver)
  • Blob Fetching: Private repo images fetched via authenticated API
  • Optimistic Locking: SHA validation before all write operations

πŸš€ Getting Started

Prerequisites

  • Modern browser with ES2020+ support
  • Node.js 20.19+ or 22.12+ (for development)
  • Git repository on GitHub, Gitea, or Gogs

1. Clone & Install

git clone https://github.com/pageel/pageel-core.git
cd pageel-core/core
npm install

2. Run Development Server

npm run dev

Open http://localhost:3000 in your browser.

3. Generate Access Token

For GitHub:

  1. Go to GitHub Token Settings
  2. Create a Fine-Grained Personal Access Token
  3. Select your repository
  4. Grant Contents permission (Read and write)

For Gitea/Gogs:

  1. Navigate to Settings β†’ Applications β†’ Generate Token
  2. Copy the access token

4. Connect Repository

  1. Select your Git service (GitHub/Gitea/Gogs)
  2. Enter repository URL (e.g., username/repo or full URL)
  3. Paste your access token
  4. For self-hosted: Enter instance URL (e.g., https://git.example.com)

5. Initial Setup Wizard

  1. Follow the file tree explorer to select your content directory
  2. Select your images directory
  3. Choose project type (Web Project or File Library)
  4. Configuration is saved locally and optionally synced to repository

πŸ”§ Development

Available Scripts

Command Description
npm run dev Start Vite development server (port 3000)
npm run build Build production bundle
npm run preview Preview production build locally

Technology Stack

Category Technology
Framework React 19
Language TypeScript 5.9+
Build Tool Vite 5+
Styling Tailwind CSS (CDN with Typography plugin)
Icons Custom SVG components (42 icons)
Fonts Inter (Google Fonts)

CDN Dependencies

Library Purpose
marked Markdown to HTML parsing
DOMPurify HTML sanitization
JSZip ZIP archive generation
js-yaml YAML frontmatter parsing

πŸ“… Roadmap

Version 1.1 (Planned)

  • WYSIWYG Markdown Editor: Rich-text editing for non-technical users
  • Image Gallery in Editor: Insert images directly from asset library

Future Enhancements

  • GitLab Support
  • Draft Mode with local auto-save
  • Scheduled Publishing
  • Social Sharing integration

🀝 Contributing

Contributions are welcome! Please see our Contributing Guide for details.

Quick Start

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Reporting Issues

  • Use GitHub Issues
  • Include browser version and console errors
  • Describe steps to reproduce

πŸ“„ License

This project is licensed under the MIT License. See the LICENSES.md file for more details on third-party software.


Made with ❄️ by Pageel

About

A Git-based CMS for Astro & Next.js - Manage Markdown content directly on GitHub repositories.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.3%
  • Other 1.7%