aws-amplify / aws-amplify/amplify-cli

Folder Organization Suggestions

Open
#2,289 4 comments 0 reactions 0 assignees View on GitHub
feature-request p4 pending-review platform
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

## Request
Improve the organization of source code and amplify generated files.

## Issue
Currently when you generate a project with the Amplify CLI, it can be very difficult to follow the code because it mixes source code, dependencies, configuration (often generated) and built files. Additionally, when you have deeply nested projects managing the node_modules and nested scripts are difficult.

## Solutions
[Yarn Packages](https://yarnpkg.com/lang/en/docs/workspaces/) make organizing this type of things really easy. I have a project that I built with the AWS CDK and Yarn Workspaces and the end result was very clean. The project is broke down into a few different packages:

- `api` - lambda + api gateway
- `aws` - CDK generation code
- `web` - create react app
- `notification` - bot notification lambda
- `aggregator` - data aggregation lambda

![2019-09-14_09-13-00](https://user-images.githubusercontent.com/227909/64908562-f811c800-d6cf-11e9-8107-0c30fc6bfba9.png)

The organization of the generated code is nicely contained in the `cdk.out` folder and all my source code just is consumed by the `aws` project here. Now if you compare this to what one of my AWS Amplify projects looks like, its very difficult to understand...

![2019-09-14_09-16-11](https://user-images.githubusercontent.com/227909/64908676-5c815700-d6d1-11e9-86a0-1ca2e9c2a7ea.png)

The Firebase examples aren't as 'clean' as the workspaces but they are still easier to follow. Here is one example: https://github.com/firebase/friendlychat-web

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.