Skip to content

Latest commit

 

History

History
247 lines (184 loc) · 10.6 KB

README_en.md

File metadata and controls

247 lines (184 loc) · 10.6 KB

Jank

Jank, a lightweight blogging system, developed using Go language and the Echo framework, emphasizes minimalism, low coupling, and high scalability.

Stars   Forks   Contributors   Issues   Pull Requests   License

Simplified Chinese | English


Jank is a lightweight blogging system, developed using Go language and the Echo framework, designed with a focus on minimalism, low coupling, and high scalability. It aims to provide users with a feature-rich, simple, and secure blogging experience.

Note: This project currently lacks a front-end component. We invite developers interested in front-end development to join and contribute to the project. We look forward to your valuable feedback and contributions!

Quick Overview

👉 Demo Site: https://fenderisfine.icu

👉 【Jank Blog System】New Technology Stack and UI

👉 Front-end Repository: https://github.com/Done-0/Jank-website

home-page.png posts-page.png post1-page.png post2-page.png

Note: Since the project is in its early stages, some configuration files may need to be adjusted according to actual requirements. Please contact the author using the information below, or join the developer community for further discussions.

Technology Stack

  • Go Language: A popular back-end development language, suitable for building high-concurrency applications.
  • Echo Framework: A high-performance web framework that supports rapid development and flexible routing management.
  • PostgreSQL: An open-source relational database offering high performance and reliability for data storage.
  • Redis: A popular caching solution that offers fast data access and persistence options.
  • JWT: A secure user authentication mechanism to ensure the integrity and security of data transmission.
  • Docker: A containerization deployment tool that simplifies application packaging and distribution.
  • Frontend: React + Umi + Shadcn/ui + TailwindCSS.

Feature Modules

  • Account Module: Implements JWT authentication, supporting user login, registration, logout, password modification, and personal information updates.
  • Permission Module: Implements RBAC (Role-Based Access Control) for role permission management, supporting CRUD operations for users, roles, and permissions.
    • Basic features are implemented, but due to the complexity and user-friendliness concerns, this feature is not yet released.
  • Article Module: Provides functionality for creating, viewing, updating, and deleting articles.
  • Category Module: Supports recursive queries for category trees and subcategory trees, single category queries, and category creation, updating, and deletion.
  • Comment Module: Provides functionality for creating, viewing, deleting, and replying to comments, supporting tree structures for comment display.
  • Plugin System: Actively under development, coming soon...
  • Other Features:
    • Provides OpenAPI documentation
    • Integrates Air for hot reloading
    • Uses Logrus for logging
    • Supports CORS for cross-origin requests
    • Provides CSRF and XSS protection
    • Supports server-side rendering for Markdown
    • Other modules are under development, feedback and suggestions are welcome!

Local Development

  1. Install Dependencies:

    # Install swagger tool
    go install github.com/swaggo/swag/cmd/swag@latest
    
    # Install dependencies
    go mod tidy
  2. Configure Database and Email:
    Modify the database and email configurations in the configs/config.yaml file as shown below:

    database:
      DB_DIALECT: "postgres" # Database type, options: postgres, mysql, sqlite
      DB_NAME: "jank_db"
      DB_HOST: "127.0.0.1" # Change to "postgres_db" if using Docker
      DB_PORT: "5432"
      DB_USER: "<DATABASE_USER>"
      DB_PSW: "<DATABASE_PASSWORD>"
      DB_PATH: "./database" # SQLite database file path
    
    # Email type and SMTP authorization code (optional)
    EMAIL_TYPE: "qq" # Email type, options: qq, gmail, outlook
    FROM_EMAIL: "<FROM_EMAIL>" # Sender email
    EMAIL_SMTP: "<EMAIL_SMTP>" # SMTP authorization code
  3. Start the Service:
    Use the following command to start the application:

    go run main.go

    Or use Air for hot reloading:

    This method is the most convenient, but make sure to configure the GOPATH environment variable beforehand.

    # Install Air (requires Go 1.22 or higher)
    go install github.com/air-verse/air@latest
    
    # Start with hot reloading
    air -c ./configs/.air.toml
  4. Access the Interface:
    After starting the application locally, access it via the browser at http://localhost:9010/ping

Docker Container Deployment (PostgreSQL)

  1. Modify the database and email configurations in the configs/config.yaml file as shown below:

    APP_HOST: "0.0.0.0" # Change to "0.0.0.0" if using Docker
    
    database:
      DB_DIALECT: "postgres" # Database type, options: postgres, mysql, sqlite
      DB_NAME: "jank_db"
      DB_HOST: "postgres_db" # Change to "postgres_db" if using Docker
      DB_PORT: "5432"
      DB_USER: "<DATABASE_USER>"
      DB_PSW: "<DATABASE_PASSWORD>"
      DB_PATH: "./database" # SQLite database file path
    
    # Email type and SMTP authorization code (optional)
    EMAIL_TYPE: "qq" # Email type, options: qq, gmail, outlook
    FROM_EMAIL: "<FROM_EMAIL>" # Sender email
    EMAIL_SMTP: "<EMAIL_SMTP>" # SMTP authorization code
  2. Modify the environment variables in the docker-compose.yaml file as shown below:

    environment:
      - POSTGRES_USER=<DATABASE_USER>
      - POSTGRES_PASSWORD=<DATABASE_PASSWORD>
  3. Start the container:

    docker-compose up -d

API Documentation

  1. View Swagger Documentation Locally: After starting the application locally, access the Swagger documentation at http://localhost:9010/swagger/index.html

  2. README.md Documentation: Open the README.md file in the docs directory.

  3. Postman Documentation: Import the docs/Jank_blog.postman_collection.json file into Postman to view.

Roadmap (New Release)

image.png

Note: Black represents completed features, white represents pending features.

Architecture Diagram (To Be Updated)

Architecture Diagram and Visual API Documentation: Open the docs/jank_blog_architecture.drawio file in the project root directory.

Note: This document was created using draw.io and requires the draw.io tool to view.

Official Community

If you have any questions or suggestions, feel free to join the official community for discussions.

Official Community

Special Thanks

We sincerely thank every sponsor for their support of the open-source community!

Contact and Cooperation

Contributors List

Contributors List

Code Statistics

Primary Language Code Size Last Commit Commit Frequency

Detailed Statistics

Language Files Code Lines Comment Lines Blank Lines Percentage
Go 82 3342 664 669 92.3%
Docker 1 16 14 13 0.4%
YAML 3 227 21 32 6.3%
Markdown 1 1 0 0 0.0%
Others 1 36 0 6 1.0%
Total 88 3622 699 720 100%

Note: Statistics are automatically updated by GitHub Actions, last updated on 2025-03-20 Excluded docs, tmp directories and go.mod, go.sum, LICENSE, .gitignore, .dockerignore, README.md, README_en.md files

License

This project is licensed under the MIT License.

Growth Trends

GitHub Stats