SEM SEM (Solidarity Economies Marketplace) Application starter repository.
$ npm install
$ cd client
$ npm install
.env file in root folder needs the following vars:
DB_RELATIVE_PATH=data/sqlite.db
ADMIN_PASSWORD=test1234
OPENAI_API_KEY=sk-abc........................................xyz
NODE_ENV=test (or prd)
CORS_ORIGIN=http://localhost:3001
SERVER_PORT=3000
OUTDATED_PRODUCT_DELETE_TIMEOUT_DAYS=3 #optional , default 3 if var not defined
.env file in /client subfolder needs the following vars:
REACT_APP_NAME=Comunità Solidali
REACT_APP_SERVER_BASE_URL=http://localhost:3000/
# server (must run on port 3000)
$ npm run start
# client
$ cd client
$ npm start
Admin can login (with password set in .env file) to panel from homepage widget top-right , where they can set the crawling/parsing parameters:
When npm run start
is launched from terminal , if the terminal gets closed , also the npm process terminates , since it is a child process.
Npm needs to be launched in background then. A way to do it that is specific to Node JS , is by using the pm2
package.
install:
npm install pm2@latest -g
scheduling a command: enter the node project directory, and do:
pm2 --name ExampleProcessName start npm -- start
verify that it has been scheduled:
pm2 ls
delete all scheduled processes:
pm2 delete all
to delete only a specific process: indicate its id instead of "all". E.g. to cancel the process with id 0 as seen in the screenshot:
pm2 delete 0
to read the logs produced by a process:
pm2 logs 0 --lines 1000
where 1000 is the number of lines to be printed , from the most recent one, and 0 is the process id
Typically you will launch the SEM backend in background:
pm2 --name SEMBackendCrawler start npm -- start
.cd client
pm2 --name SEMFrontend start npm -- start
SEM is an GPL 3-licensed open source project.
SEM is GPL 3 licensed.