sbshah97 / surrealdb-go-starter-project

SurrealDB Starter Project using Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SurrealDB Go Starter Project

Welcome to the SurrealDB Go Starter Project, a solid foundation for your Go projects powered by SurrealDB.

SurrealDB Starter GIF

Getting Started

To start a new Go project using this template, you can clone or download this repository.

Development

After you have cloned the repository, you need to set up SurrealDB.

TODO: Using Docker

We recommend using Docker, but you can also install SurrealDB directly on your machine.

To set up a Docker container for SurrealDB, run the following command:

docker compose up -d
docker compose stop # Pauses the container
docker compose down # Tears down the container, wiping data

MacOS

brew install surrealdb/tap/surreal
make dbrun

Now, you can start coding and developing your Go project.

Install Golangci

Use the following golang-ci link to install it for your setup

Running golang-ci

Run make lint

Running tests

Run make test

Running the application

Run make run

Contributing

This project is built for Hacktoberfest 2023, and anyone is welcome to contribute or make suggestions on how to enhance this template for Go development with SurrealDB.

Feel free to open pull requests or issues, and I'll review them as soon as possible.

Happy coding with SurrealDB for Go!

Project Roadmap

TODO: Move to Epic / Wiki soon

  • Basic Main function
  • Integrate Go HTTP Router
  • Integrate simple GET/POST/PUT/DELETE event
  • Integrate DB logic with HTTP Methods
    • Integrate GET Method
    • Integrate POST Method
    • Integrate PUT Method
    • Integrate DELETE Method
  • Add data to DB
  • Add logging

About

SurrealDB Starter Project using Go

License:Apache License 2.0


Languages

Language:Go 85.0%Language:Makefile 13.4%Language:Dockerfile 1.6%