Open Source · MIT Licensed

Build Go REST APIs.
Without the boilerplate.

CoreGo is an open-source Go library with built-in JWT auth, multi-database support, and a CLI that scaffolds your entire project in seconds.

main.go
package main

import (
    "github.com/berkkaradalan/CoreGo"
    "github.com/berkkaradalan/CoreGo/database"
)

func main() {
    core, _ := corego.New(&corego.Config{
        Port: "8080",
        Mongo: &database.MongoConfig{
            URI:    "mongodb://localhost:27017",
            DBName: "myapp",
        },
    })

    core.Engine.GET("/hello", func(c *gin.Context) {
        c.JSON(200, gin.H{"message": "Hello from CoreGo!"})
    })

    core.Start()
}

Features

Everything you need to build Go APIs

Stop writing the same boilerplate for every new project. CoreGo handles the plumbing so you can focus on your business logic.

JWT Authentication

Built-in login/register flow with JWT token management. Secure your API endpoints out of the box.

Multi-Database Support

Connect to MongoDB, PostgreSQL, or both. Switch databases without rewriting your application logic.

Interactive CLI Scaffolding

Run corego init and answer a few questions. Get a complete, production-ready project structure instantly.

Middleware & Routing

Pre-built middleware patterns and structured routing powered by the Gin framework. Extensible and clean.

Environment Configuration

Automatic .env file generation and loading. No more manual environment setup boilerplate.

Clean Architecture

Modular design that's lightweight enough for existing projects or powerful enough to bootstrap new ones.

Quick Start

From zero to API in 3 steps

Get a fully configured Go REST API running in under a minute. No config files to wrangle, no boilerplate to copy-paste.

1

Install

Add CoreGo to your Go project with a single command.

terminal
$ go get github.com/berkkaradalan/CoreGo
2

Initialize

Use the interactive CLI to scaffold a complete project structure.

terminal
$ corego init

? Project name: my-api
? Select databases: [MongoDB, PostgreSQL]
? Include JWT authentication? Yes
? Create .env file? Yes
? Initialize git repo? Yes

 Project created successfully!
3

Run

Start your server. That's it — your API is live.

terminal
$ cd my-api && go run main.go

🚀 Server running on http://localhost:8080

CLI Tool

Scaffold complete projects with one command

The corego init CLI asks you a few questions, then generates a production-ready project structure with everything wired up.

terminal — corego init
$ corego init

? Project name: my-api
? Select databases:
   MongoDB
   PostgreSQL
? Include JWT authentication? Yes
? Create .env file? Yes
? Initialize git repo? Yes

Creating project structure...
 Generated main.go
 Generated config/config.go
 Generated database/database.go
 Generated handlers/auth.go
 Generated middleware/auth.go
 Generated routes/routes.go
 Created .env file
 Initialized git repository

 Project created successfully!
  Run: cd my-api && go run main.go
generated project structure
my-api/
├── main.go
├── go.mod
├── .env
├── .gitignore
├── README.md
├── config/
   └── config.go
├── database/
   └── database.go
├── handlers/
   └── auth.go
├── middleware/
   └── auth.go
└── routes/
    └── routes.go

Examples

Simple, powerful, familiar

CoreGo builds on tools you already know — Gin for routing, standard Go patterns for everything else.

package main

import "github.com/berkkaradalan/CoreGo"

func main() {
    core, _ := corego.New(&corego.Config{
        Port: "8080",
    })

    core.Start()
}

Why CoreGo?

Less boilerplate. More shipping.

What takes 50+ lines of manual setup takes 10 with CoreGo. Same result, fraction of the code.

Without CoreGo~55 lines

main.go
// Manual Gin setup
// Manual database connection
// Manual JWT middleware
// Manual auth handlers
// Manual env loading
// Manual route definitions
// Manual error handling
// ...

r := gin.Default()
godotenv.Load()
client, _ := mongo.Connect(ctx, opts)
db := client.Database(os.Getenv("DB"))

// JWT middleware (20+ lines)
// Auth handlers (25+ lines)
// Route setup (10+ lines)

r.Run(":8080")

With CoreGo~10 lines

main.go
package main

import (
    "github.com/berkkaradalan/CoreGo"
    "github.com/berkkaradalan/CoreGo/database"
)

func main() {
    core, _ := corego.New(&corego.Config{
        Port:  "8080",
        Mongo: &database.MongoConfig{...},
        Auth:  true,
    })
    core.Start()
}

Open Source

Open source. MIT licensed. Community driven.

CoreGo is free and open source. Contributions, issues, and feedback are always welcome.

MIT
License
Go
Language
100%
Free