question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to create multiple front-end apps (React plus Swift, Android, etc.)

See original GitHub issue

Is your feature request related to a problem? Please describe. We would like to be able to create a website and mobile apps for a project. It is not clear if/how it possible, plus the /amplify folder setup files appear to be wired for one front-end app only.

Describe the solution you’d like It would be awesome if there was a way to add another front-end app with the CLI. For example, with a command like amplify frontend add or as a part of the amplify init workflow.

For example, let’s say I have a React app already and now I’d like to add an iOS Swift app. Going through the CLI, perhaps I can enter the amplify init flow:

? Do you want to use an existing environment? Yes
? Choose the environment you would like to use: master
? Do you want to add another frontend? Yes
? Choose your default editor: 
❯ Xcode
  Sublime Text 
  Visual Studio Code 
  Atom Editor 
  IDEA 14 CE 
  Vim (via Terminal, Mac OS only) 
  Emacs (via Terminal, Mac OS only) 
  None 
? Choose the type of app that you're building (Use arrow keys)
  android 
❯ ios 
  javascript 
? Enter the name of your source directory: ../packages/my-mobile-app
...

Note that it would be great to be able to specify Xcode as an IDE, as well as a different folder for the mobile app’s source code. This different folder would be helpful for doing a codegen, for example.

Perhaps the amplify/.config/project-config.json file could hold an array of these frontend projects:

{
  "frontends": [
    {
      "projectName": "my-website",
      "version": "1.0",
      "frontend": "javascript",
      "javascript": {
        "framework": "react",
        "config": {
            "SourceDir": "../packages/my-website/src",
            "DistributionDir": "build",
            "BuildCommand": "npm run-script build",
            "StartCommand": "npm run-script start"
        }
      },
      "providers": [
        "awscloudformation"
      ]
    },
    {
      "projectName": "my-mobile-app",
      "version": "1.0",
      "frontend": "ios",
      "ios": {
        "config": {
          "SourceDir": "../packages/my-mobile-app"
        }
      }
      "providers": [
        "awscloudformation"
      ]
    },
  ]
}

Describe alternatives you’ve considered The current work around I’ve been toying with is to use lerna to create multiple packages. In that approach, I have a packages directory that contains a sub-folder for each frontend. However, for one thing, this approach gets problematic when wanting to generate code for an API. Also, for the second front-end that you add, you have to go through a very manual process of trying to ‘hack’ the pieces together for it to work and worry about not breaking the existing app. And there are some files that don’t support multiple front-ends, such as project-config.json.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:38
  • Comments:51 (9 by maintainers)

github_iconTop GitHub Comments

18reactions
ChristopheBougerecommented, Jun 17, 2019

Agreed with @houmark, having as single amplify project shared with multiple frontends would be the best. Something like this:

  • /amplify
  • /react
  • /react-native The CLI could handle this with a amplify frontend add command, similarly to categories.
18reactions
UnleashedMindcommented, Dec 13, 2018

Thanks for the feedbacks, marked the feature request, we will have a discussion among the team on this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building a React App With Server-Side Swift
In this tutorial, you'll learn to create a dynamic web application with React.js and integrate it with a Vapor server-side application.
Read more >
Top 10 Best Cross Platform App Development Frameworks
Cross-platform app frameworks are the tools used by the developers to create apps for multiple frameworks. Unlike native, cross-platform ...
Read more >
Team environments - Multiple frontends - AWS Amplify Docs
This workflow outlines the steps required to share a backend across two (or more) frontends. This example scenario is for a team building...
Read more >
Micro Frontend Architecture for Mobile Web Apps - Ionic Portals
Portals micro frontends allow multiple teams to build, test, and ship in parallel with hyper-focused embedded web experiences in your React Native, Android, ......
Read more >
My experiences of React Native vs Swift for iOS development
The application logic of a React Native app is just JavaScript and the code I have used to write logic in native iOS...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found