Skip to content

Project installation

Darek edited this page Nov 19, 2023 · 3 revisions

Requirements

*lower versions not tested

  • Mongo (7.x.x)
  • Node (18.16.x)
  • Yarn (1.22.x)
  • Typescript (5.x.x)

Environment variables

*you can find .env.exmaple files in both service and client sub directories.

*simply copy the example file and rename it to .env

Server

  • PORT (required)- port which the server will run on
  • DB_URI (required) - URI for the database which you will use/ For local development it will probably be hosted on mongodb://localhost:27017/<name-of-the-database>
  • ACCESS_TOKE_SECRET - a string which will be used to encode the JWT access token
  • REFRESH_TOKE_SECRET - a string which will be used to encode the JWT refresh token
  • DB_SEED (true, false)= an optional setting which will allow for the usage of /seed endpoint for generating random data in the database.
  • CORS_URL (required in development) - used for development purposes to whitelist clients (client URL)
  • APP_ROUTE_PREFIX - API route prefix, specify how API endpoints are accessed in yuor application, eg. localhost:8080/<prefix>/task default value is api

Client

  • VITE_API_URL (required in development) - specify the URL to the API which will be served to the client
  • VITE_DEMO_USER_USERNAME - username of the user which will be preseted to visitors to demo the pass
  • VITE_DEMO_USER_PASSWORD - password of the user which will be preseted to visitors to demo the pass

Instalation steps

* This project is setup with yarn workspaces which means that you can call all your commands from the root directory and don't have to cd into server or client directories to install or run any specific scripts

  1. Setup Database. If you are using docker you can use the docker-compose.yml file to setup mongodb, just run docker-compose up -d.
  2. In root directory run yarn install - all of the dependancies for client and server will be installed.
Clone this wiki locally