Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Hajime-Suzuki/functional-programming-hexagonal-architecture
hexagonal architecture with fp-ts
https://github.com/Hajime-Suzuki/functional-programming-hexagonal-architecture
Last synced: about 2 months ago
JSON representation
hexagonal architecture with fp-ts
- Host: GitHub
- URL: https://github.com/Hajime-Suzuki/functional-programming-hexagonal-architecture
- Owner: Hajime-Suzuki
- Created: 2020-10-03T07:07:22.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-07T06:30:41.000Z (almost 4 years ago)
- Last Synced: 2024-07-05T13:23:41.606Z (3 months ago)
- Language: TypeScript
- Homepage:
- Size: 610 KB
- Stars: 25
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Functional programming way of hexagonal architecture
Hexagonal architecture for survey application. There are `Survey` and `Response`
---
## Goals
- show examples with fp-ts
- keep it simple---
## Functionalities
- user can create survey
- user can update survey
- user can get survey by form id- user can create response for specific survey
- user can get all responses for specific survey---
## API
sample-request.http can be used for test requests with VSCode REST Client extension.
### Survey
GET: /surveys/{formId}
response: SurveyPOST: /surveys
response: SurveyPUT: /surveys/{formId}
response: Survey### Response
GET: /surveys/{formId}/responses
response: Response[]POST: /responses
response: Response```
type Survey = {
id: string
closeDate: string
questions: {
id: string
type: "select" | "multiple-choice" | "open"
options: string[]
}[]
}```
```
type Response = {
formId: string
email: string
answers: {
questionId: string
value: string[]
}[];
}
```---
## How to run
- serverless-dynamodb-local is used, so Java Runtime Engine (JRE) version 6.x or newer is required (https://www.serverless.com/plugins/serverless-dynamodb-local)
- run `yarn install`
- run `yarn dev`