Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

openRin/Rin

Cover

English | 简体中文

GitHub commit activity GitHub branch check runs GitHub top language GitHub License GitHub Actions Workflow Status

Discord Telegram

Introduction

Rin is a modern, serverless blog platform built entirely on Cloudflare's developer platform: Pages for hosting, Workers for serverless functions, D1 for SQLite database, and R2 for object storage. Deploy your personal blog with just a domain name pointed to Cloudflare—no server management required.

Live Demo

https://xeu.life

Features

  • Authentication & Management: GitHub OAuth login. The first registered user becomes an administrator, while subsequent users join as regular members.
  • Content Creation: Write and edit articles with a rich, intuitive editor.
  • Real-time Autosave: Local drafts are saved automatically in real-time, with isolation between different articles.
  • Privacy Control: Mark articles as "Visible only to me" for private drafts or personal notes, synchronized across devices.
  • Image Management: Drag-and-drop or paste images to upload directly to S3-compatible storage (e.g., Cloudflare R2), with automatic link generation.
  • Custom Slugs: Assign friendly URLs like https://yourblog.com/about using custom article aliases.
  • Unlisted Posts: Option to keep articles out of the public homepage listing.
  • Blogroll: Add links to friends' blogs. The backend automatically checks link availability every 20 minutes.
  • Comment System: Reply to comments or moderate them with delete functionality.
  • Webhook Notifications: Receive real-time alerts for new comments via configurable webhooks.
  • Featured Images: Automatically detect the first image in an article and use it as the cover image in listings.
  • Tag Parsing: Input tags like #Blog #Cloudflare and have them automatically parsed and displayed.
  • Type Safety: End-to-end type safety with shared TypeScript types between client and server via @rin/api package.
  • ...and more! Explore all features at https://xeu.life.

Documentation

Quick Start

# 1. Clone the repository
git clone https://github.com/openRin/Rin.git && cd Rin

# 2. Install dependencies
bun install

# 3. Configure environment variables
cp .env.example .env.local
# Edit .env.local with your own configuration

# 4. Start the development server
bun run dev

Visit http://localhost:5173 to start hacking!

Testing

Run the test suite to ensure everything works:

# Run all tests (client + server)
bun run test

# Run server tests only
bun run test:server

# Run tests with coverage
bun run test:coverage

One-Command Deployment

Deploy both frontend and backend to Cloudflare with a single command:

# Deploy everything (frontend + backend)
bun run deploy

# Deploy only backend
bun run deploy:server

# Deploy only frontend
bun run deploy:client

Required environment variables:

  • CLOUDFLARE_API_TOKEN - Your Cloudflare API token
  • CLOUDFLARE_ACCOUNT_ID - Your Cloudflare account ID

Optional environment variables:

  • WORKER_NAME - Backend worker name (default: rin-server)
  • PAGES_NAME - Frontend pages name (default: rin-client)
  • DB_NAME - D1 database name (default: rin)
  • R2_BUCKET_NAME - R2 bucket name (auto-discovered if not set)

The deployment script will automatically:

  • Create D1 database if it doesn't exist
  • Auto-discover R2 bucket for image storage
  • Deploy backend to Workers
  • Build and deploy frontend to Pages
  • Run database migrations

GitHub Actions Workflows

The repository includes several automated workflows:

  • ci.yml - Runs type checking and formatting validation on every push/PR
  • test.yml - Runs comprehensive tests (server + client) with coverage reporting
  • build.yml - Builds the project and triggers deployment
  • deploy.yml - Deploys to Cloudflare Pages and Workers

Required secrets (Repository Settings → Secrets and variables → Actions):

  • CLOUDFLARE_API_TOKEN - Your Cloudflare API token with Workers and Pages permissions
  • CLOUDFLARE_ACCOUNT_ID - Your Cloudflare account ID

Optional configuration (Repository Settings → Secrets and variables → Variables):

  • WORKER_NAME, PAGES_NAME, DB_NAME - Resource names
  • NAME, DESCRIPTION, AVATAR - Site configuration
  • R2_BUCKET_NAME - Specific R2 bucket to use

Full documentation is available at https://docs.openrin.org.

Community & Support

Star History

Star History Chart

Contributing

We welcome contributions of all kinds—code, documentation, design, and ideas. Please check out our contributing guidelines and join us in building Rin together!

License

MIT License

Copyright (c) 2024 Xeu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.