Coder Social home page Coder Social logo

pos's Introduction

gofiber-template

This is an opinionated template for building a RESTful API via HTTP transport project using gofiber/fiber framework, with container support via Docker and CI/CD support via GitHub Actions.

Features

Getting Started

1. Get the template

Use this template button (recommended)

This repository is meant to be used as a template for your own project. You can use the Use this template button on the top right corner of this page to create your own repository from this template.

Clone this repository manually

If you want to clone this repository, you can do so by running the following command:

git clone [email protected]:GalvinGao/gofiber-template.git

2. Configure database URL in .env

DATABASE_URL=postgres://USERNAME:PASSWORD@localhost:5432/DATABASE_NAME?sslmode=disable

More information about database URL can be found in bun's documentation

3. Initialize bun migration & Apply initial migrations

go run main.go db init
go run main.go db migrate

4. Launch

Install gow (optional)

gow stands for Go Watch. It is a tool that watches your Go source code and automatically recompiles and restarts your program when necessary. This allows you to see changes in real time which makes development much easier and faster.

go install github.com/mitranim/gow@latest

Start the server

After you install gow simply replace go with gow and start the server using:

gow run main.go start

Debugging

VSCode

Use the following .vscode/launch.json to launch the application with debugger attached:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Launch Server",
      "type": "go",
      "request": "launch",
      "mode": "auto",
      "program": "${workspaceFolder}/main.go",
      "args": ["start"]
    }
  ]
}

License

MIT License.

Contributing

Issues and pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

pos's People

Contributors

m-hazem avatar shaband avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.