An embedded app starter template based on Shopify.dev Tutorial, but with MongoDB, more boilerplate code and App Bridge 2.0.x.
The Shopify CLI generates an amazing starter app, but I wanted a quick-start app that had:
- MongoDB based sessions/persistence.
getSubscriptionUrl
hooked up and ready to go.- Local Tunnel instead of Ngrok to speed up my dev process.
- Starter files and templates to get up to speed with development.
- Run
npm i --force
to install all dependencies. - Create
.env
file based on.env.example
. - Add
--subdomain <your-subdomain-name>
to thetunnel
script inpackage.json
to have a static subdomain and update the value atSHOPIFY_APP_URL
in.env
and your App Settings in your Partner Dashboard. - [Local Only] Update the
--port
intunnel
script inpackage.json
if you're using a different port than8081
.
- Open two terminal windows with
npm run tunnel
andnpm run dev
, this way you have one session running thelocaltunnel
at all times. - 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. - MongoDB collections are kept separate to allow for flexibility while building applications.