Skip to content

genfuru011/My-portfolio-Staticle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Staticle - Modern Blog Platform

A modern, lightweight, and interactive blog platform built with Flask, HTMX, and TailwindCSS. Optimized for easy deployment on Render.

πŸš€ Features

  • Lightning Fast: HTMX provides instant interactions without SPA complexity
  • Simple & Reliable: Flask backend with proven stability
  • Beautiful Design: TailwindCSS with dark mode support
  • Developer Friendly: Clean Python code with modular architecture
  • Interactive: Smooth filtering and dynamic content loading
  • SEO Friendly: Server-side rendering with progressive enhancement
  • Easy Deployment: Ready for Render with one-click deployment

πŸ›  Tech Stack

Frontend

  • HTMX - Dynamic HTML interactions
  • TailwindCSS - Utility-first CSS framework
  • Alpine.js - Minimal JavaScript for interactivity

Backend

  • Flask - Simple and reliable Python web framework
  • Gunicorn - Production WSGI server
  • Jinja2 - Template engine
  • Python-Frontmatter - Markdown with metadata support

Deployment

  • Render - Cloud hosting platform
  • Gunicorn - Production server

πŸ“ Project Structure

staticle/
β”œβ”€β”€ app.py                  # Flask application (main entry point)
β”œβ”€β”€ Procfile               # Render deployment config
β”œβ”€β”€ runtime.txt            # Python version specification
β”œβ”€β”€ requirements.txt        # Python dependencies
β”œβ”€β”€ scripts/               # Build and development scripts
β”‚   β”œβ”€β”€ start.sh          # Development server
β”‚   β”œβ”€β”€ setup.sh          # Environment setup
β”‚   β”œβ”€β”€ build.sh          # Production build
β”‚   └── deploy-render.sh  # Render deployment
β”œβ”€β”€ core/                  # Core application modules
β”‚   β”œβ”€β”€ __init__.py       # Package initialization
β”‚   β”œβ”€β”€ blog_manager.py   # Blog content management
β”‚   β”œβ”€β”€ config.py         # Application configuration
β”‚   └── utils.py          # Utility functions
β”œβ”€β”€ views/                 # Template files
β”‚   β”œβ”€β”€ base.html         # Base template
β”‚   β”œβ”€β”€ index.html        # Homepage
β”‚   β”œβ”€β”€ blog.html         # Blog listing
β”‚   β”œβ”€β”€ blog_post.html    # Individual post
β”‚   β”œβ”€β”€ portfolio.html    # Portfolio page
β”‚   β”œβ”€β”€ 404.html          # Error page
β”‚   └── components/       # Reusable components
β”œβ”€β”€ assets/               # Static files
β”‚   β”œβ”€β”€ js/              # JavaScript files
β”‚   └── img/             # Images
└── content/             # Blog content
    └── posts/           # Markdown blog posts

πŸš€ Quick Start

Local Development

# Clone the repository
git clone <your-repository-url>
cd staticle

# Set up development environment
chmod +x scripts/*.sh
./scripts/setup.sh

# Start development server
./scripts/start.sh

Manual Setup

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Start Flask development server
python app.py

Access Points

πŸ“ Adding Content

Create markdown files in content/posts/ with frontmatter:

---
title: "Your Post Title"
date: 2025-06-16
category: "Technology"
tags: ["python", "web", "htmx"]
excerpt: "A brief description of your post"
---

# Your Post Content

Write your content in markdown here...

🎨 Architecture Highlights

HTMX Integration

  • Dynamic content loading without page refreshes
  • Progressive enhancement approach
  • Server-side rendering with client-side interactions

Flask Benefits

  • Simple and reliable Python framework
  • Easy to understand and maintain
  • Extensive ecosystem and community support
  • Perfect for content-driven websites

Modular Design

  • Clean separation of concerns
  • Reusable components in core/ directory
  • Easy to extend and maintain

οΏ½ Deployment

Render (Recommended)

  1. Connect Repository: Link your GitHub repository to Render
  2. Auto-Deploy: Render will automatically detect the Flask app
  3. Environment: Python 3.11.0 (specified in runtime.txt)
  4. Build Command: pip install -r requirements.txt
  5. Start Command: gunicorn app:app (from Procfile)

Manual Deployment Script

# Deploy to Render
./scripts/deploy-render.sh

Production Build Validation

# Test production build locally
./scripts/build.sh

πŸ”§ Development

Adding New Features

  1. Backend: Add routes in app.py
  2. Core Logic: Create modules in core/ directory
  3. Frontend: Create templates in views/
  4. Components: Add HTMX components in views/components/
  5. Styling: Use TailwindCSS classes
  6. Content: Add markdown files to content/posts/

Project Scripts

# Development server
./scripts/start.sh

# Environment setup
./scripts/setup.sh

# Production build test
./scripts/build.sh

# Deploy to Render
./scripts/deploy-render.sh

πŸ§ͺ Testing

# Start development server
python app.py

# Test blog functionality
curl http://localhost:5001/blog

# Test individual post
curl http://localhost:5001/blog/your-post-slug

πŸ”„ Migration Notes

This project has been migrated from FastAPI to Flask for:

  • Simpler deployment on Render
  • Better compatibility with traditional hosting
  • Easier maintenance and understanding
  • Faster development cycle

πŸ“„ License

MIT License - see LICENSE file for details.

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ›Ÿ Support

  • Create an issue for bug reports
  • Discussions for feature requests
  • Check existing issues before creating new ones

Built with ❀️ using Flask, HTMX, and TailwindCSS. Ready for deployment on Render.

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •