CoreGo
A comprehensive backend framework for Go that provides production-ready authentication, multi-database support, and environment management through a unified API. Framework-agnostic and built for developer experience.

Features
- π Authentication System: Built-in JWT authentication with user management
- πΎ Multi-Database Support: Currently supports MongoDB (PostgreSQL, MySQL coming soon)
- π― Framework Agnostic: Works with any Go web framework (Gin, Echo, Fiber, etc.)
- βοΈ Environment Management: Seamless
.env file integration
- π Modular Design: Use only what you need
- π Production Ready: Battle-tested components for real-world applications
π₯ Installation
go get github.com/berkkaradalan/CoreGo
π Quick Start
package main
import (
"github.com/berkkaradalan/CoreGo"
"github.com/berkkaradalan/CoreGo/auth"
)
func main() {
// Initialize CoreGo with your preferred database
core, err := corego.New(&corego.Config{
Auth: &auth.Config{
Secret: "your-jwt-secret",
TokenExpiry: 60,
DatabaseName: "users",
},
})
if err != nil {
panic(err)
}
defer core.Close()
// Your application logic here
}
π¦ Core Modules
π Authentication
Full-featured authentication system with JWT tokens, user management, and customizable user data.
// Signup
user, token, err := core.Auth.Signup(auth.SignupRequest{
Email: "user@example.com",
Password: "password",
Custom: map[string]any{"name": "John"},
})
// Login
user, token, err := core.Auth.Login(auth.LoginRequest{
Email: "user@example.com",
Password: "password",
})
πΎ Database
Unified database interface supporting multiple database systems.
Currently Supported:
Coming Soon:
- π PostgreSQL
- π MySQL
// Works the same across all database types
id, err := core.Mongo.InsertOne("collection", document)
results, err := core.Mongo.Find("collection", filter)
βοΈ Environment Variables
Automatic .env file loading with type-safe access.
MONGODB_CONNECTION_URL=mongodb://localhost:27017
AUTH_SECRET=your-secret-key
PORT=8080
core.Env.MONGODB_CONNECTION_URL // Automatically loaded
π Framework Integration
CoreGo is designed to work seamlessly with any Go web framework:
- πΈ Gin - Example with Gin Web Framework
- π΅ Echo - Coming soon
- β‘ Fiber - Coming soon
- π¦ Chi - Coming soon
π Documentation
β‘ Configuration
CoreGo uses a simple configuration structure:
type Config struct {
Mongo *database.MongoConfig // Database configuration
Auth *auth.Config // Authentication configuration
}
β¨ Auto-configuration from environment variables:
- β
If
MONGODB_CONNECTION_URL is set, MongoDB connects automatically
- β
No manual configuration needed for basic setup
π Project Structure
CoreGo/
βββ auth/ # Authentication module
βββ database/ # Database adapters
βββ env/ # Environment management
βββ docs/ # Documentation
βββ test/ # Examples and tests
π Security
- π Passwords hashed with bcrypt
- π« JWT tokens with configurable expiry
- π Environment-based secrets
- β
Secure by default
π‘ Examples
Check out the test/main.go for a complete working example with:
- β
Full authentication flow
- π Protected routes
- πΎ Database operations
- π€ Custom user data
Run the example:
cd test
go run main.go
πΊοΈ Roadmap
- MongoDB support
- JWT authentication
- User management
- PostgreSQL support
- MySQL support
- Redis caching
- Role-based access control (RBAC)
- OAuth providers
- Session management
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
π License
MIT License - see LICENSE for details
π¨βπ» Author
Berk Karadalan - GitHub
π¬ Support