# BYOM Core A Go-based backend service for workspace and user management with built-in authentication. ## Features - Workspace Management - User Authentication (JWT) - Profile Management - Email Notifications (SMTP) - SQLite Database (GORM) - Webhook Integration - TLS Support - Graceful Shutdown ## Prerequisites - Go 1.22.5 or higher - SQLite 3 ## Project Structure ``` . ├── app/ # Core application components │ ├── server.go # HTTP server setup │ ├── routes.go # API route definitions │ └── middleware.go # HTTP middlewares ├── common/ # Shared models and utilities ├── config/ # Configuration management ├── handlers/ # HTTP request handlers ├── hook/ # Webhook integration ├── jwtutils/ # JWT authentication ├── smtp/ # Email service │ └── templates/ # Email templates ├── store/ # Database operations └── main.go # Application entry point ``` ## Quick Start Clone the repository: ```bash git clone git@git.linuxforward.com:byom/byom-core.git cd byom-core ``` Install dependencies: ```bash go mod download ``` Copy and configure settings: ```bash cp config.sample.yaml config.yaml ``` Run the server: ```bash go run main.go serve ``` ## Configuration The application is configured via config.yaml. Key sections: ```yaml server: listening_port: 8443 tls: enabled: false database: path: "./data/app.db" log: level: "info" jwt: jwt_secret: "your-jwt-secret" smtp: host: "smtp.example.com" oauth2: client_id: "your-client-id" ``` See config.sample.yaml for a complete example. ## Development Commands Run server: ```bash go run main.go serve --config config.yaml ``` Show version: ```bash go run main.go version ``` ## API Routes All routes are prefixed with /api/v1/core - GET /health - Health check - POST /auth/login - User authentication - POST /workspaces/owner - Create workspace owner - PUT /workspaces/owner - Initialize workspace owner - POST /workspaces/invite - Invite users - GET /workspaces/invite/validate - Validate invitations Protected routes require JWT authentication via the Authorization header. ## Contributing Fork the repository Create your feature branch Commit your changes Push to the branch Create a Pull Request ## TODO - Add support for multiple OAuth2 providers - Improve error handling and validation - Add API documentation using OpenAPI/Swagger - Implement audit logging - Add metrics and monitoring - Improve test coverage - Add support for caching - Implement request tracing - Add support for webhooks configuration - Improve security headers configuration - Add support for recovery ## License Proprietary - All rights reserved