Skip to content

redis-developer/skillmarket-backend

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Skill Market Backend

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.

Project setup

npm install

Run

npm start 

Test

npm test

Lints and fixes files

npm run lint

Database set up

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:latest

If 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>

Local development

To develop locally, you can use Skaffold to build the Docker image and deplooy to a Kubernetes cluster (minikube).

Requirements

Start the minikube node:

minikube start

Update 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

Run in dev mode with Skaffold

In one terminal run skaffold in dev mode, which will run a dev server which refreshes on code change.

skaffold dev

To access the server locally, just forward the service port locally with minikube:

minikube service skillmarket-backend-node-port

Deployment

You 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"

About

Contains the backend for the Skill Market application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.6%
  • Dockerfile 0.4%