A headless CMS that uses GitHub repositories as the backend storage. Content is versioned via Git and can be served directly via GitHub Pages. Includes a modern Vue.js admin interface for content management.
VachanCMS takes a unique approach to content management:
- GitHub as Database - All content, configuration, and media files are stored as JSON files in a GitHub repository
- Git-Powered Versioning - Every change is a commit, giving you full version history and collaboration features for free
- GitHub Pages Ready - Content is structured to be consumed by static site generators and served via GitHub Pages
- Modern Admin Interface - A Vue.js frontend for managing content, media, and configuration
This approach eliminates the need for a traditional database while providing built-in version control, backup, and the familiar GitHub collaboration workflow.
Select or initialize a repository as a CMS
Media library with drag-and-drop upload
- GitHub OAuth Authentication - Secure login using your GitHub account
- Repository Management - Initialize any GitHub repo as a CMS with proper directory structure
- Dynamic Content Types - Define custom content schemas with typed fields (text, number, boolean, select)
- Content Management - Create, read, update content instances with validation
- Media Uploads - Store and serve images, documents, and other files
- Pagination - Efficient pagination for large content collections
- Modern UI - Clean, responsive interface built with Shadcn-vue components
- Dark/Light Mode - Theme toggle with system preference detection
- Dynamic Forms - Auto-generated forms based on content type definitions
- Media Library - Grid/list view with drag-and-drop uploads and file preview
- Real-time Feedback - Toast notifications for all operations
- Go 1.25+ installed on your system
- Node.js 18+ and pnpm (for frontend development)
- GitHub OAuth Application - Create one here
- Set the callback URL to
http://localhost:8080/api/auth/callback(for local development)
- Set the callback URL to
# Clone the repository
git clone https://github.com/vachanmn123/vachancms.git
cd vachancms
# Install backend dependencies
go mod download
# Install frontend dependencies
cd frontend
pnpm install
cd ..Create a .env file in the project root:
# Required
GITHUB_CLIENT_ID=your_github_oauth_client_id
GITHUB_CLIENT_SECRET=your_github_oauth_client_secret
GITHUB_REDIRECT_URL=http://localhost:8080/api/auth/callback
ENCRYPTION_KEY=your-32-byte-encryption-key-here # This is used to store the user's GitHub access token in the JWT securely.
JWT_SECRET=your-jwt-secret-key
# Optional
PORT=8080
PRODUCTION=false| Variable | Required | Description |
|---|---|---|
GITHUB_CLIENT_ID |
Yes | GitHub OAuth App Client ID |
GITHUB_CLIENT_SECRET |
Yes | GitHub OAuth App Client Secret |
GITHUB_REDIRECT_URL |
Yes | OAuth callback URL |
ENCRYPTION_KEY |
Yes | AES encryption key (16, 24, or 32 bytes for AES-128/192/256) |
JWT_SECRET |
Yes | Secret for signing JWTs |
PORT |
No | Server port (default: 8080) |
PRODUCTION |
No | Set to true for production mode |
Run the backend and frontend separately for hot-reload during development:
Terminal 1 - Backend:
go run main.goTerminal 2 - Frontend:
cd frontend
pnpm install
pnpm devAccess the application at http://localhost:5173. The Vite dev server automatically proxies API requests to the Go backend on port 8080.
Build the frontend and run the Go server, which serves both the API and the built frontend:
# Build the frontend
cd frontend
pnpm build
cd ..
# Build and run the backend
go build -o vachancms
./vachancmsAccess the application at http://localhost:8080 (or your configured port).
-
Open the application at
http://localhost:5173(development) orhttp://localhost:8080(production) -
Login with GitHub - Click the login button to authenticate via GitHub OAuth
-
Select a repository - Choose an existing repository or initialize a new one as a CMS
-
Create content types - Define your content schema with custom fields:
- Text - String values
- Number - Numeric values
- Boolean - True/false toggles
- Select - Dropdown with predefined options
-
Manage content - Add, edit, and organize your content entries
-
Upload media - Drag and drop files into the media library
Your content is automatically saved as JSON files in the GitHub repository, with full version history.
When you initialize a repository, VachanCMS creates the following structure:
your-repo/
├── config/
│ └── config.json # CMS configuration and content type definitions
├── data/
│ └── <content-type-slug>/
│ ├── config.json # Pagination metadata
│ ├── index-<page>.json # Paginated content list
│ └── <id>.json # Individual content items
├── media/
│ ├── config.json # Media pagination metadata
│ ├── index-<page>.json # Paginated media list
│ └── <id> # Binary media files
└── content/
└── .gitkeep
| Technology | Purpose |
|---|---|
| Go | Backend language |
| Gin | Web framework |
| go-github | GitHub API client |
| golang-jwt | JWT authentication |
| Technology | Purpose |
|---|---|
| Vue 3 | UI framework (Composition API + TypeScript) |
| Vite | Build tool and dev server |
| Tailwind CSS | Utility-first styling |
| Shadcn-vue | Component library |
| Pinia | State management |
| Vue Router | Client-side routing |
| Axios | HTTP client |
| Zod | Schema validation |
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.

