Skip to content

VoidLayer9/VibeLog

Repository files navigation

VibeLog

VibeLog is a minimalist, industrial-aesthetic blog engine built on the Cortex C sandbox template. It operates as a single-file application (app.c) that handles everything from HTTP serving to JSON parsing and database management, without external runtime dependencies beyond libc.

Designed for "vibecoding" — programming with intent and aesthetic precision — VibeLog features a dark, brutalist interface inspired by high-performance terminals and dashboards.

Features

  • Single-File Architecture: All logic resides in app.c.
  • JSON File-Based Database: No SQL required; data is stored in structured JSON files.
  • Built-in HTTP Server: Custom router handling articles, authors, and static assets.
  • CLI Management: Tools for synchronization (upload/download) and server control.
  • Dynamic Metrics: Tracks views per article and category in real-time.
  • Markdown/HTML Content: Articles support rich HTML content.

Installation & Setup

Pre-compiled Binaries (Recommended)

Download the latest pre-compiled version for your platform from the Releases page.

Build from Source

  1. Clone the Repository

    git clone https://github.com/your-username/vibelog.git
    cd vibelog
  2. Compile Use standard GCC or Clang:

    gcc main.c -o vibelog

    Advanced Builds:

    Ensure you have Darwin installed. For cross-compilation targets, Docker or Podman is required.

    • Static Linux Binary (Runs on any distro):

      darwin run_blueprint --target static_linux --provider docker
    • Windows Executable (.exe):

      darwin run_blueprint --target windows --provider docker
    • Debian Package (.deb):

      darwin run_blueprint --target deb --provider docker
    • RPM Package (.rpm):

      darwin run_blueprint --target rpm --provider docker
    • Debug Mode (Hot Reload):

      darwin run_blueprint --target debug --compiler "gcc"
  3. Initialize Database The application expects a database/ directory structure. See Database Structure below or refer to prompts/1.database_creation.md for a complete setup guide.


Usage

VibeLog includes a CLI for starting the server and managing content synchronization.

1. Start the Server

Run the blog locally or in production:

./vibelog start --port 8080 --root-password secret_pass [--database-path ./database]
  • --port: Port to listen on (default: 8080).
  • --root-password: Admin password for API operations (required).
  • --database-path: Path to the database folder (optional, default: ./database).

2. Synchronization (Upload/Download)

Manage specific resources using dedicated commands. All commands require --url and --root-password. The --database-path is optional (default: ./database).

Available Commands:

  • upload-articles / download-articles
  • upload-authors / download-authors
  • upload-metrics / download-metrics
  • upload-config / download-config

Example: Upload Articles

./vibelog upload-articles --url http://remote-server:8080 --root-password secret_pass

Example: Download Config

./vibelog download-config --url http://remote-server:8080 --root-password secret_pass

Creating Content

1. Articles

Articles are stored in database/articles/DD-MM-YYYY/<article_id>/.

Structure:

  • data.json: Metadata (title, summary, tags).
  • content/en.html: The HTML body of the article.
  • assets/thumbnail.jpg: Cover image.

Example data.json:

{
    "title": "My New Article",
    "summary": "A short summary for the card view.",
    "author_id": "author_folder_name",
    "thumbnail": "assets/thumbnail.jpg",
    "categories": ["tech", "tutorial"]
}

2. Authors

Authors are stored in database/authors/<author_id>/.

Structure:

  • data.json: Profile info.
  • assets/picture.jpg: Profile picture.

Example data.json:

{
    "name": "Jane Doe",
    "description": "Tech enthusiast and writer.",
    "picture": "assets/picture.jpg"
}

3. Categories

Edit database/categorys.json to manage categories globally.

Example:

[
    {
        "name": "Tech",
        "navbar": true,
        "description": "Technology articles"
    }
]

Database Structure

The project relies on a strict filesystem hierarchy:

database/
├── config/                 # Configuration & Assets
│   ├── categorys.json      # Global category definitions
│   ├── style.css           # Global styles
│   └── about.html          # About page content
├── articles/               # Article content
│   └── DD-MM-YYYY/
│       └── <article_id>/
│           ├── data.json
│           ├── content/en.html
│           └── assets/thumbnail.jpg
├── authors/                # Author profiles
│   └── <author_id>/
│       ├── data.json
│       └── assets/picture.jpg
├── metrics/                # View analytics (auto-generated)
└── pages/                  # (Empty/Deprecated)

For detailed schema specifications, see prompts/2.project.md.


Development History

This project was built using Cortex, a C sandbox template for LLM-driven development.