Murali Allada
Murali Allada

Reputation: 22948

What is the best folder structure for a serverless project?

I'm starting to work on a new serverless project using AWS Lambda and API gateway.

What is the best way to organize my project, without being locked into one framework such as the serverless framework or chalice?

Here's what I'm using so far.

Do any of you recommend a better way to organize my project? Does each micro-service get a separate git repo? Am I missing other important folders?

Upvotes: 7

Views: 4597

Answers (1)

Lockless
Lockless

Reputation: 497

Your structure looks good if a bit flat. I like putting code flows together. There are usually multiple functions to get to a result. Those should be grouped. Common functions that cross flows but don't cross projects go into a common folder in project. I base my repo organization on overall ideas. If lambdas cross projects they go in a common repo. Project specific stay in their repo.

Many times the hardest part of using a serverless architecture is finding the code being called. With a good logical grouping you will save yourself many headaches later.

Upvotes: 1

Related Questions