# Chronos Deployment Notes

## Overview

Chronos currently exists in two versions:

- **Old Chronos**
- **New Chronos**

The old version is a monolithic project, while the new version separates backend and frontend into different projects and runs them as containers.

---

# Old Chronos

## Architecture

Old Chronos has backend and frontend inside the same project.

It is a monolithic application:

```text
Old Chronos
└── Backend + Frontend in the same project
```

## Branches

### Development

The current development branch is:

```text
dev
```

This branch has a deployment pipeline.

The old branch:

```text
DA_STRRC2_AGGIUNTA_X-GRUPPO
```

is no longer used.

### Production

The production branch is:

```text
release
```

Deployment from this branch is done manually.

## Configuration

Old Chronos does not use standard environment files.

Configuration values are hardcoded inside JavaScript and Java files, mainly:

```text
ApplicationConfig.java
config.js
utils.js
```

## Environments

| Environment | Branch | VM |
|---|---|---|
| Development | `dev` | `10.10.10.106` |
| Production | `release` | `10.10.10.107` |

## Git Flow

Development and release are on different Git trains.

---

# New Chronos

## Architecture

New Chronos has backend and frontend split into separate projects.

Both applications are containerized.

```text
New Chronos
├── Backend
└── Frontend
```

## Branches

### Development

The development branch is:

```text
development
```

This branch has a pipeline that deploys to the development VM:

```text
10.10.10.106
```

### Production

The production branch is:

```text
release
```

Deployment from this branch is done manually on the production VM:

```text
10.10.10.107
```

## Backend Configuration

The backend uses Spring configuration files:

```text
application.yml
application-prod.yml
```

## Frontend Configuration

The frontend uses Angular environment files:

```text
environment.dev.ts
environment.prod.ts
```

## Environments

| Environment | Branch | VM |
|---|---|---|
| Development | `development` | `10.10.10.106` |
| Production | `release` | `10.10.10.107` |

---

# Database Locations

## Old Chronos Databases

| Environment | VM |
|---|---|
| Development DB | `10.10.10.106` |
| Production DB | `10.10.10.107` |

## New Chronos Databases

| Environment | VM |
|---|---|
| Development DB | `10.10.10.106` |
| Production DB | `10.10.10.107` |

The databases are not containerized. They run directly on the VMs.

---

# Database Schemas

The following schemas are used by both Old Chronos and New Chronos:

```text
SmartBI
cespiti
db_example
fendi
monitoraggiopodb
pandora
paused
paused_storico
smart
smart_storico
timesheet
ts_dev_storico
```

---

# VM Details

## Production VM

```text
10.10.10.107
```

This VM contains:

| Application | Deployment Type |
|---|---|
| Old Chronos backend + frontend | 1 container |
| New Chronos backend | 1 container |
| New Chronos frontend | 1 container |
| Database | Installed directly on the VM, not containerized |

## Development VM

```text
10.10.10.106
```

This VM contains:

| Application | Deployment Type |
|---|---|
| Old Chronos backend + frontend | 1 monolithic container |
| New Chronos backend | 1 container |
| New Chronos frontend | 1 container |
| Database | Installed directly on the VM, not containerized |

---

# Summary

| Area | Old Chronos | New Chronos |
|---|---|---|
| Architecture | Monolithic backend + frontend | Backend and frontend separated |
| Containerization | Single container | Separate backend and frontend containers |
| Dev Branch | `dev` | `development` |
| Prod Branch | `release` | `release` |
| Dev VM | `10.10.10.106` | `10.10.10.106` |
| Prod VM | `10.10.10.107` | `10.10.10.107` |
| Dev Deployment | Pipeline | Pipeline |
| Prod Deployment | Manual | Manual |
| Backend Config | Hardcoded Java/JS files | `application.yml`, `application-prod.yml` |
| Frontend Config | Hardcoded JS files | `environment.dev.ts`, `environment.prod.ts` |
| DB Containerized | No | No |
