Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

CollActionteam/collaction_backend

Repository files navigation

CollAction backend

The backend for the CollAction app.

API

An interactive documentation of the API can be found here.

❗ Currently the API is being overhauled (see ./docs/api2.yml)
The new version will conform to JSend.

Dependencies

Architecture

The project follows the clean architecture.
The file structure is as follows:

repository/
├─ docs/             👉 Documentation
├─ internal/         👉 Contains folders for business logic and (unit) tests for each service in a corresponding folder
│  ├─ constants/     👉 (Shared) constant values
│  ├─ models/        👉 Definitions for structs (❗ No logic)
├─ pkg/
│  ├─ handler/
│  |  ├─ aws/        👉 Lambdas (seperate folders each)
│  ├─ mocks/
│  |  ├─ repository/ 👉 Mocks for external repositories
│  ├─ repository/
│  |  ├─ aws/        👉 External repositories (e.g. AWS SSM/Dynamo)
├─ go.mod            👉 Go dependencies
├─ template.yaml     👉 CloudFormation template

Run locally

⚠ Not all features of the API can be run locally!
(To use the full range of AWS services, deploy a stack for testing using sam deploy -g)

Build and run the entire application using the following commands:

sam build
sam local start-api

You can also run a single function using an event file.

sam local invoke SomeFunction --event event_examples/some_event.json

Unit tests

Run the tests from the root directory using:

go test ./...

DevOps

GitHub topics (such as GitHub Actions) are documented here