Skip to content

Installation

  1. Install prerequisites

    Before you begin, ensure you have the following tools installed on your system:



  2. Clone the repository

    Choose one of the following methods to clone the project:

    Terminal window
    # Using HTTPS
    git clone https://github.com/OAMK-tietotekniikka/ProjectsMS.git


    Terminal window
    # Using SSH (if you have SSH keys configured)
    git clone git@github.com:OAMK-tietotekniikka/ProjectsMS.git


    Terminal window
    # Using GitHub CLI
    gh repo clone OAMK-tietotekniikka/ProjectsMS


    Navigate to the project directory:

    Terminal window
    cd projectMS


  3. Install dependencies

    The project has a multi-package structure. You’ll need to install dependencies first:

    • DirectoryprojectMS (install dependencies here)
      • Directorydbinit
        • init.sql
      • Directoryserver (backend)
        • files
        • package.json
      • Directoryfrontend (frontend)
        • files
        • package.json
      • package.json
      • .gitignore

    Install dependencies:

    Root directory (development tools):

    Terminal window
    # Don't forget to install pnpm first
    # From the project-ms root directory
    pnpm install


  4. Configure environment variables (optional)

    The project includes environment files for both frontend and server components. Review and modify these files as needed for your development environment.

    • DirectoryprojectMS
      • .env


  5. Run the project

    Option 1: Fully containerized (Simplest)

    Run the entire application stack using Docker Compose:

    .env
    IS_DOCKER=true
    Terminal window
    # Development mode with hot reload
    # Run from the project-ms root directory
    docker-compose -f docker-compose-dev.yml up --build
    # Production mode (no hot reload)
    # Run from the project-ms root directory
    docker-compose up --build



    Option 2: Hybrid approach (More flexible)

    Run the database in Docker while running the server and frontend locally:

    Update the configuration:

    .env
    IS_DOCKER=false


    Start the database:

    Terminal window
    cd scripts
    chmod +x ./start_mdb.sh
    ./start_mdb.sh


    Start the server:

    Terminal window
    cd server
    pnpm run start:dev

    Default port: http://localhost:8000



    Start the frontend:

    Terminal window
    cd frontend
    pnpm run dev

    Default port: http://localhost:3000

Once the application is running:

  1. Frontend: Navigate to http://localhost:3000
  2. Backend API: Available at http://localhost:8000
  3. Database: Accessible on port 3307

Both frontend and server support hot reload during development (docker-compose.dev or without Docker), so your changes update automatically.