jo-cpa
November 4, 2021, 10:40pm
1
Is it possible to copy a page or merge apps in Appsmith?
I tend to model things in a sandbox first.
Do I really have to recreate everything to add my new page to an existing app?
Nikhil
November 8, 2021, 6:03am
2
Hi @jo-cpa we’re working on this using our git sync feature. You can track this issue below
opened 03:50PM - 24 Feb 21 UTC
Enhancement
Platform Pod
Git Version Control
Epic
Team Managers Pod
Project
## Problem statement
Today we get a lot of requests around migrating applicatio… ns between instances as well as moving applications across organizations.
There is also a need to have some kind of version control that will make it easy to restore the state of applications.
This should also make it easy for other developers in a team to do code reviews of changes to applications.
Changes to an application by a developer should not overwrite the changes other developers make.
## Related issues
- [x] #488
- [x] #2285
- [x] #3089
- [x] #3190
# Solution
- Make it easy to bring up Appsmith locally
- Make it easy to get access to the application I need to work on
- Make it easy to get my changes reviewed, approved and merged as one process
- Make it easy to develop and test in different environments
# The Story
## Discovery
A developer comes to appsmith and wants to try it out. She runs a docker command and gets it running on her local system #4430. A browser window opens and she is welcomed. She mentions that she is developing locally and the mode of the app changes to offline mode. She goes through our onboarding. She is prompted to connect to her data source. She is able to easily connect to her local API / DB without NGrok. She is in an offline mode and is not able to share/invite users to her application.
- No account creation or need for access
- Direct connection to local datasources
- No organisations
## Sharing
She builds her first application with a lot of excitement and wants to share it so everyone gets access to it. This prompts her to connect a Git Repository and select a directory to commit her app & docker-compose file to. The readme of the repository is also updated with
1. The steps of starting the application locally
2. The documentation links
3. The discord support links
4. The name / image of the app
[https://github.com/Nikhil-Nandagopal/codesandbox](https://github.com/Nikhil-Nandagopal/codesandbox)
After the git repo is connected, the user is asked to connect to deploy a cloud version and is prompted to either select appsmith cloud or their own private cloud. Selecting appsmith cloud will ask the user to create / sign in to an account. Once this is successful, the user has to select an organisation and the app gets created in that org.
If the user select private cloud, they are prompted to deploy appsmith using the steps below
- Docker
- K8s
- Heroku
- AWS
They must then enter the URL of their appsmith login page and follow the steps to login / select the org.
She accesses her appsmith cloud and is prompted to create the datasources that she created locally. She then invites all her users to use the app. She should be able to change the cloud environment she is pointing to.
## Iteration
Her users get invites to the application and begin trying it out. They leave her feedback using the commenting feature which she receives via email. She opens the application on her local and is able to see all the comments. She creates a branch of the application and makes changes to it. She configures new datasources on this branch that point to her staging environment. She is able to make changes to the application on this branch and test them out. She then hits deploy which commits the changes to the new git branch and she is given the link of the branch. She now raises a pull request from this branch to master and pings a colleague to review/test the changes. The colleague goes over the PR, uses a visual diff tool, tests it, and approves it. The PR is merged to master and the new changes of the application are deployed to all users. The actions do not change the datasource they were pointing to on merge.
## Evangelism
As more developers review her PR, they are able to see a link of the cloud instance of the tool in the PR to review & test. They try out the tool and are automatically able to get access to it by authenticating with a common Google domain or setting it up locally.
They begin to learn more about the tool and try to create an app. All the underlying deployment & environment infrastructure is already set up for them. New developers in the team are easily able to check out the app locally and request access to take their changes online.
Every new app developed locally must be committed to a git repo and select an organization in the cloud to be a part of.
## Git Syncing
App branches may go out of sync or have merge conflicts and we should intimate developers of this and allow them to manually update their branches as well as inform them of conflicts and links of where to resolve them.
Users can authentication with a git repo specifying their username/password or their public key.
Users should enter the git path to connect to a repo.
Every commit should autogenerate a message. Users can manually specify a message for certain commits.
(Enhancement) Allow users to authenticate with Github to select their git repo and credentials.
# Summary
1. Developers can easily bring appsmith up locally using a docker-compose file. #4430
2. There is a version of appsmith in their cloud which business users use.
3. All local instances can switch between online/offline versions. The offline version is limited without auth, users, orgs and contains apps from all the repos that the user has access to.
4. Developers can create a version of an app from anywhere (cloud / local) & commit it to a git branch in the global git repo.
5. The cloud backend is reading/updating each application from a git branch.
6. Comments and feedback can be given on individual versions of the application on the git branch
# CE Constraints
1. Each commit comes with a hash generated by the instance. This hash contains the hash of the version and a secret of the instance to prevent rehydration on any system that is not the instance that created it. This prompts larger companies that need staging and production on separate sandboxes to pay for us.
2. Environments will not be available and all datasources are tracked against the branch (except secrets)
# Flows
1. Deploying Appsmith Locally #4430
2. Connect to their local data sources
3. Switch between offline & live modes
4. Deploy their app to a cloud instance
5. Connect their app to a git repo
6. Commit changes
7. Create branches for their apps & Sync apps across branches
8. Deploying changes to branches
## Details
The Git Repository must have a clean human-readable structure.
Pages
-- Page1
-- Widgets
---- Widget1
---- Widget2
---- Widget3
-- Actions
---- Action1
---- Action2
Datasources
-- Datasource1
Each widget / action / data source should have a clean JSON of it's properties
The git repository must have a readme with the information of the application and appsmith.
## Figma
https://www.figma.com/file/TdPXDzYZvb11PYUmVAU4r1/Local-Dev-Flows?node-id=0%3A1&viewport=683%2C-1019%2C0.2663029432296753
https://www.figma.com/file/lqtUfzJO50RpEhxKttYeOg/?node-id=1173%3A20974
## Test env
http://ec2-3-108-64-217.ap-south-1.compute.amazonaws.com