A modern serverless API built with Go and Fiber framework, deployed on Vercel.
- Built with Go and Fiber framework
- Serverless deployment on Vercel
- Clerk Authorization
- Swagger API documentation
- Hot reloading during development (using Air)
- Clean project structure
- Go 1.24.1
- Node.js and pnpm
- Vercel CLI
- Git
- Air (for development hot reloading)
- Clone the repository:
git clone https://github.com/yourusername/go-serverless.git
cd go-serverless
- Install Go dependencies:
go mod download
- Install Node.js dependencies:
pnpm install
- Install Air for hot reloading (optional):
go install github.com/cosmtrek/air@latest
- Set up environment variables:
cp .env.example .env
Edit the .env
file with your configuration.
You have two options for local development:
air
This will start the server with hot reloading enabled. The application will be available at http://localhost:8080
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.
The application is configured for deployment on Vercel. To deploy:
- Login to Vercel:
pnpm setup
- Deploy to Vercel:
pnpm start
.
├── api/ # API routes and handlers
├── app/ # Application core
├── docs/ # Documentation
├── middleware/ # Middleware functions
├── public/ # Static files
└── main.go # Development entry point (local only)
Create a .env
file in the root directory with the following variables:
# Add your environment variables here
This project is licensed under the MIT License - see the LICENSE.