StretchShop Installation

Опубликовано: 04 Июль 2026
на канале: StretchShop
245
3

Our first guide will show how to run StretchShop on your computer in a development environment to create your e-commerce solution.

------ 1. Commands ------

Ubuntu-specific installation of Node.js and NPM:
$ sudo apt update
$ sudo apt install nodejs npm

Checking version of Node.js and NPM:
$ node --version
$ npm --version

The shortest way to run MongoDB in a container - notice that you will lose your data once you remove the container:
$ sudo docker container run -d -p 27017:27017 --name mongo mongo
If you don't want to lose your data:
a) create volume to store data at
$ sudo docker volume create mongoVolume
b) create a container that stores MongoDB data on that volume
$ sudo docker container run -d -p 27017:27017 -v mongoVolume:/data/db
--name mongo mongo
c) if you want that container to start itself on OS boot
$ sudo docker container run -d -p 27017:27017 -v mongoVolume:/data/db --restart=always --name mongo mongo

Change directory:
$ cd Development
Create all directories in the path (you need to have permissions):
$ mkdir -p stretchshop/backend

Install StretchShop:
$ npm install stretchshop
or short version:
$ npm i stretchshop

Install demo data:
$ node node_modules/stretchshop/demo/repo/db/demo_data.js

Run StretchShop server:
$ npm run dev
See package.json for more available commands.

Frontend commands:
To install after you have it, $ npm install (default NPM command for installing from package.json).
To run development server $ npm run serve (use only for development).

------ 2. Links ------

This guide shows how to install Node.js (the engine that runs StretchShop) and NPM (the dependency manager) on Ubuntu in the most straightforward way. See the Node.js website to learn about how to install it on your OS:
https://nodejs.org/en/download/

I am using the most simple one for this presentation purpose. Anyway, I recommend using NVM (Node Version Manager) as a more sophisticated way of managing Node.js and using the latest stable version:
https://github.com/nvm-sh/nvm

StretchShop is a friend with containers. To start with them, you may like to install Docker - visit their website to learn how:
https://docs.docker.com/engine/install/

Default StretchShop data storage is MongoDB, and if you are not able to run it from the container, you would like to read this page:
https://docs.mongodb.com/manual/insta...

Mingo is the best MongoDB admin GUI I have found yet:
https://mingo.io/

Visual Studio Code is a free source code editor, and you don't know it already, you should change it:
https://code.visualstudio.com/Download

------ 3. Chapters ------
0:00 - Introduction
1:22 - Install Node.js & NPM
2:16 - Run MongoDB
3:35 - Install StretchShop
4:19 - Get demo data
4:50 - Run StretchShop
5:21 - BONUS: Change the Frontend