Skip to content

Gibitop/interview-platform

Repository files navigation

Interview platform

A self-hostable platform for conducting technical interviews

Screenshot

Table of contents

Usage

Generate JWT keys

./tools/generate-jwt-keys.sh

Generate a .env file

./tools/generate-env.sh

Build all room images

docker compose -f ./compose.insiders.yml build

Build and start the application

docker compose up --build

Development

Generate JWT keys

./tools/generate-jwt-keys.sh

Run

docker compose up

To generate a docker network need for backend to work
You can kill the process with ^C after a few seconds

Web

  1. Go to the web directory
    cd web
  2. Install dependecies
    npm install
  3. Start dev server
    npm run dev

Note

While in local development mode you can only connect to one instance of insider

Backend

  1. Go to the backend directory
    cd backend
  2. Install dependecies
    npm install
  3. Launch docker daemon
  4. Create a Postgres DB
  5. Create a .env file like this
    NODE_ENV='development'
    DATABASE_URL='postgres://<postgres user>:<postgres password>@<postgres host>:<postgres port>/<postgres db name>'
    DOCKER_SOCKET_PATH='<path to your docker socket, ususally: /var/run/docker.sock>'
    HASHING_SECRET_HEX='<output of openssl rand -hex 32>'
    REGISTRATION_OPEN='true'
    INSIDER_PERSISTENCE_DIRECTORY_PATH='/persistance'
    INSIDER_WORKING_DIRECTORY='/interview'
    INSIDER_START_ACTIVE_FILE_NAME='readme.txt'
    USE_LOCALHOST_INSIDER='true'
  6. Run DB migration
    npm run drizzle-migrate
  7. Start dev server
    npm run dev

Tip

You can prototype DB changes using

npm run drizzle-push

Important

Before committing, run

npm run drizzle-generate

To save your changes as a DB migration file

Insider

  1. Go to the insider directory
    cd insider
  2. Create a .env file like this:
    NODE_ENV='development'
    WORKING_DIRECTORY='./wd'
    START_ACTIVE_FILE_NAME='readme.txt'
    ROOM_INFO='{"json":{"id":"69a1c450-9701-4c0d-bb36-b839c79f3526","name":"test-room","type":"node","createdAt":"2024-10-02T19:57:11.011Z"},"meta":{"values":{"createdAt":["Date"]}}}'
    PERSISTENCE_DIRECTORY_PATH='./persistence'
  3. Install dependecies
    npm install
  4. Start dev server
    npm run dev

Security

Currently we expose the host's docker socket to the backend container and to the traefik container. This means that if the backend container is compromised, the attacker will effectively have root access to the host machine
Why this is dangerous
Traefik docs on this matter

For this reason

Caution

For production use this inside a virtual machine or on an isolated server

In future there is a plan to move to resolve this issue, but additional research is needed.

Scalability

Currently horizontal scaling is not supported. This should not be a problem for most users, who want to use the system for technical interviews in their company

However horizontal scaling through kubernetes might be supported in the future

About

A self-hostable platform for conducting technical interviews

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages