GitBase is an open-source dynamic website solution without a traditional database, built with Next.js, Tailwind CSS, and Shadcn/UI. It leverages GitHub as a content management system, providing a seamless way to create and manage website content.
- Database-free Architecture: Utilizes GitHub for content storage and management.
- Dynamic Content: Renders content dynamically using Next.js server-side rendering.
- Markdown Support: Write your content in Markdown format for easy editing and version control.
- Admin Interface: Built-in admin panel for content management.
- AI-Powered Feature Development: Revolutionary AI development center that generates code from natural language requests.
- Self-Evolving CMS: The website can grow and add features autonomously through AI.
- Multi-language Support: Built-in internationalization with subdirectory routing (en, zh, ja).
- Smart Language Detection: Automatic browser language detection with non-intrusive suggestions.
- Category System: Organize articles and resources with visual category badges.
- Responsive Design: Fully responsive design using Tailwind CSS.
- SEO Friendly: Optimized for search engines with dynamic metadata.
- Easy Deployment: Simple deployment process to Vercel.
- Node.js (version 14 or later)
- npm (comes with Node.js)
- Git
- GitHub account
- Vercel account (for deployment)
-
Clone the repository:
git clone https://github.com/qiayue/gitbase.git cd gitbase -
Install dependencies:
npm install -
Create a
.env.localfile in the root directory and add the following:GITHUB_TOKEN=your_github_personal_access_token GITHUB_OWNER=your_github_username GITHUB_REPO=your_repo_name JWT_SECRET=your_jwt_secret_key DOMAIN=localhost ACCESS_USERNAME=your_admin_username ACCESS_PASSWORD=your_secure_access_password -
Set up your GitHub repository:
- Create a new repository on GitHub
- Create two folders in the repository:
data/jsonanddata/md - In
data/json, create a file namedresources.jsonwith an empty array:[]
-
Run the development server:
npm run dev
Visit http://localhost:3000 to see your GitBase instance running locally.
- Push your code to GitHub.
- Log in to Vercel and create a new project from your GitHub repository.
- Configure the environment variables in Vercel:
GITHUB_TOKEN- Your GitHub personal access tokenGITHUB_OWNER- Your GitHub usernameGITHUB_REPO- Your repository nameJWT_SECRET- A secure random string (at least 32 characters)DOMAIN- Your production domain (e.g., yourdomain.com)ACCESS_USERNAME- Admin username for loginACCESS_PASSWORD- Admin password for login
- Deploy the project.
For a detailed deployment guide, please refer to our Installation and Deployment Guide.
- Access the admin panel by navigating to
/loginand entering yourACCESS_USERNAMEandACCESS_PASSWORD. - Create and edit articles through the admin interface at
/admin. - Manage resources in the admin panel.
- All changes are automatically synced with your GitHub repository.
- Admin session expires after 1 hour for security.
GitBase includes a revolutionary AI-Powered Feature Development Center that allows your website to evolve and add new features autonomously. This feature leverages Claude AI through OpenRouter to generate code from natural language requests.
- Describe Your Feature: Write what you want in plain English (or any language)
- AI Analyzes: The system analyzes your project structure via GitHub API
- Code Generation: Claude AI generates the necessary code modifications
- Review Changes: Preview all file changes with a visual diff viewer
- One-Click Deploy: Batch commit all changes to GitHub using Git Trees API
- Instant Update: Your website immediately has the new feature
- Visit OpenRouter.ai
- Sign up for an account
- Navigate to API Keys section
- Generate a new API key (starts with
sk-or-v1-...)
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Give it a descriptive name (e.g., "GitBase AI Dev")
- Select the following scopes:
- ✅
repo(Full control of private repositories)
- ✅
- Click "Generate token"
- Important: Copy the token immediately (you won't see it again)
-
Log in to your GitBase admin panel (
/login) -
Navigate to AI Feature Development Center (
/admin/ai-dev) -
Click the "Configuration" button
-
Enter the following information:
OpenRouter Configuration:
- OpenRouter API Key: Paste your OpenRouter API key
- AI Model: Select "Claude 3.5 Sonnet" (recommended)
GitHub Configuration:
- GitHub Token: Paste your Personal Access Token
- GitHub Owner: Your GitHub username
- GitHub Repo: Your repository name (e.g., "gitbase")
- Branch Name: The branch to commit to (default: "main")
-
Click "Save Configuration"
- All credentials are stored securely in your browser's localStorage
- They are never sent to any server except GitHub and OpenRouter APIs
Feature Request:
I want to add a carousel component on the homepage that displays
the latest 3 articles, automatically switching every 5 seconds,
with smooth fade transitions.
Process:
- Paste the request in the "Feature Request" textarea
- Click "Generate Code"
- Watch the execution log as AI:
- Analyzes your project structure
- Identifies relevant files
- Generates new code
- Review the generated changes in the code diff viewer
- Click "Confirm and Commit to GitHub"
- Done! The feature is live
Feature Request:
The article list page is not showing category badges. Please fix this
by adding the CategoryBadge component to the article cards.
Feature Request:
Make the navigation bar sticky with a blur effect when scrolling,
similar to modern web designs.
The AI Development Center uses GitHub's Git Trees API for efficient batch commits:
- Multiple file changes are committed in a single operation
- Only 3-4 API requests regardless of the number of files modified
- Avoids GitHub API rate limits
- Atomic commits ensure consistency
- Local Storage Only: API keys stored in browser localStorage
- Path Validation: Prevents modification of sensitive files (.env, .git, etc.)
- Human Review: All code changes must be reviewed before committing
- No Auto-Merge: Changes are committed but not automatically deployed (requires manual review in production)
- ✅ Create new files
- ✅ Modify existing files
- ❌ Delete files (disabled for safety)
- Start Small: Test with simple features first
- Use Test Branch: Configure a test branch for experiments
- Review Code: Always review AI-generated code before committing
- Clear Descriptions: Be specific and detailed in feature requests
- Iterative Approach: Build complex features in smaller steps
"Please configure OpenRouter API Key"
- Go to Configuration and enter your OpenRouter API key
"Failed to fetch project context"
- Check that your GitHub token has
repopermissions - Verify the owner/repo names are correct
- Ensure the branch exists in your repository
"Rate limit exceeded"
- The batch commit feature should prevent this
- If it occurs, wait a few minutes before retrying
- Consider using a different GitHub token
"AI generated invalid code"
- Try rephrasing your request more clearly
- Break complex requests into smaller tasks
- Review and manually fix the generated code
- AI-generated code may require manual adjustments
- Complex features might need multiple iterations
- The AI doesn't have access to your database or environment variables
- Best suited for UI components, pages, and frontend logic
We welcome contributions to GitBase! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
GitBase is open-source software licensed under the MIT license.
If you encounter any issues or have questions, please file an issue on the GitHub repository.
GitBase is built with the following open-source libraries:
We are grateful to the maintainers and contributors of these projects.
