This repository contains the code for the backend of skillmarket.uk. This is a NodeJS application that uses Express.
This application uses Redis with the RediSearch module as a database.
You can find the corresponding frontend application in this GitHub repo.
This project was submitted to the Redis 'Beyond Cache' Hackathon, you can see the submission and vote for it here.
npm install
npm start
npm test
npm run lint
You will need your own Redis instance with the RediSearch module installed. You can use Docker, just run the following command to launch a container:
docker run -p 6379:6379 redislabs/redisearch:latestIf you want to set a password, you can ssh to the docker container and run the config command in redis-cli:
$ docker exec -it <your-container-name> redis-cli
> config set requirepass <your-password>To develop locally, you can use Skaffold to build the Docker image and deplooy to a Kubernetes cluster (minikube).
Start the minikube node:
minikube startUpdate the value of the CORS_ORIGIN_HOST env variable with the URL for the frontend in the k8s deployment config. If the frontend runs locally with skaffold too, just change the port to the output of minikube service skillmarket-front-node-port
In one terminal run skaffold in dev mode, which will run a dev server which refreshes on code change.
skaffold devTo access the server locally, just forward the service port locally with minikube:
minikube service skillmarket-backend-node-portYou will need to define the following Environment variables:
REDIS_HOST="your-redis-host-IP"
REDIS_PASSWORD="your-redis-passowrd"
APP_HOSTNAME="your-app-hostname"
PORT="your-app-port"
CORS_ORIGIN_HOST="the-url-of-the-frontend"
SESSION_SECRET="your-express-session-secret"