Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated to Turborepo (Monorepo Structure) #8

Merged

Conversation

Ansh-Sarkar
Copy link
Collaborator

@Ansh-Sarkar Ansh-Sarkar commented Sep 25, 2022

Signed-off-by: Ansh Sarkar [email protected]

Issues: #7 & #3

Description

Migration of existing repository structure to a monorepo using Turborepo in order to improve scalability and Developer Experience (DX) by enabling division into workspaces, caching and faster builds.

Changes

  • Added 3 workspaces in accordance to recommended configuration of workspaces.
  • Added turborepo for monorepo management and concurrent for executing parallel tasks in NodeJS.
  • Added turborepo configuration in turbo.json for caching outputs of build and build-docs scripts.
  • Enabled concurrent execution of tasks. Improved build time.
  • Single command setup for packages enketo-core, enketo-express and form-manager and sample application wrapper.
  • Modified directory structure according to workspace configuration defined in package.json.
  • Added npm run start for installing dependencies and starting all services.
  • Added npm run build for building necessary modules as well as documentations.

How to test

  • Clone repository locally
git clone https://github.com/Samagra-Development/workflow.git
  • Switch to the repository directory
cd workflow
  • Start the project
npm run start

The above command will automatically install, set up and run all the packages and applications. Docker is required. After successful build you should be able to view the form at : http://localhost:3000/

Note: Initial build takes roughly 20 - 25 mins, due to enketo-core. Subsequent builds take less than 1 min. The react frontend will show an error localhost refused to connect until enketo-core has finished building. Once the build is successful, refreshing the fronted will render the form.

For building the modules and documentations you can run the build script as follow

npm run build

@Ansh-Sarkar
Copy link
Collaborator Author

@ChakshuGautam @Shruti3004 requesting a review of this PR. Thanks !

@ChakshuGautam ChakshuGautam merged commit c286cf9 into Samagra-Development:main Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants