๐ฐ๏ธ BGCE Server (Backend API)
Welcome to the backend server powering the BGCE (Best Golang Community Ever) archive and control system.
This project serves as the foundation for category management, RBAC (Role-Based Access Control), and future API integrations โ all written in Golang with simplicity and scalability in mind.
๐ Project Structure
/server
โโโ main # Main entry point for the server
โโโ go.mod # Go module file (defines module path, dependencies)
โ
โโโ /categories # Category API handlers
โ โโโ categories.go # HTTP handlers for category management (GET/POST/etc)
โ
โโโ /rbac # Role-Based Access Control logic
โ โโโ superadmin.go # RBAC logic to allow/disallow actions based on role
๐ Getting Started
1. Clone the repo & enter the /server directory
git clone https://github.com/yourusername/bgce-archive.git
cd bgce-archive/server
2. Initialize dependencies (if needed)
go mod tidy
3. Run the server
go run main.go
โ Server runs on:
http://localhost:8080
๐ Role-Based Access Control (RBAC)
For now, Super Admin check is a simple function in rbac/superadmin.go:
func IsSuperAdmin(r *http.Request) bool
This will later be extended using JWT tokens, sessions, or other proper authentication systems.
๐งฉ API Endpoints (WIP)
| Endpoint | Method | Description | Access |
|---|---|---|---|
/ | GET | Welcome route | Public |
/categories | GET | List all categories | Super Admin |
/categories | POST | Create a new category | Super Admin |
/categories | PUT | Update a category | Super Admin |
/categories | DELETE | Delete a category | Super Admin |
๐ค Contributing
We welcome PRs, ideas, and improvements! Hereโs how to get started:
- Fork the repo
- Create a new branch using:
git switch -c feature/your-feature-name - Add your changes (modular, readable, minimal)
- If adding route logic, place it under
/categories/ - If adding role or auth logic, place it under
/rbac/ - Push and open a PR with a clear title and message
๐ Keep each PR focused โ one feature or fix per PR, please!
๐ฎ Roadmap (WIP Ideas)
- โ
Clean route structure using
http.ServeMux - ๐ Real token-based Super Admin checks (JWT/session)
- ๐ฆ Persistent DB (PostgreSQL or SQLite)
- ๐งฉ Problem management endpoints
- ๐ Admin dashboard (frontend)
- ๐ JSON response formatting
๐งโ๐ป Maintained By
BGCE Mod Team
If you break it, you fix it. If you build it, name it something cool. ๐