Skip to content

daniarmas/notes

Repository files navigation

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

  1. Install Docker
  2. Install Bruno from here.
  3. Clone the repo
    git clone https://github.com/daniarmas/notes.git
  4. Open the Bruno collections at ./api/bruno.
  5. 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 docker compose file enviroment variables.
  6. Create the .env file with the env vars in example.env
    cp example.env .env
  7. Deploy docker compose file
    docker compose -f deploy/docker-compose.yaml up -d

Setup for development

  1. Install Go 1.22.4
  2. Install Docker
  3. Install direnv to export the environment variables. (only for development)
  4. Clone the repo
    git clone https://github.com/daniarmas/notes.git
  5. Install Go dependencies
    go mod download
  6. Deploy docker compose file
    docker compose -f deploy/docker-compose-dev.yaml up -d
  7. Run direnv command to approve his content
    direnv allow
  8. Create the .envrc file with the env vars in example.envrc
  9. cp example.envrc .envrc
  10. Create the database tables
go run main.go create database
  1. Seed the database. This seed the database for test purpose
go run main.go create seed
  1. 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.
  2. 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

Contact information

Acknowledgments