Installation
-
Install prerequisites
Before you begin, ensure you have the following tools installed on your system:
- Git (latest version) - Download here
- Docker Desktop or Docker CLI - Download here
- Node.js (v24.0 or higher) - Download here
- pnpm (v11.0 or higher) - Installation guide
- Redis (v8.0 or higher) - Download here
-
Clone the repository
Choose one of the following methods to clone the project:
Terminal window # Using HTTPSgit 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 CLIgh repo clone OAMK-tietotekniikka/ProjectsMS
Navigate to the project directory:
Terminal window cd projectMS
-
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 directorypnpm install
-
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
-
Run the project
Option 1: Fully containerized (Simplest)
Run the entire application stack using Docker Compose:
.env IS_DOCKER=trueTerminal window # Development mode with hot reload# Run from the project-ms root directorydocker-compose -f docker-compose-dev.yml up --build# Production mode (no hot reload)# Run from the project-ms root directorydocker-compose up --buildOption 2: Hybrid approach (More flexible)
Run the database in Docker while running the server and frontend locally:
Update the configuration:
.env IS_DOCKER=falseStart the database:
Terminal window cd scriptschmod +x ./start_mdb.sh./start_mdb.shTerminal window set INIT_SQL=%cd%\dbinit\init.sqldocker run -d --name mysql-local -p 3307:3306 ^-e MYSQL_ROOT_PASSWORD=pwd@123 ^-e MYSQL_DATABASE=studentsdb ^-e MYSQL_USER=admin ^-e MYSQL_PASSWORD=pwd@123 ^-v "%INIT_SQL%:/docker-entrypoint-initdb.d/init.sql" ^mysql:ltsStart the server:
Terminal window cd serverpnpm run start:devDefault port:
http://localhost:8000
Start the frontend:
Terminal window cd frontendpnpm run devDefault port:
http://localhost:3000
Install MariaDB:
Terminal window # Linuxsudo apt updatesudo apt install mariadb-server# macOSbrew install mariadbDownload from mariadb.org/download and follow the installation wizard.
Configure the database:
Start MariaDB:
Terminal window # Linux/macOSsudo systemctl start mariadb# Windowsnet start MariaDBSet up the database:
Terminal window # Login to MariaDBmysql -u root -p# Create database and userCREATE DATABASE IF NOT EXISTS project_ms;CREATE USER IF NOT EXISTS 'admin'@'localhost' IDENTIFIED BY 'pwd@123';GRANT ALL PRIVILEGES ON project_ms.* TO 'admin'@'localhost';FLUSH PRIVILEGES;EXIT;# Initialize the database schemamysql -u root -p project_ms < dbinit/init.sqlInstall and start Redis:
Linux/macOS:
Terminal window sudo systemctl start redisWindows (using WSL):
Terminal window sudo apt install redis-serversudo service redis-server startUpdate the configuration:
.env IS_DOCKER=falseStart the application:
Start the server:
Terminal window cd serverpnpm run start:devStart the frontend:
Terminal window cd frontendpnpm run dev
Next steps
Section titled “Next steps”Once the application is running:
- Frontend: Navigate to http://localhost:3000
- Backend API: Available at http://localhost:8000
- 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.