adjusted readme

This commit is contained in:
Jean Jacques Avril 2025-01-05 10:02:04 +00:00
parent 73ddbaeb6f
commit b4d1a19926
No known key found for this signature in database
2 changed files with 71 additions and 103 deletions

160
README.md
View File

@ -1,59 +1,73 @@
Heres the updated and streamlined README, reflecting your changes, including the removal of the frontend and the shift to Insomnia for interaction:
---
# ⏰ ActaTempus: Time Tracking and Management System # ⏰ ActaTempus: Time Tracking and Management System
## 🌟 Overview ## 🌟 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. **ActaTempus** is a system for work hour management and tracking, showcasing differences and similarities in functional programming using two backend implementations: **Go** and **Dart**.
Therefore the backend is currently developed in **Go** and **Dart**. The Implementations emphasize functional programming principles leading to a streamlined user experience.
The current focus is backend development, while frontend development has been separated for future hobbyist work. Interaction with the system is facilitated through **Insomnia**, with an Insomnia collection provided in `docs/insomnia`.
--- ---
## 🚀 Features (Long-Term Goals) ## 🚀 Features
**User Management**: Registration, login, profile updates **User Management**: Registration, login, profile updates
**Time Tracking**: Start/stop tracking, manual entries, and break management **Time Tracking**: Start/stop tracking, manual entries, and break management
**Project Management**: Create and manage projects, tasks, and time entries **Project Management**: Create and manage projects, tasks, and time entries
**Reporting**: Generate daily/weekly reports and export as PDF/CSV **Task Management**: Manage tasks related to projects
**Role-Based Access Control (RBAC)**: Fine-grained permission system
--- ---
## 🏗️ Architecture ## 🏗️ Architecture
ActaTempus adheres to **Domain-Driven Design (DDD)** and **Clean Architecture** principles for a scalable and maintainable codebase. ActaTempus adheres to **Domain-Driven Design (DDD)** and **Clean Architecture** principles. The system is divided into **four primary layers**:
The system is divided into **four primary layers**:
1**Domain Layer**: 1**Domain Layer**:
- Contracts, definitions, and interfaces only. - Contracts, definitions, and core logic.
2**Infrastructure Layer**: 2**Infrastructure Layer**:
- Database and external service integrations (e.g., Prisma with PostgreSQL). - Database integrations and external service interfaces (e.g., Prisma with PostgreSQL).
3**Application Layer**: 3**Application Layer**:
- Business logic, services, and response handling. - Business logic, services, and response handling.
4**Interface Layer**: 4**Interface Layer**:
- External communication interfaces. - REST APIs for external communication.
![Architecture Diagram](docs/media/architecture.png)
--- ---
## 🛠️ Technology Stack ## 🛠️ Technology Stack
### 🎨 Frontend: ### ⚙️ Backend
- **Next.js**: React framework for SSR and SPA capabilities
- **Deno**: Lightweight, secure runtime for development tooling
### ⚙️ Backend:
#### Go: #### Go:
- **Prisma-Go**: PostgreSQL ORM integration with Prisma - **Gin**: HTTP web framework for building REST APIs.
- **GORM**: PostgreSQL ORM for database interactions.
- **Prisma-Go**: Schema management and database adapter.
- **JWT (golang-jwt)**: Authentication and token generation.
- **fp-go**: Functional programming library for Go.
- **Viper**: Configuration management.
- **UUID**: Library for unique identifier generation.
- **Decimal (shopspring/decimal)**: High-precision decimal arithmetic.
#### Dart: #### Dart:
- **Prisma-Dart**: PostgreSQL ORM adapter for Dart - **ORM (Drift/Aqueduct)**: Object-relational mapping for database integration.
- **PostgreSQL**: Database connectivity and query execution.
- **Shelf**: HTTP server framework.
- **Shelf Router**: Routing for Shelf applications.
- **JWT (dart_jsonwebtoken)**: Authentication and token generation.
- **fpdart**: Functional programming library for Dart.
- **Riverpod**: State management for the application.
- **Freezed**: Immutable data classes and sealed classes.
- **UUID**: Unique identifier generation.
- **Crypto**: Cryptographic utilities.
### 📦 Database: ### 📦 Database
- **PostgreSQL**: Primary database - **PostgreSQL**: Primary database for structured data storage.
- **Prisma**: Shared ORM schema across Dart and Go backends - **Prisma ORM**: Shared schema across Go and Dart implementations, providing unified database management.
--- ---
@ -62,8 +76,7 @@ The system is divided into **four primary layers**:
``` ```
backend-go/ # Go backend implementation backend-go/ # Go backend implementation
backend-dart/ # Dart backend implementation backend-dart/ # Dart backend implementation
frontend-next/ # Next.js frontend docs/ # Documentation, including Insomnia collections
docs/ # Documentation, specs, and design diagrams
``` ```
--- ---
@ -71,13 +84,17 @@ docs/ # Documentation, specs, and design diagrams
## 📖 Getting Started ## 📖 Getting Started
### Prerequisites ### Prerequisites
For a seamless development experience, use the provided **devcontainer** setup.
All dependencies are bundled with the **devcontainer**. For manual setup, ensure you have: Ensure you have the following installed:
- [Docker](https://www.docker.com/) - [Docker](https://www.docker.com/)
- Node.js - [VisualStudioCode](https://code.visualstudio.com/)
If you dont want to use devcontainers and/or docker you need to install the following dependencies on your own:
- Go - Go
- Dart - Dart
- PostgreSQL - PostgreSQL
- NodeJS (required for Prisma)
### 🔧 Installation ### 🔧 Installation
@ -88,26 +105,15 @@ All dependencies are bundled with the **devcontainer**. For manual setup, ensure
``` ```
2. **Use the devcontainer**: 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: Launch it with Visual Studio Code:
```bash ```bash
code . code .
``` ```
--- ---
## 🖥️ Running ActaTempus ## 🖥️ Running ActaTempus
### Frontend
```bash
cd frontend-next
# Install dependencies (if not using devcontainer)
deno task dev # Starts the UI on port 3000
```
### Backend (Go) ### Backend (Go)
```bash ```bash
@ -126,34 +132,30 @@ dart run bin/backend_dart.dart # Starts on port 8080
### 🗄️ Database Management ### 🗄️ Database Management
ActaTempus uses **Prisma ORM** for database schema management and code generation across both backends. ActaTempus uses **Prisma ORM** for 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 Start the PostgreSQL server using the provided `docker-compose.yml`:
Postges with the shipped ```docker-compose.yml```.
```bash ```bash
docker compose up docker compose up
``` ```
#### Deploy the Schema #### Deploy the Schema
You only need to apply the schema with one of the following commands, as both result in the same schema. Apply the schema using Prisma. Only one backend needs to execute the command, as both backends share the schema:
In case if you want to change the corresponding server edit the ```.env```-file within the backend projects.
```bash ```bash
cd backend-dart cd backend-go
go run github.com/steebchen/prisma-client-go db push # within backend-go go run github.com/steebchen/prisma-client-go db push
``` ```
or or
```bash ```bash
cd backend-go cd backend-dart
go run github.com/steebchen/prisma-client-go db push # within backend-go bunx prisma db push
``` ```
#### Prisma Studio (UI) #### Prisma Studio
Prisma Studio is WebUI that improves development with Databases as it allows looking right into the data as well as well as altering it. Launch Prisma Studio for database visualization and management:
```bash ```bash
cd backend-dart cd backend-dart
@ -161,11 +163,9 @@ bunx prisma studio
``` ```
### Code Generation ### Code Generation
To generate ORM Code for the specifig backend run the following commands. Regenerate ORM code after modifying the `schema.prisma` file:
This is usually necessary after changes are made to the projects ``schema.prisma``-file.
##### Dart ##### Dart
```bash ```bash
cd backend-dart cd backend-dart
bunx prisma generate bunx prisma generate
@ -176,10 +176,12 @@ bunx prisma generate
cd backend-go cd backend-go
go run github.com/steebchen/prisma-client-go generate go run github.com/steebchen/prisma-client-go generate
``` ```
---
## ⚠️ Testing
##### Dart
---
## ⚠️ Testing
##### Dart
```bash ```bash
cd backend-dart cd backend-dart
dart test dart test
@ -192,50 +194,16 @@ go test ./... -v
``` ```
--- ---
## 📖 Interaction with the System
## 🔧 Known Issues Use **[Insomnia](https://insomnia.rest/)** for interacting with the APIs.
The Insomnia collection is provided under `docs/insomnia`. Import it to get started quickly with predefined requests.
### 🐛 Browser Extensions and Hydration ![Insomnia Demo](docs/media/insomnia2.gif)
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 ## 🌐 Resources
### Go Programming - [Functional Programming in Go](https://pkg.go.dev/github.com/IBM/fp-go)
- [The Zen of Go](https://the-zen-of-go.netlify.app/) - [Dart Documentation](https://dart.dev/)
### Functional Programming in Go
- [IBM FP-Go Documentation](https://pkg.go.dev/github.com/IBM/fp-go)

BIN
docs/media/insomnia2.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 MiB