Hi everyone, so <@U04EQ1L14HG> discussed the patte...
# software-contributors
f
Hi everyone, so @mysterious-tomato-10057 discussed the pattern for creating APIs and microservices moving forward. Let me know if you have any questions. • we will use fastapi • we will have a directory and dockerfile per microservice that contains the fastapi app. • we will use https://github.com/awslabs/aws-lambda-web-adapter to enable both local and lambda environments Sample project structure:
Copy code
my-serverless-api/
├── cdk/
│   ├── bin/
│   │   └── my-serverless-api.ts
│   ├── lib/
│   │   └── my-serverless-api-stack.ts
│   ├── package.json
│   ├── tsconfig.json
│   └── cdk.json
├── services/
│   ├── user/
│   │   ├── Dockerfile
│   │   ├── app.py
│   │   └── requirements.txt
│   └── order/
│       ├── Dockerfile
│       ├── app.py
│       └── requirements.txt
└── README.md
The lambdas deploy with docker in the CDK
💪 2
cc @faint-honey-49404
m
The advisor module which lets say has all the right capital integration, where does that fit into the folder structure?
f
I haven’t seen that code, but there are two options to migrate it: 1. keep as-is and just dockerize the lambda (very easy) 2. refactor into routes and implement fastai as above
option 1 would just delay the refactor I suppose, I’m not sure the complexity there
m
1. keep as-is and just dockerize the lambda (very easy)
2. refactor into routes and implement fastai as above
Don't we want to do both?
@full-wall-37598 Posted a review on the schema PR. Overall I think it's great!
f
thanks 🙂 And yeah ideally we would do both, but for now I think it should be priority to dockerize and get the dir structure standardized. Then we can add the routes with fastapi but that’s more of a refactor
👍 1
m
I could work on dockerizing the right capitol integration. I should have sometime over the weekend.
f
great lmk if you have any questions - the ynaboauth handler in the slack repo and the budget insights lambda in core have it implemented if you want an example
👍 1