-
Notifications
You must be signed in to change notification settings - Fork 32
Installation
- npm - your own project. This is quick and easy way to create development environment for your own e-shop project, with demo data - so you can try it in minutes.
- Docker - latest StretchShop container for quick demo or if you don't need customization.
- Git - for contributors and everyone who like to see the code.
If you prefer video over text, this one describes the NPM installation:
Visit StretchShop Youtube Channel to see more https://www.youtube.com/channel/UCWge8fht1i0Wp0q2g9q2t6Q
Before trying to run app using npm, make sure you have:
- Node.js with npm installed (https://nodejs.org/en/download/)
-
MongoDB running - if you have docker, you can get it running using this
docker container run -d -p 27017:27017 --name mongo mongo
.
Note: This NPM setup is for development and demo purposes.
- In terminal (that command line tool that you should know, go to your working directory, where you want to have your project.
- In terminal run
npm i stretchshop
.
This should install latest stretchshop and create your own project in your directory based on it and get you the latest resources. Ready to start ... if you have data.
To get demo data, run this after installation was done (in the same directory):
node node_modules/stretchshop/demo/repo/db/demo_data.js
If your MongoDB requires authentication, you can add 2 more parameters with name and password for your MongoDB connection:
node node_modules/stretchshop/demo/repo/db/demo_data.js username password
Note: Demo is trying to access MongoDB on using DEFAULT authMechanism and authSource in admin database.
After you have Demo data successfully installed, run it with:
npm run dev
Now you should be able to view Demo version of StretchShop on http:https://localhost:3000 .
- Don't have required permissions - If you don't have required permissions on your work computer, ask administrator to get them. If you don't have required permissions on servers, don't get them - this NPM setup is not for test, stage or production (use Docker for that).
-
No MongoDB connection. Check if MongoDB is correctly installed, running on port 27017. If your MongoDB requires authentication, edit your
.env
file.
Before trying to run app from docker image, make sure you have:
- Docker and docker-compose installed
- for production, you need - web-server installed (eg. nginx or apache) and running
- firewall with port 80 allowed.
Note: You can run it even without web-server and firewall just with docker, but it will run on port 3000. That's fine if you want to try it on localhost https://localhost:3000 .
- download YAML docker-compose.yml
- download ENV docker-compose.env
- and run
docker-compose up
to get StretchShop in very basic form without data and custom resources. - see it on http:https://localhost:3000 .
- Install Docker if not installed.
- In terminal run
docker pull mongo:latest
to get MongoDB container. -
docker container run -d -p 27017:27017 --name mongo mongo
to run it. It's not running on port 27017, added to Docker's default bridge network and available from 172.17.0.2:27017 . -
docker pull wradgio/stretchshop:latest
to get latest StretchShop container. - Before we can let StretchShop run, we have to direct it to environment file. You can get one from StretchShop repo using
curl -o .env https://raw.githubusercontent.com/StretchShop/StretchShop/master/docker/mono/docker-compose.env
and update it like this:- comment row with TRANSPORTER so it looks like this:
#TRANSPORTER=nats:https://yourNATSname:yourNATSpassword@nats-server:4222
- update the row with MONGO_URI to use bridge network IP mentioned before, should look like this:
MONGO_URI=mongodb:https://localhost:27017/stretchshop_demo
- comment row with TRANSPORTER so it looks like this:
-
sudo docker container run -p 3000:3000 --env-file .env --rm --name stretchshop-test wradgio/stretchshop:latest
to run StretchShop in very basic form without data and custom resources. - see it on http:https://localhost:3000 .
- Create directory and clone GitHub repository there
$ git clone https://github.com/StretchShop/StretchShop.git .
(notice dot). - run
$ npm install
to install required libraries. npm run dev