Skip to main content

Architectural Overview

architectural-overview

The webshop is built with MedusaJS, a headless commerce engine. It is a NodeJS application that uses a Postgres database to store data. The application is built with a modular architecture, with a separate backend, admin and storefront. The backend is used to manage the store, the admin is used to manage the products and orders, and the storefront is used to display the products and checkout. The storefront is built with NextJS, a React framework. The documentation is built with Docusaurus, also a React framework.

Docs

This documentation site is built with Docusaurus and hosted on Vercel. The documentation is written in Markdown or MDX and the site is built with React.

Custom domain: https://docs.edstromsdeli.se Repo: https://github.com/jacobedstrom/edstroms-deli-docs

Backend

The medusa backend server is hosted on Railway an app service. It uses a postgres database and a redis cache, also hosted on Railway.

It is possible to run the backend locally by setting the database and cache url in the .env file. This allows the storefront to be run locally as well, otherwise there are CORS issues.

Custom domain: https://backend.edstromsdeli.se Repo: https://github.com/jacobedstrom/edstroms-deli-backend

Admin

The medusa admin has to be hosted separatly from the backend service. It has to be hosted on the same domain as the backend, otherwise there are CORS issues. It is hosted on Vercel.

Custom domain: https://admin.edstromsdeli.se Repo: https://github.com/jacobedstrom/edstroms-deli-admin

Storefront

The storefront is built with NextJS, based on the Medusa Storefront Starter. It is hosted on Vercel. Similar to the admin, it has to be hosted on the same domain to avoid CORS issues.

Custom domain: https://www.edstromsdeli.se Repo: https://github.com/jacobedstrom/edstroms-deli-medusa-storefront

File Storage

The file storage is required for storage of product images and it is hosted on AWS S3. The files are uploaded through the Medusa admin, and the files are then stored in the S3 bucket.

Algolia search is used for the webshop. The webshop index is created from the Medusa backend, and then made available through the storefront.

For the Docs, the local search engine docusaurus-lunr-search is used instead, to allow for password protection of the site. Algolia otherwise requires that the site is publicly available.

Domains

The domains and SSL certificates are bought through www.strato.se.