Skip to content

Latest commit

 

History

History
113 lines (90 loc) · 2.54 KB

README.md

File metadata and controls

113 lines (90 loc) · 2.54 KB

Scheduler

Table of content

Installation

Docker

Install Docker

  1. Install docker
    curl -sSL https://get.docker.com | sh
    
  2. Allow Docker to be used without being a root
    sudo usermod -aG docker $USER
    
  3. Restart
    reboot
    

Build image from source

  1. Make sure git is installed

    sudo apt install git
    
  2. Clone this project

    git clone https://github.com/mohamednehad450/Scheduler.git
    cd Scheduler
    
  3. Build the image

    docker build -t scheduler .
    
  4. Create a container

    docker container create --name scheduler_container -p 8000:8000 -v /sys:/sys -e TOKEN_KEY=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 50) scheduler
    
  5. Start the container

    docker start scheduler_container
    

Download from DockerHub

  1. Create the container
    docker container create --name scheduler_container -p 8000:8000 -v /sys:/sys -e TOKEN_KEY=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 50) -e DATABASE_FOLDER=database mohamednehad450/scheduler
    
  2. Start the container
    docker start scheduler_container
    

From source

  1. Make sure git is installed

    sudo apt install git
    
  2. Install node 18 using nvm or from here

  3. Clone this project

    git clone https://github.com/mohamednehad450/Scheduler.git
    cd Scheduler
    
  4. Install dependencies

    npm install -g pnpm
    pnpm i
    

    If you are having troubles installing, make sure you are running gcc/g++ -v 4.8 or higher. Here is an installation guide.

  5. Build the project

    pnpm build
    
  6. Add environment variables to the .env file

    # Database file name
    echo DATABASE_FOLDER=\"database\" >> .env
    
    # Random 50 characters long string for token signing
    echo TOKEN_KEY=\"$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 50)\" >> .env
    
    # Server port, Default is 8000
    echo PORT=\"8000\" >> .env
    
  7. Start the server

    pnpm start
    

API docs

All of the API documentation and database models are in api-docs.yaml,you can view it in SwaggerHub.