π The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.
Vue dockergolangkanbanknowledge-baseknowledge-managementmarkdownnote-takingnotesnotes-appnotionnuxtnuxtjsoffline-firstoidcpwaselfhostedssovuevuejswiki
Alexandrie Backend
Overview
The Alexandrie backend is a REST API built with Go and the Gin web framework. It provides authentication, nodes management, permissions, and file storage features with a layered architecture.
Quick Start
# Install dependencies
go mod download
# Copy environment file
cp .env.example .env
# Run database migrations
go run app/migrations/*.go
# Start the server
go run main.go
The API will be available at http://localhost:8201 (or your configured port).
Starting Points
Adding a New Feature
- Define the model in
models/(data structure) - Create repository in
repositories/(database queries) - Implement service in
services/(business logic) - Add controller in
controllers/(HTTP handlers) - Register routes in
router/routes/
Understanding Request Flow
HTTP Request
β
router/router.go (route matching)
β
middlewares/ (auth, logging)
β
controllers/ (parse & validate)
β
services/ (business logic)
β
repositories/ (database)
β
Response
Common Tasks
Run the server
go run main.go
Database migrations
Migrations are in the app/migrations/ folder. They are automatically run on startup.
Contributing
When contributing to the backend:
- Follow the layered architecture pattern
- Use prepared statements in repositories
- Validate input in controllers
- Keep business logic in services
See CONTRIBUTING.md for full guidelines.