repository
0.0.0-20241119210921-f71f0f3d661e
Repository: https://github.com/deej-tsn/blog-go.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# README
Blog Application
Table of Contents
About
A lightweight and dynamic blog application built using Golang, Templ for templating, and HTMX for seamless interactivity without JavaScript frameworks.
Features
- Responsive Design: Designed to work on various devices.
- Dynamic Interactions: Powered by HTMX for modern, AJAX-style requests.
- Templated Views: Leverages Templ for server-side rendering with clean, type-safe templates.
- CRUD Functionality: Create, read, update, and delete blog posts.
- Golang Backend: Fast and reliable server written in Go.
How To Build
Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.
Prerequisites
- Golang (v1.23+)
- Templ (v0.2.793+)
- Docker (v26.1.4+)
- Air (v1.61.1+) - for hot reloading when developing
Installation
-
Clone the repository:
git clone https://github.com/deej-tsn/blog-go.git cd blog-app
-
Install dependencies:
go mod tidy
-
Configure your environment:
- Copy the
.env.example
file and rename it to.env
. - Modify the
.env
file with your database credentials and other configurations.
- Copy the
-
Add Markdown files to data/posts/ folder
-
Start the application:
go run main.go
-
Open the application in your browser:
http://localhost:8080
Project Structure
blog-go/
├── cmd/
├── data
│ └── posts/
├── Dockerfile
├── go.mod
├── go.sum
├── internal
│ ├── helper
│ │ └── render.go
│ ├── models
│ │ └── models.go
│ └── routes
│ └── controller.go
├── Makefile
├── README.md
└── web
├── components/
└── public
├── assets/
├── css/
└── scripts/
Technologies Used
- Golang: For backend development.
- Templ: For type-safe and concise server-side templates.
- HTMX: To add modern AJAX-like interactions with minimal JavaScript.
- Docker :
Usage
- Access the homepage to view all blog posts.
- Click on post to be view the full file.
Development
To make changes to the application:
- Modify templates in the
components/
directory. - Update routes in the
routes/
directories. - Use
htmx
attributes in templates to add interactivity without extra JavaScript.
Documentation
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch:
git checkout -b feature-name
. - Commit your changes:
git commit -m "Add feature name"
. - Push to the branch:
git push origin feature-name
. - Open a Pull Request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Made with ❤️ using Golang, Templ, and HTMX.