A modern, feature-rich personal wiki system built with Go and a beautiful user interface. This wiki system supports both local file storage and GitHub-based storage, with Redis caching for improved performance.
- Backend: Go 1.22+
- Web Framework: Gin
- Authentication: Google OAuth2
- Storage Options:
- Local File System
- GitHub Repository
- Caching: Redis
- Frontend:
- HTML5
- CSS3 (with CSS Variables for theming)
- JavaScript (Vanilla)
- Markdown Support: Blackfriday v2
- Configuration: Viper
- Rich Text Editor: TinyMCE integration for seamless content editing
- Dark/Light Theme: Automatic theme switching with CSS variables
- Responsive Design: Mobile-friendly interface
- User Authentication:
- Google OAuth2 integration
- Email-based access control
- Session management
- Storage Options:
- Local file system storage
- GitHub repository storage
- Redis caching for improved performance
- Category Management:
- Hierarchical folder structure
- Dynamic folder tree navigation
- Support for multiple category levels
- Clean URLs: SEO-friendly structure
- Performance Optimizations:
- Redis caching layer
- Efficient file system operations
- Optimized GitHub API usage
- Go 1.22 or higher
- Redis (optional, for caching)
- Google OAuth2 credentials (for authentication)
- GitHub Personal Access Token (if using GitHub storage)
-
Clone the repository:
git clone https://github.com/daniel-vuky/golang-my-wiki-v2.git cd golang-my-wiki-v2
-
Install dependencies:
go mod download
-
Create configuration file:
cp env.yaml.example env.yaml
-
Update
env.yaml
with your settings:google: client_id: your_client_id client_secret: your_client_secret redirect_url: {{url}}:8080/auth/google/callback allowed_emails: - [email protected] session: secret: your_session_secret name: wiki_session secure: false allowed_emails: - [email protected] server: port: 8080 host: localhost data_dir: ./data storage_mode: github # or "local" # If using GitHub storage github: token: your_github_token owner: your_username repository: your_wiki_repo branch: main # Redis cache settings (optional) redis: address: localhost:6379 password: "" db: 0 enabled: true expiration_seconds: 900
-
Create data directory:
mkdir data
-
Run the application:
go run cmd/server/main.go
-
Visit
http://localhost:8080
in your browser
golang-my-wiki-v2/
├── cmd/
│ └── server/
│ └── main.go # Application entry point
├── pkg/
│ ├── auth/ # Authentication package
│ ├── cache/ # Redis caching package
│ ├── config/ # Configuration management
│ ├── handlers/ # HTTP request handlers
│ ├── middleware/ # HTTP middleware
│ ├── models/ # Data models
│ └── storage/ # Storage implementations
├── static/ # Static assets (CSS, JS)
├── templates/ # HTML templates
├── data/ # Wiki page storage (local mode)
├── env.yaml # Configuration file
└── go.mod # Go module file
-
Run tests:
go test ./...
-
Format code:
go fmt ./...
- All user authentication is handled through Google OAuth2
- Session management with secure cookie storage
- Email-based access control
- HTTPS support (configurable in production)
MIT License - feel free to use and modify!
Contributions are welcome! Please feel free to submit a Pull Request.