aws-amplify / aws-amplify/amplify-cli

Flexible and configurable folder structure

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

Description

**Is your feature request related to a problem? Please describe.**

The amplify folder structure is too rigid for a lot of common scenarios, such as when using mono-repos

**Describe the solution you'd like**

Configurable folder structure where `amplify` and `backend` are not hardcoded folders but can be configured as needed to fit into the hosting folder structure, such as a monorepo

**Describe alternatives you've considered**

The only alternative is to maintain the amplify conventions which can lead to horribly deep, inconvenient folder structures

**Additional context**

Amplify contains plenty of utility functions for calculating folder names in a flexible and configurable manner. Should be extended and used everywhere.

**Proposed solution**

Allow for an `.amplifyrc` or `amplify-config.json` file in the root folder of the project which defines constants used for conventions in the project, including folder names and structure.

Add a `getAmplifyRc` function which reads the json from this file or creates such a file using defaults if the file does not exist.

```js
async function getAmplifyRc(existingApp, opts = {) {
const amplifyRcFilePath = opts.amplifyrcPath || path.join('.amplifyrc');
if (existingApp === true) {
const amplifyRc = JSON.parse(fs.readFileSync(amplifyRcFilePath));
return amplifyRc;
}

if (!fs.existsSync(amplifyRcFilePath)) {
fs.writeFileSync(amplifyRcFilePath, JSON.stringify(opts, null, 4));
}
return opts
}

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing utility functions that calculate Amplify folder names and the CLI entry points that use hardcoded amplify and backend paths. Trace how project configuration is loaded, then define the scope for reading or creating .amplifyrc or amplify-config.json. Done means configurable folder conventions work consistently across the CLI, with coverage for default and custom layouts.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.