The backend for the CollAction app.
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.
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
⚠ 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
Run the tests from the root directory using:
go test ./...
GitHub topics (such as GitHub Actions) are documented here