Loading repository dataβ¦
Loading repository dataβ¦
here-tunan / repository
π A feature-rich, full-stack blog engine built with Go (Fiber) and Next.js (React, Ant Design). Includes a powerful admin panel, Markdown support, and is ready to deploy.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A full-stack blog application built with Go and Next.js, featuring a modern, feature-rich admin panel and a clean, responsive public-facing interface.
β¨ Perfect for Low-Spec Servers: This blog system can be fully deployed on minimal server configurations (as low as 1-core, 1GB RAM), making it ideal for developers on a budget or those just starting with self-hosting.
Many developers run their projects on servers with limited resources and may not have MySQL database services available. Since blog systems generally have low database requirements, we support SQLite as a lightweight alternative.
/ui)/zh-CN/blog/... and /en/blog/..., localized UI text, localized article titles/slugs/content, language-aware search, and per-article fallback to the article's default language./ui-admin)zh-CN / en) from the admin panel.To get a local copy up and running, follow these simple steps.
Clone the repository:
git clone https://github.com/your-username/tunan-blog.git
cd tunan-blog
Setup the Database:
blog) and import the table structure:
# Example for MySQL
mysql -u your_user -p your_database < schema.sql
# Example for SQLite
sqlite3 your_database.db < schema_sqlite.sql
Configure and Run the Backend:
env/dev.yaml) with your database credentials and other settings.go run cmd/tunan-blog/main.go
http://localhost:3002.Setup the Public Frontend:
cd ui
npm install
npm run dev
http://localhost:3000.Setup the Admin Panel:
cd ui-admin
npm install
npm run dev
http://localhost:3001.If you're running on a low-spec server (like 1-core, 1GB RAM), you might encounter issues with npm install and npm run build. For solutions to common problems like "npm install ends with 'Killed'", please see this blog post: npm install ends with "Killed".
All backend configuration is managed via YAML files in the /env directory. The application loads dev.yaml by default, or prod.yaml if the GO_TUNAN_BLOG_ENV environment variable is set to prod.
The application supports both SQLite and MySQL databases. You can configure which database to use by setting the database_type field in your configuration file:
# Database type: sqlite3 or mysql
database_type: sqlite3 # or leave empty for default
sqlite3:
file: /path/to/your/database.db
# Database type: sqlite3 or mysql
database_type: mysql
mysql:
host: 127.0.0.1
port: 3306
username: your_username
password: your_password
database: your_database_name
Important Notes:
database_type is not specified or empty, SQLite will be used by defaultschema.sqlschema_sqlite.sqlArticle identity and localized article content are separated:
article stores article-level metadata such as type, default language, view count, like count, deletion state, and timestamps.article_translation stores language-specific fields such as title, slug, Markdown content, SEO fields, publish state, and publish time.Each article can choose its own default language. If a visitor opens a language version that does not exist, the public site falls back to that article's default language. This allows Chinese-first, English-first, and partially translated articles to coexist.
The public UI and command palette search are language-aware. The admin panel provides language tabs for editing translations and server-side pagination for large lists.
Admin login is handled by JWT. You need to configure the password and JWT secret in your .yaml file.
dev.yaml or prod.yaml, set a plaintext password for admin_password and a random string for jwt_secret.
auth:
admin_password: "your-temporary-strong-password"
jwt_secret: "a-very-strong-and-secret-string-for-jwt"
go run cmd/tunan-blog/main.go). The application will detect the plaintext password, automatically hash it using bcrypt, and print the hash in the console logs. The log message will look like this:
IMPORTANT: Please update your dev.yaml with the new hashed password:
auth:
admin_password: "$2a$10$....(a long hash string)..."
$2a$...) from the log and replace your temporary password in the .yaml file. This is your permanent, secure password hash.To verify your ownership of the site with Google Search Console:
ui/app/layout.tsx.<meta name="google-site-verification" content="xxxx"/>
xxxx with your own verification code provided by Google.To configure the Folo RSS reader tracking, update the following fields in your .yaml configuration file under the website key:
website:
# ... other website settings
follow_feed_id: "YOUR_FOLO_FEED_ID"
follow_user_id: "YOUR_FOLO_USER_ID"
The RSS feed is automatically generated with optimized article summaries for better performance:
/rss.xml in the project rootUpdate the social media links in the navigation component (ui/app/components/Navigation.tsx):
For accurate visitor IP tracking behind reverse proxies (nginx):
location /api/ {
proxy_pass http://localhost:3002;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
}
If you want to deploy your blog on your own server, we recommend using Nginx as a reverse proxy. For detailed guidance on Nginx multi-domain configuration and HTTPS certificates, see: Nginxε€εεθ§£ζγhttpsθ―δΉ¦.
A brief overview of the key directories in this project:
.
βββ api/ # Go source code for the backend API
βββ cmd/ # Main application entry point for the backend
βββ internal/ # Backend business logic (services, repositories)
βββ ui/ # Next.js source for the public-facing website
βββ ui-admin/ # Next.js source for the admin panel
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly app