Skip to content

figtive/gallery-api

Repository files navigation

Gallery API

API backend for Gallery PPL Fasilkom UI.

Develop

gallery-api uses Go Modules module/dependency manager, hence at least Go 1.11 is required. To ease development, comstrek/air is used to live-reload the application. Install the tools as documented.

To begin developing, simply enter the sub-directory and run the development server:

$ go mod tidy
$ air

Deploy

gallery-api is containerized and pushed to Docker Hub. It is tagged based on its application version, e.g. figtive/gallery-api:0.1.0 or figtive/gallery-api:nightly.

To run gallery-api, run the following:

$ docker run --name gallery-api --env-file ./.env -p 8080:8080 -d figtive/gallery-api

Dependencies

The following are required for gallery-api to function properly:

  • PostgreSQL

Their credentials must be provided in the configuration file.

PostgreSQL UUID Extension

UUID support is also required in PostgreSQL. For modern PostgreSQL versions (9.1 and newer), the contrib module uuid-ossp can be enabled as follows:

CREATE EXTENSION IF NOT EXISTS "uuid-ossp";