This is a backend application for a notes app, developed using Go. The API supports both REST and GraphQL communication. While the application is designed to be simple in terms of business logic, it serves as a robust example of a Go project structure. It is intended to be a solid starting point for more complex applications.
Install direnv to export the environment variables. (only for development)
Setup for development
Clone the repo
git clone https://github.com/daniarmas/notes.git
Install Go dependencies
go mod download
Deploy docker compose file
docker compose -f deploy/docker-compose-dev.yaml up -d
Run direnv command to approve his content
direnv allow
Create the .envrc file with the env vars in example.env
cp example.env .envrc
Create the database tables
go run main.go create database
Seed the database. This seed the database for test purpose
go run main.go create seed
Configure an object storage service compatible with the Amazon S3 API. DigitalOcean Spaces was used in the development. Ensure you update the access key, secret key and bucket name in the .envrc file.
Run the app
go run main.go run
License
Distributed under the MIT License. See LICENSE.txt for more information.