Skip to content

A time-, mood- and incident tracking application for Stadtmuur called Compass 🧭

License

Notifications You must be signed in to change notification settings

ZHAW-PM4-Compass/compass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Build, Push and Deploy - Production Build, Push and Deploy - Staging

Quality Gate Status Bugs Vulnerabilities Lines of Code Security Rating Coverage

Compass 🧭

Compass is a web application for the Stadtmuur organization, which allows the participants to record their working hours, track their mood, track exceptional incidents, create daily reports and visualize this information.

For more information navigate to our wiki.

Table of Contents

Prerequisites

This project uses Node.js and Java. We recommend using NVM (Node Version Manager) to manage your Node.js versions. You can switch to the correct Node.js version for this project by running nvm use in the project directory.

For Java, we recommend using a Java Development Kit (JDK) version 21 or above.

Project Structure

.
.
β”œβ”€β”€ README.md                       # Project README with general information
β”œβ”€β”€ backend                         # Backend specific code
β”‚   β”œβ”€β”€ src                         # Source code for the backend application
β”‚   β”œβ”€β”€ build.gradle                # Gradle build script for the backend
β”‚   └── settings.gradle             # Gradle settings for the project
β”œβ”€β”€ frontend                        # Frontend specific code
β”‚   β”œβ”€β”€ .github                     # GitHub workflows and actions configurations
β”‚   β”œβ”€β”€ .vscode                     # VSCode specific settings
β”‚   β”œβ”€β”€ migrations                  # Database migrations
β”‚   β”œβ”€β”€ public                      # Public assets such as images and static files
β”‚   β”œβ”€β”€ scripts                     # Scripts for building, deploying, etc.
β”‚   β”œβ”€β”€ src                         # Source code for the frontend
β”‚   β”‚   β”œβ”€β”€ app                     # Next.js application setup and routing
β”‚   β”‚   β”œβ”€β”€ components              # Reusable React components
β”‚   β”‚   β”œβ”€β”€ libs                    # Third-party libraries configuration
β”‚   β”‚   β”œβ”€β”€ locales                 # Localization and internationalization files
β”‚   β”‚   β”œβ”€β”€ models                  # Models for structuring database data
β”‚   β”‚   β”œβ”€β”€ styles                  # CSS and styling files
β”‚   β”‚   β”œβ”€β”€ templates               # HTML or other templates
β”‚   β”‚   β”œβ”€β”€ types                   # TypeScript type definitions
β”‚   β”‚   β”œβ”€β”€ utils                   # Utility functions
β”‚   β”‚   └── validations             # Validation schemas for data input
β”‚   β”œβ”€β”€ tests                       # Testing suite
β”‚   β”‚   β”œβ”€β”€ e2e                     # End-to-end testing, possibly including Monitoring as Code
β”‚   β”‚   └── integration             # Integration tests for interconnected components
β”‚   β”œβ”€β”€ tailwind.config.js          # Tailwind CSS configuration
β”‚   └── tsconfig.json               # TypeScript configuration

Building the Project

Backend

  1. Navigate to the backend directory.
  2. Run ./gradlew build to build the project.

Frontend

  1. Navigate to the frontend directory.
  2. Install the necessary dependencies by running npm install.
  3. Build the project by running npm run build.

Running the Project

Backend

  1. Navigate to the backend directory.
  2. Start the server by running ./gradlew bootRun.

Frontend

  1. Navigate to the frontend directory.
  2. Start the server by running npm run start.

Running Tests

This project uses Jest for unit testing and Playwright for integration and E2E testing. To run the tests, use the following commands:

  • Unit tests: npm run test
  • Integration & E2E tests:
    npx playwright install
    npm run test:e2e

Refer to the code block from frontend/README.md lines 294-304 for more details.

Additional Information

Docker and Kubernetes

This project can be containerized using Docker and orchestrated with Kubernetes. However, specific instructions for Docker and Kubernetes will depend on your project setup and requirements. Please refer to Docker's official documentation and Kubernetes' official documentation for more information.

Makefile Usage

This project includes a Makefile with commands for building and running different components of the project using Docker. Here are some of the commands you might find useful:

Building Docker Images

  • make build-backend: Builds the Docker image for the backend part of the project.

  • make build-frontend: Builds the Docker image for the frontend part of the project.

  • make build: Builds the Docker images for both the frontend and backend parts of the project.

Running the Project

  • make run: Runs the Docker containers for the project using Docker Compose. This command starts up all the services defined in the docker-compose.yml file, including the frontend, backend, and any databases or other dependencies.

  • make stop: Stops all running Docker containers associated with the project's Docker Compose configuration. This command brings down all the services that were started with make run.