Skip to content

Architecture

This chapter provides a high-level overview of the concept LightNet uses to build media sites. It explores the principle of static site generation and explains why and how this approach is used by LightNet.

LightNet utilizes static site generation (SSG) to create media sites. SSG is a method of pre-building a website by converting raw content (e.g., Markdown, JSON, or YAML files) into static HTML, CSS, and JavaScript files. This process involves:

  1. Content and Data - Website content is stored in structured, easily manageable files.
  2. Templates - Predefined layouts determine the visual structure of each page.
  3. Build Process - A build command compiles content and templates into fully rendered static files.
  4. Deployment - These static files are then hosted on a web server or distributed via a Content Delivery Network (CDN).

SSG provides advantages that make it an ideal choice for LightNet-powered sites:

  • Simplified Deployment - Traditional web applications run on backend infrastructure including web servers and database servers. LightNet sites consist of simple static files hosted on a file server or CDN, significantly reducing architectural complexity.
  • Faster Performance - Pages are pre-rendered during the build process, eliminating unnecessary rerendering and reducing data transmission.
  • Enhanced Security - Without a backend application, the attack surface is significantly reduced, lowering the risk of hacks.
  • Lower Maintenance - Static files are more reliable than backend applications, which can crash or require frequent updates.
  • Minimal Hosting Costs - Hosting static files is extremely affordable, with some providers offering free hosting options.

While SSG has many advantages, it also has limitations:

  • No Dynamic Content - LightNet does not support personalized content or user-based media permissions out of the box.
  • Limited Interactivity - Highly interactive features like real-time chats and comment sections require external solutions.

However, LightNet offers flexibility by allowing the integration of dynamic components when needed.

LightNet builds upon existing SSG tools and streamlines the process:

  1. Content and Data - LightNet defines a structured format for media content, stored as plain text files. This ensures easy import/export compatibility with other systems.
  2. Templates - Prebuilt layouts and UI components speed up development and provide a professional appearance out of the box.
  3. Build Process - LightNet leverages state-of-the-art tools to transform data and templates into a fully functional static media site.
  4. Deployment - LightNet provides deployment guidance, ensuring that sites remain infrastructure-agnostic. If users need recommendations, LightNet suggests best-practice hosting solutions.

The following chapters go into the details of these different aspects.