You do not need any computer skills, smarts, or anything of that nature. You are very capable as you have made it this far. Some basic understanding how a terminal, git, and or Node.js is a bonus, but that does not limit you to getting streetmerchant running!
- git
- Either Node.js 16 (LTS) or Docker (advanced users)
Reference | Note |
---|---|
tag | Example, v1.0.0 ; stable |
main |
Latest HEAD; not tagged, could be unstable |
- Download Node.js 16
- Clone this project
git clone https://github.com/jef/streetmerchant.git
.- To checkout a particular reference, use
git checkout <ref name>
after cloning.
- To checkout a particular reference, use
- Navigate to this project by entering
cd streetmerchant
. - Run
npm install
. - Make a copy of
dotenv-example
and name itdotenv
. - Edit the
dotenv
file to your liking using a text editor (like vscode). - Run
npm run start
to start.
At any point you want the program to stop, use ++ctrl+c++.
???+ tip Community based help can also be found on the wiki. Feel free to check that out if you're having problems running. If you're still having problems running, you're probably not the first. Make some searches through the GitHub issues before making one.
Available via GitHub Container Registry.
Tag | Note |
---|---|
latest |
Latest release; stable |
nightly |
Latest HEAD each day at midnight UTC; could be unstable |
# to run docker nightly
docker run -it --rm \
--env-file ./dotenv \
ghcr.io/jef/streetmerchant:nightly
# to test notifications
docker run -it --rm \
--env-file ./dotenv \
ghcr.io/jef/streetmerchant:nightly test:notification:production
See Developing in docker for more information
To customize streetmerchant, make a copy of dotenv-example
as dotenv
and make any changes to your liking. View Reference for more information on variables and their usage.
???+ tip All environment variables are optional.
The command npm run start:dev
can be used instead of npm run start
to automatically restart the project when filesystem changes are detected in the src/
folder or dotenv
file.
Use npm run lint
to see any linting uses and npm run fix
to automatically fix the issues it can.
- Docker (1.13.0+)
- GNU Make
- Optional, but increases quality of life
- Docker Compose
- Depending on your system, you may already have this. Check before installing.
- Make a copy of
dotenv-example
and name itdotenv
. - Edit the
dotenv
file to your liking using a text editor (like vscode). - If you're using
make
, you can runmake run
to start andmake stop
to stop.- There are more options in the
Makefile
, feel free to explore.
- There are more options in the
- If you do not have
make
, you can rundocker-compose
directly:
# To start
# Use `-d` if you want to run in detached mode
# Use `--build` if you want to build the image before running (default image is latest in GitHub Container Registry).
docker-compose up
# To break down
docker-compose down
???+ note
If you are using WEB_PORT
, then you will need to add the following to docker-compose:
```
ports:
- "<WEB_PORT>:<WEB_PORT>"
```
Replace `<WEB_PORT>` with the value you gave in your `dotenv`.
- Heroku CLI
- You will need a Heroku Account.
- GIT
- Make sure the PATH is set correctly, so you can use it in you command line.
- StreetMerchant
- If you don't already have it.
- Make a copy of
dotenv-example
and name itdotenv
. - Edit the
dotenv
file to your liking using a text editor (like VSCode or even Notepad). - Find the option
OPEN_BROWSER
and set it toOPEN_BROWSER=false
- After this, I recommend you setup some form of contacting your directly in the dotenv file as well.
- This can be phone, email, or whatever you'd want. The information won't be public.
- Save and close file.
- Locate the
.gitignore
file and open it.- Remove
build/
anddotenv
. - Save and close file.
- Remove
- Locate the
package.json
file and open it.- Locate the
"posttest"
config.- Under it, paste:
"postinstall": "npm run tsc",
"tsc": "tsc", - Under it, paste:
- Locate the
- Create a file called
Procfile
with no type declaration(.txt/.doc/.etc.)- Open it with Notepad
- Paste:
worker: npm run start:production
- Close and save file
- Navigate to
src/
and find the fileindex.ts
- Open with IDE or Notepade
- Find
const args: string[]
- Replace with:
const args: string[] = [ '--no-sandbox', '--disable-setuid-sandbox' ];
# To start
# Open a terminal and navigate to the master street merchant directory
# From there start this
heroku login
# Follow the steps to login
- Leave that terminal up, and go to your Heroku apps
- Create a new app:
- Name it, and then click
Create App
- Go to
Settings
and add two buildpacksheroku/nodejs
https://github.com/jontewks/puppeteer-heroku-buildpack
Back to the terminal that you left open.
- Type
git init
- Once that finishes copy and paste:
heroku git:remote -a YOURAPPNAME
but make sureYOURAPPNAME
is whatever you named your app on Heroku. - Then type
git add .
- Once that finishes paste
git commit -am "COMMITMESSAGE"
, replacingCOMMITMESSAGE
with whatever commit message you'd like. This doesn't matter much. - The last thing to do in the terminal is to push your repo to Heroku
- Paste
git push heroku main
- This will take a while
- Paste
- On your Heroku app, click on the tab
Resources
- Click the pen icon on both to edit their states.
- Turn off
web npm start
- Turn on
worker npm run start:production
- Click confirm on both.
- Now you're essentially done!
- I recommend you click on the
more
dropdown and clicklogs
to make sure everything is running smoothly. - If you set up notifications, you will be notified when you criterias are met(3060 in stock, etc.), otherwise you'll have to keep your eyes on the
logs
tab
- I recommend you click on the