- Environment
Node@^16
- Backend
express@~4.16
- Database
mongodb@5.0
redis@6.0
- Frontend Framework
vue@^2.6
- Dev tools
yarn@^1.22
vue-cli
docker>=19.03
docker-compose>=1.25
- Unit Testing
jest
It is recommended to use docker
for your dev environment.
To start a docker
container, run the following.
./shell/deploy.sh # for unix
Or
shell\deploy.bat && REM # for windows
Or
./shell/deploy-mac.sh # for mac
NOTE:
- Ensure mongo service is not running before running docker
- docker has enough resource like RAM (at least 4 GB), CPU, swap memory etc.
If you decide not to install docker
,
then install node
, mongodb
, yarn
with version mentioned in Section [Tech Stack](#Tech Stack).
Follow doc/Redis.md
for redis instruction
Follow doc/Mongodb.md
for mongodb instruction
Make sure you have @vue/cli
globally installed & yarn
is in your $PATH
yarn global add @vue/cli
To run only mongodb
on docker follow doc/Mongodb-Docker.md
To install the dependencies, run
yarn
Note:
- if any error from
sharp
inmac
while running this command, install vips first by runningbrew install vips
- If any error from
sharp
inubuntu
regardingpython
, ensurepython
command runs in terminal. - if there is any error regarding
‘remove_cv_t’ is not a member of ‘std’;
to install the dependencies, run
CXXFLAGS="--std=c++14" yarn
- Copy
server.config.example.json
asserver.config.json
- To get & set the
Google OAuth2 keys & secret
followdoc/Google-Api.md
- To get & set the
Fb Api key & secret
followdoc/FB-Api.md
- Update values if necessary. Match these values with docker compose if project is running in
docker
suppressApiLogging=1
will suppress api logging in consoleredisPort
is where the redis server is running. It is necessary ifsuppressQueue !==1
- If
baseServerUrl
is empty string, it will be calculated fromreq
. Otherwise it will take value from config - if
baseClientUrl
is empty string, it will be calculated fromreq
. Otherwise it will take value from config
devPort
&prodPort
defines in which port backend will run.
NODE_ENV
isdevelopment
for development. Setproduction
for production environment
6. Copy packages/client/src/configs/client.config.example.json
as client.config.json
and update values
- In a restricted memory,
vueBuildMemory
can be set lower than2048
MB, otherwise, keep it as example - On build to point client side in different base path
vuePublicPath
can be used. In general, in local environment it should be kept empty string. See more - If
baseServerUrl
is empty string, it will be calculatedwindow.location
. Otherwise it will take value from config
If u update utilities
or dto
workspace, restart the app, restart the IDE or run
yarn build:others
To start the development server, run
yarn serve
if vue hot reload doesn't work without docker, To start the development server, run
yarn serve:local
This will start the @vue/cli
server at https://localhost:8080
and express
server at https://localhost:3000.
NOTE:
If someone is running the projects first time they should set all the entry in scripts
collection as isExecuted: true
.
Those are one time scripts, so for new setup, there is no need to execute those scripts.
The backend server uses a certificate from
node_modules/webpack-dev-server/ssl
directory. This certificate is dynamically generated when the front-end server starts. Thus, if the backend server fails to start properly, then wait for the frontend server to start completely (and generate the certificate), and typers
and pressEnter
to restart the backend server.
Now, visit https://localhost:8080.
Generally you won't be needed to run this in development environment. However, if you want to do so for some reason, you can by running
yarn build
To run unit test
yarn test
This will run both client & server side tests.
To run client side tests only, run
yarn test:client
Note that while running client side test, you may see a warning saying
[Vuetify] Multiple instances of Vue detected See https://github.com/vuetifyjs/vuetify/issues/4068
You can safely ignore this warning.
To run the server side tests only, run
yarn test:server
Note that don't run server test while server is running in watch mode
To run client side linting, run
yarn lint:client
To run server side linting, run
yarn lint:server
We have added two commands to debug in deployment
vuex
: If you don't have access to Vue Devtool, you can access the Vuex state by typingvuex
in the console and pressing enter.jsonVuex
: TypingjsonVuex
in the console and pressing enter will provide the same data asvuex
but as JSON string.user
: Typinguser
in the console and pressing enter will output the logged in user as JSON string.state
: Typingstate
in the console and pressing enter will output the state of each component as a hierarchical tree.getStateOf
: You can usegetStateOf(componentName: string)
to find the state of a specific component. Since the same component can exist in multiple places in a DOM, this function will return an array.
- Run
yarn upgrade-interactive --latest
to upgrade package after first setup if needed.