Was this article helpful?
Thanks for your feedback
A boilerplate is a fitting template to describe distinct repetitive segments of a project to help build projects quickly and efficiently.
They can define project-level elements or standard methods for one or more projects.
The following guide shows how to build an app using our Marketplace App boilerplate. For more information about the Marketplace App boilerplate, you can check the GitHub repository here.
The boilerplate folder structure consists of relative files and references, making it easy to acclimate within your project. This structure also allows the boilerplate to be thoroughly portable between different stacks in Contentstack.
Below is the folder structure of the boilerplate:
MARKETPLACE-APP-BOILERPLATE ├─ rte | ├─ src | └─ package-lock.json | └─ package.json | └─ README.md | └─ tsconfig.json | └─ webpack.common.js | └─ webpack.dev.js | └─ webpack.prod.js ├─ src | ├─ components | └─ hooks | └─ images | └─ routes | | ├─ AppConfiguration.tsx | | └─ AssetSidebar.tsx | | └─ CustomField.test.tsx | | └─ CustomField.tsx | | └─ EntrySidebar.tsx | | └─ StackDashboard.tsx | └─ store | └─ test-utils | | ├─ App.tsx | | └─ function.ts | | └─ index.css | | └─ index.tsx | | └─ MarketplaceAppProvider.tsx | | └─ react-app-env.d.ts | | └─ reportWebVitals.ts | | └─ setupTests.ts | | └─ types.ts | └─ .gitignore | └─ package-lock.json | └─ package.json | └─ playwright.config.ts | └─ README.md | └─ tsconfig.json
Below are the App routes for each location in App.tsx:
function App() { return ( <ErrorBoundary> <MarketplaceAppProvider> <Routes> <Route path="/" element={<div>Nothing to show here</div>} /> <Route path="/custom-field" element={ <Suspense> <CustomFieldExtension /> </Suspense> } /> <Route path="/entry-sidebar" element={ <Suspense> <EntrySidebarExtension /> </Suspense> } /> <Route path="/app-configuration" element={ <Suspense> <AppConfigurationExtension /> </Suspense> } /> <Route path="/asset-sidebar" element={ <Suspense> <AssetSidebarExtension /> </Suspense> } /> <Route path="/stack-dashboard" element={ <Suspense> <StackDashboardExtension /> </Suspense> } /> </Routes> </MarketplaceAppProvider> </ErrorBoundary> ); }
To get started with building applications using the boilerplate, follow the steps given below:
npm install
npm start
To use your application, you need to upload it to Contentstack. To do so, perform the steps given below:
Note: After adding each route, click save.
├─ rte | ├─ node_modules | └─ src | | ├─ public | | └─ type | | | ├─ index.css | | | └─ plugin.tsx | | └─ package-lock.json | | └─ package.json | | └─ README.md | | └─ tsconfig.json | | └─ webpack.common.js | | └─ webpack.dev.js | | └─ webpack.prod.js
npm install
npm start
Next, you can refer to the Get Started with Building Apps using Contentstack’s App SDK guide to start using the Contentstack App SDK in creating your apps.
Was this article helpful?
Thanks for your feedback