Skip to content

whalelogic/terraincloudnito

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ—ΊοΈ Terra-In-Cloudnito 🧭🏜️🏝️

πŸƒ A modern blog application built with a powerful Go stack, designed for speed and simplicity. This project serves blog posts written in Markdown from a local JSON file, providing a fast, server-rendered experience with a clean, responsive design.

Features πŸ§œπŸΌβ€β™€οΈ

  • Markdown-Powered: Blog posts are written in simple Markdown and stored in a allposts.json file.

  • Server-Side Rendering: Uses Templ for type-safe, component-based HTML rendering directly on the server.

  • High-Performance Backend: Built on Fiber, a Go web framework designed for high performance and low memory allocation.

  • Beautifully Styled: Styled with Tailwind CSS for a modern, utility-first design that is fully responsive.

  • Dynamic Content:

  • An archive page that lists all available blog posts.

  • Dynamic routes to render individual blog posts.

  • Fast Markdown Parsing: Leverages Goldmark for extremely fast and extensible Markdown-to-HTML conversion.

Tech Stack πŸ₯ž

  • Backend: Go
  • Web Framework: Fiber
  • Templating: Templ
  • Styling: Tailwind CSS
  • Markdown Parser: Goldmark
  • File conversion: Python,

Project Structure πŸ›€οΈ

.
β”œβ”€β”€ handlers/         # Fiber request handlers
β”œβ”€β”€ models/           # Go struct definitions (e.g., Post)
β”œβ”€β”€ components/       # Templ components and HTML fragments (buttons)
β”œβ”€β”€ static/           # Static assets (CSS, images)
β”œβ”€β”€ services/         # API's for internal and database (fetch posts)
β”œβ”€β”€ templates/        # Templ components (.templ files)
β”œβ”€β”€ allposts.json     # Data source for blog posts
β”œβ”€β”€ post_util.py      # Add, modify or delete posts (allposts.json)
β”œβ”€β”€ go.mod            # Go module dependencies  (github.com/gofiber/fiber/v2)
β”œβ”€β”€ go.sum            # Go check-sum validations (go.mod)
└── main.go           # Application entry point

Getting Started

Follow these instructions to get a copy of the project up and running on your local machine.

Prerequisites

Make sure you have the following installed:

  • Go (version 1.21 or later)

  • Templ CLI

  • Tailwind CSS CLI (via npm)


Installation πŸ€–

Clone the repository:

git clone https://github.com/your-username/templ-go.git
cd templ-go

Generate Templ Components:

The templ CLI watches for changes and generates Go code from your .templ files.

templ generate --watch

Install Go dependencies:

go mod tidy

Build Tailwind CSS:

Run the Tailwind CLI to build your input.css or just use the CDN πŸŒͺ️
npx tailwindcss -i ./static/css/input.css -o ./static/css/output.css --watch
CDN ⬇️
<script>https://cdn.tailwindcss.com</script>

Run the application: πŸš€

Open a new terminal window and run the main Go program.

go run .

The server will be running on http://localhost:8080.

Screenshots

Blog Homepage Blog Post View

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Terra-In-Cloudnito 🧭 A blog app that I use for showcasing my latest projects and ideas.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published