This is a monorepo for portal www.mezinamiridici.cz
spa
is the single page Vue.js application that delivers the website experiencebackend
is the NodeJS backenddeploy
is a configuration for Nginx server
##Prerequisities
- download and install NodeJS 12. It needs to be on your path so you can start it from any directory.
- download and install MongoDB 4.2 or newer.
- You might need to unblock the ports 8080 (web), 3000 (backend) and 27017 (mongo) in your firewall.
Import the data:
cd backend/doc/database
# install indexes and constrains
mongo bud mongo_setup.js
cd ../..
# generate demo database (backend server must not be running!)
node test/generate_sample_data.js
If you need to recreate the database, clear Mongo with:
mongo bud --eval db.dropDatabase()
and repeat the import procedure.
Copy .env.template
to .env
and update as needed. You may need to set
your local IP address in CORS_ORIGINS property.
Copy spa/public/config/local.js
to spa/public/runtimeConfig.js
and
update the target file as needed. If you want to access the site from
other devices (e.g. mobile phone), you should point the endpoint
URL properties to your real IP address (not localhost or 127.0.0.1).
The first terminal:
$ cd backend
$ npm install
$ npm run dev
The second terminal:
$ cd spa
$ npm install
$ npm run dev
To log in, use the users defined in backend/test/prepareUsers.js
and password BadPassword
.
This set up is neccessary only for testing the OAuth login (Facebook).
Install Nginx and copy deploy/dev/nginx.conf
to its conf
directory. Fix the path in root
directive.
The first terminal:
$ cd backend
$ npm install
$ npm run dev
The second terminal:
$ cd spa
$ npm install
$ npm run buildDev
$ cd /path/to/nginx
$ nginx