205 lines
4.6 KiB
Markdown
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ⏰ ActaTempus - Time Tracking and Management System
## 🌟 Overview
**ActaTempus** is a modern, comprehensive web application designed to efficiently manage and track work hours. It features:
- A **backend** developed in both Go and Dart, following **functional programming principles**.
- An interactive **React frontend** for an intuitive user experience.
---
## 🚀 Features (Long-Term Goals)
**User Management**: Registration, login, and profile updates
**Time Tracking**: Start/stop tracking, manual entries, and break management
**Project Management**: Create and manage projects
**Reporting**: Generate daily/weekly reports and export as PDF/CSV
**Role-Based Access Control (RBAC)**: Fine-grained permission system
---
## 🏗️ Architecture
This system follows **Domain-Driven Design (DDD)** and **Clean Architecture** principles to ensure a modular, maintainable, and scalable codebase.
It is structured into **four primary layers**:
1**Domain Layer**:
- Contains contracts and interface definitions.
2**Infrastructure Layer**:
- Implements external sources like databases and configurations.
3**Application Layer**:
- Implements business logic and server responses.
4**Interface Layer**:
- Defines the external-facing API.
![Architecture Diagram](docs/media/architecture.png)
---
## 🛠️ Technology Stack
### 🎨 Frontend:
- **React**: User Interface
- **Axios/Fetch API**: HTTP requests
- **WebSockets**: Real-time updates
- **Styled Components**: CSS-in-JS
### ⚙️ Backend:
#### Go:
- **GORM**: ORM for PostgreSQL
- **go-redis**: Redis integration
- **gorilla/websocket** & **mux**: WebSocket & HTTP routing
#### Dart:
- **drift/aqueduct**: ORM for database access
- **redis_client**: Redis integration
- **shelf_web_socket**: WebSocket handling
### 📦 Databases:
- **PostgreSQL**: Main data storage
- **Redis**: Caching and real-time updates
---
## 📁 Directory Structure
```
backend-go/ # Go backend implementation
backend-dart/ # Dart backend implementation
frontend-react/ # React frontend
docs/ # Documentation and design diagrams
```
---
## 📖 Getting Started
### Prerequisites
💡 All dependencies are pre-configured in the **devcontainer**. If you're setting up manually, ensure you have:
- [Docker](https://www.docker.com/)
- Node.js (Frontend)
- Go (Go backend)
- Dart (Dart backend)
- PostgreSQL and Redis
### 🔧 Installation
1. **Clone the repository**:
```bash
git clone https://inf-git.th-rosenheim.de/studavrije7683/ws24-kp-avril.git
cd ws24-kp-avril
```
2. **Use the devcontainer**:
Ensure the repository is on a **Unix-native file system** (e.g., WSL on Windows). Launch with Visual Studio Code:
```bash
code .
```
---
## 🖥️ Running the Software
### Frontend
```bash
cd frontend-react
deno run dev # Starts UI on port 3000
```
### Backend (Go)
```bash
cd backend-go
go run cmd/actatempus/main.go # Starts on port 8080
```
### Backend (Dart)
```bash
cd backend-dart
dart run bin/backend_dart.dart # Starts on port 8080
```
---
## 🗄️ Database Management
We use **Prisma ORM** for consistent database schema management across both backends.
### Deploy the Schema
```bash
bunx prisma db push
```
### Prisma Studio (UI)
```bash
bunx prisma studio
```
### Code Generation
```bash
bunx prisma generate
```
---
## 🔧 Known Issues
### 🐛 Browser Extensions Cause Hydration Issues
Certain extensions (e.g., Grammarly) inject DOM attributes that cause SSR mismatches:
- Example: `<data-lt-installed="true">`
- Disable such extensions if issues occur.
![Hydration Issue](docs/media/image.png)
---
## 🛣️ Roadmap
### Phase 1: **Initialize**
- ✅ Define specifications
- ✅ Initialize repository
### Phase 2: **Setup**
- ✅ Frontend (NextJS, Deno)
- ✅ Backends (Dart & Go)
- ✅ Dev-container
### Phase 3: **MVP Development**
- Build foundational backends in Go & Dart.
- Implement:
- ✅ Domain layer (Entities, Repositories)
- ✅ Business logic (Services, DTOs, JWT Authentication)
- ✅ Basic authorization
### Phase 4: **Web UI**
- 🎨 Build frontend for:
- Timetracking
- Project management
- Reporting
### Future Iterations
- 📊 Report exports (Excel, PDF)
- 💳 Billing integration
- 🏢 Multi-tenant support
---
## 🌐 Resources
### Go Programming
- [The Zen of Go](https://the-zen-of-go.netlify.app/)
### Functional Programming in Go
- [IBM FP-Go Documentation](https://pkg.go.dev/github.com/IBM/fp-go)