Skip to content

solo-samurai/go-serverless

Repository files navigation

Go Serverless Application

A modern serverless API built with Go and Fiber framework, deployed on Vercel.

🚀 Features

  • Built with Go and Fiber framework
  • Serverless deployment on Vercel
  • Clerk Authorization
  • Swagger API documentation
  • Hot reloading during development (using Air)
  • Clean project structure

📋 Prerequisites

  • Go 1.24.1
  • Node.js and pnpm
  • Vercel CLI
  • Git
  • Air (for development hot reloading)

🛠️ Installation

  1. Clone the repository:
git clone https://github.com/yourusername/go-serverless.git
cd go-serverless
  1. Install Go dependencies:
go mod download
  1. Install Node.js dependencies:
pnpm install
  1. Install Air for hot reloading (optional):
go install github.com/cosmtrek/air@latest
  1. Set up environment variables:
cp .env.example .env

Edit the .env file with your configuration.

🔧 Development

You have two options for local development:

Option 1: Using Air (Recommended for Go development)

air

This will start the server with hot reloading enabled. The application will be available at http://localhost:8080

Option 2: Using Vercel CLI

pnpm dev

This will start the server using Vercel's development environment.

Note: The main.go file is only used for local development. In production, the application runs as a serverless function on Vercel.

🚀 Deployment

The application is configured for deployment on Vercel. To deploy:

  1. Login to Vercel:
pnpm setup
  1. Deploy to Vercel:
pnpm start

📁 Project Structure

.
├── api/           # API routes and handlers
├── app/           # Application core
├── docs/          # Documentation
├── middleware/    # Middleware functions
├── public/        # Static files
└── main.go        # Development entry point (local only)

🔐 Environment Variables

Create a .env file in the root directory with the following variables:

# Add your environment variables here

📝 License

This project is licensed under the MIT License - see the LICENSE.

About

A modern serverless API built with Go and Fiber framework, deployed on Vercel.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages