2025-01-04 19:21:37 +00:00

201 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 sophisticated web application designed for efficient work hour management and tracking. Featuring a dual backend developed in **Go** and **Dart** alongside a modern **Next.js frontend**, ActaTempus emphasizes functional programming principles and streamlined user experience.
---
## 🚀 Features (Long-Term Goals)
**User Management**: Registration, login, profile updates
**Time Tracking**: Start/stop tracking, manual entries, and break management
**Project Management**: Create and manage projects, tasks, and time entries
**Reporting**: Generate daily/weekly reports and export as PDF/CSV
**Role-Based Access Control (RBAC)**: Fine-grained permission system
---
## 🏗️ Architecture
ActaTempus adheres to **Domain-Driven Design (DDD)** and **Clean Architecture** principles for a scalable and maintainable codebase.
The system is divided into **four primary layers**:
1**Domain Layer**:
- Contracts, definitions, and interfaces only.
2**Infrastructure Layer**:
- Database and external service integrations (e.g., Prisma with PostgreSQL).
3**Application Layer**:
- Business logic, services, and response handling.
4**Interface Layer**:
- External communication interfaces.
![Architecture Diagram](docs/media/architecture.png)
---
## 🛠️ Technology Stack
### 🎨 Frontend:
- **Next.js**: React framework for SSR and SPA capabilities
- **Deno**: Lightweight, secure runtime for development tooling
- **Dependencies**:
- `fp-ts`: Functional programming in TypeScript
- `@reactivex/rxjs`: Reactive programming
- `clsx`: Conditional class handling
- `lucide-react`: Icon library
- `next-intl`: Internationalization
### ⚙️ Backend:
#### Go:
- **Prisma-Go**: PostgreSQL ORM integration with Prisma
#### Dart:
- **Prisma-Dart**: PostgreSQL ORM adapter for Dart
### 📦 Database:
- **PostgreSQL**: Primary database
- **Prisma**: Shared ORM schema across Dart and Go backends
---
## 📁 Directory Structure
```
backend-go/ # Go backend implementation
backend-dart/ # Dart backend implementation
frontend-next/ # Next.js frontend
docs/ # Documentation, specs, and design diagrams
```
---
## 📖 Getting Started
### Prerequisites
All dependencies are bundled with the **devcontainer**. For manual setup, ensure you have:
- [Docker](https://www.docker.com/)
- Node.js
- Go
- Dart
- PostgreSQL
### 🔧 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**:
Place the repository on a **Unix-native file system**.
Otherwise you will experience severe performance issues.
Launch it with Visual Studio Code:
```bash
code .
```
---
## 🖥️ Running ActaTempus
### Frontend
```bash
cd frontend-next
# Install dependencies (if not using devcontainer)
deno task dev # Starts the 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
ActaTempus uses **Prisma ORM** for database schema management and code generation 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 and Hydration
Some browser 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
- ✅ Set up repository
### Phase 2: **Setup**
- ✅ Frontend (Next.js, Deno)
- ✅ Backends (Dart & Go)
- ✅ Devcontainer
### Phase 3: **MVP Development**
- Build foundational backends in Go & Dart
- Implement:
- ✅ Domain layer (Entities, Repositories)
- ✅ Application logic (Services, DTOs, JWT Authentication)
- ✅ Basic authorization
### Phase 4: **Web UI**
- 🎨 Build frontend for:
- Timetracking
- Project management
- Reporting
---
## 🌐 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)