242 lines
5.5 KiB
Markdown
Executable File
242 lines
5.5 KiB
Markdown
Executable File
# ⏰ ActaTempus: Time Tracking and Management System
|
||
|
||
## 🌟 Overview
|
||
|
||
**ActaTempus** for work hour management and tracking. In the current state the goal of the project is, to show differences and similarities in functional porgramming.
|
||
Therefore the backend is currently developed in **Go** and **Dart**. The Implementations emphasize functional programming principles leading to a 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.
|
||
|
||

|
||
|
||
---
|
||
|
||
## 🛠️ Technology Stack
|
||
|
||
### 🎨 Frontend:
|
||
- **Next.js**: React framework for SSR and SPA capabilities
|
||
- **Deno**: Lightweight, secure runtime for development tooling
|
||
|
||
### ⚙️ 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.
|
||
Before the backend can connect you need to start the PostgresSQL server. To make things easier you can launch
|
||
Postges with the shipped ```docker-compose.yml```.
|
||
|
||
```bash
|
||
docker compose up
|
||
```
|
||
|
||
|
||
|
||
#### Deploy the Schema
|
||
You only need to apply the schema with one of the following commands, as both result in the same schema.
|
||
In case if you want to change the corresponding server edit the ```.env```-file within the backend projects.
|
||
|
||
```bash
|
||
cd backend-dart
|
||
go run github.com/steebchen/prisma-client-go db push # within backend-go
|
||
```
|
||
|
||
or
|
||
|
||
```bash
|
||
cd backend-go
|
||
go run github.com/steebchen/prisma-client-go db push # within backend-go
|
||
```
|
||
|
||
#### Prisma Studio (UI)
|
||
Prisma Studio is WebUI that improves development with Databases as it allows looking right into the data as well as well as altering it.
|
||
|
||
```bash
|
||
cd backend-dart
|
||
bunx prisma studio
|
||
```
|
||
|
||
### Code Generation
|
||
To generate ORM Code for the specifig backend run the following commands.
|
||
This is usually necessary after changes are made to the projects ``schema.prisma``-file.
|
||
|
||
##### Dart
|
||
|
||
```bash
|
||
cd backend-dart
|
||
bunx prisma generate
|
||
```
|
||
|
||
##### Go
|
||
```bash
|
||
cd backend-go
|
||
go run github.com/steebchen/prisma-client-go generate
|
||
```
|
||
---
|
||
## ⚠️ Testing
|
||
##### Dart
|
||
|
||
```bash
|
||
cd backend-dart
|
||
dart test
|
||
```
|
||
|
||
##### Go
|
||
```bash
|
||
cd backend-go
|
||
go test ./... -v
|
||
```
|
||
|
||
---
|
||
|
||
## 🔧 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.
|
||
|
||

|
||
|
||
---
|
||
|
||
## 🛣️ 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)
|
||
|