About The Project
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.
Built With
How to test
- Install Docker
- Install Postman from here.
- Download the api postman collection here
Setup for development
- Install Go 1.22.4
- Install Docker
- Install direnv to export the environment variables. (only 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.envrc
-
cp example.envrc .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
Documentation
After completing step 3 in the Setup for development section, go to http://localhost:8081 to open Swagger UI.
License
Distributed under the MIT License. See LICENSE.txt
for more information.
Contact information
Acknowledgments