An embedded app starter template to get up and ready with Shopify app development with JavaScript.
- Express x React x Vite x MongoDB repo is now live here
- This repo will still be updated for as long as I can maintain it, since I have production apps running on this boilerplate.
The Shopify CLI generates an amazing starter app, but I wanted a quick-start app that had:
- MongoDB based sessions/persistence.
- Recurring Subscriptions setup and ready to go.
- Local Tunnel instead of Ngrok to avoid use of commercial software.
- Misc boilerplate code and templates to quickly setup inApp subscriptions, routes, webhooks and more.
-
If you're new to Shopify app dev or need an in-depth guide, refer SETUP.md instead.
-
Run
npm i --force
to install all dependencies. -
Create
.env
file based on.env.example
. -
Run
npm run tunnel
and add the URL atSHOPIFY_APP_URL
in.env
and your app settings in your Partner Dashboard.- If you don't update the URL in
.env
and app settings, you're going to run into "URI Not Whitelisted" error.
- If you don't update the URL in
- The GDPR endpoints are available in
routes/gdpr/
folder. Add the following URLs in the GDPR section of your App Setup- Data Request Endpoint:
/app/gdpr/customers_data_request
- Data Erase Endpoint:
/app/gdpr/customers_redact
- Shop Data Erase Endpoint:
/app/gdpr/shop_redact
- Data Request Endpoint:
- Open two terminal windows with
npm run tunnel
andnpm run dev
, this way you have one session running thelocaltunnel
at all times. - If you're using a locally hosted version of MongoDB, ensure
mongod
server is running.- To specify a directory for your MongoDB database, run
mongod --dbpath /path/to/directory
- To specify a directory for your MongoDB database, run
- Most scripts in
package.json
containrm -rf .next
to remove the generated.next
folder to reduce caching errors. If you're on Windows, please switch them out tormdir .next
- MongoDB collections are kept separate to allow for flexibility while building applications. Feel free to rewrite them.
- When pushing to production, add
__templates
to.gitignore
.