diff --git a/README.md b/README.md index e76b21c..f57b04f 100755 --- a/README.md +++ b/README.md @@ -1,59 +1,73 @@ +Here’s 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 ## 🌟 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. +**ActaTempus** is a system for work hour management and tracking, showcasing differences and similarities in functional programming using two backend implementations: **Go** and **Dart**. + +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 βœ… **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 +βœ… **Task Management**: Manage tasks related to projects --- ## πŸ—οΈ 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**: +ActaTempus adheres to **Domain-Driven Design (DDD)** and **Clean Architecture** principles. The system is divided into **four primary layers**: 1️⃣ **Domain Layer**: - - Contracts, definitions, and interfaces only. + - Contracts, definitions, and core logic. 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**: - Business logic, services, and response handling. 4️⃣ **Interface Layer**: - - External communication interfaces. - -![Architecture Diagram](docs/media/architecture.png) + - REST APIs for external communication. --- ## πŸ› οΈ Technology Stack -### 🎨 Frontend: -- **Next.js**: React framework for SSR and SPA capabilities -- **Deno**: Lightweight, secure runtime for development tooling +### βš™οΈ Backend -### βš™οΈ Backend: #### 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: -- **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: -- **PostgreSQL**: Primary database -- **Prisma**: Shared ORM schema across Dart and Go backends +### πŸ“¦ Database +- **PostgreSQL**: Primary database for structured data storage. +- **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-dart/ # Dart backend implementation -frontend-next/ # Next.js frontend -docs/ # Documentation, specs, and design diagrams +docs/ # Documentation, including Insomnia collections ``` --- @@ -71,13 +84,17 @@ docs/ # Documentation, specs, and design diagrams ## πŸ“– Getting Started ### Prerequisites - -All dependencies are bundled with the **devcontainer**. For manual setup, ensure you have: +For a seamless development experience, use the provided **devcontainer** setup. +Ensure you have the following installed: - [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 - Dart - PostgreSQL +- NodeJS (required for Prisma) + ### πŸ”§ Installation @@ -88,26 +105,15 @@ All dependencies are bundled with the **devcontainer**. For manual setup, ensure ``` 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 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 @@ -126,34 +132,30 @@ 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```. +ActaTempus uses **Prisma ORM** for schema management and code generation across both backends. +Start the PostgreSQL server using the provided `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 +Apply the schema using Prisma. Only one backend needs to execute the command, as both backends share the schema: ```bash 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 ``` -#### 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. +or + +```bash +cd backend-dart +bunx prisma db push +``` + +#### Prisma Studio +Launch Prisma Studio for database visualization and management: ```bash cd backend-dart @@ -161,81 +163,47 @@ 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. +Regenerate ORM code after modifying the `schema.prisma` file: ##### Dart - ```bash cd backend-dart bunx prisma generate ``` -##### Go +##### Go ```bash cd backend-go go run github.com/steebchen/prisma-client-go generate ``` ---- -## ⚠️ Testing -##### Dart +--- + +## ⚠️ Testing + +##### Dart ```bash cd backend-dart dart test ``` -##### Go +##### Go ```bash cd backend-go go test ./... -v ``` --- +## πŸ“– Interaction with the System -## πŸ”§ Known Issues - -### πŸ› Browser Extensions and Hydration - -Some browser extensions (e.g., Grammarly) inject DOM attributes that cause SSR mismatches: -- Example: `` -- Disable such extensions if issues occur. - -![Hydration Issue](docs/media/image.png) +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. +![Insomnia Demo](docs/media/insomnia2.gif) --- -## πŸ›£οΈ 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) - +- [Functional Programming in Go](https://pkg.go.dev/github.com/IBM/fp-go) +- [Dart Documentation](https://dart.dev/) diff --git a/docs/media/insomnia2.gif b/docs/media/insomnia2.gif new file mode 100644 index 0000000..e3f851d Binary files /dev/null and b/docs/media/insomnia2.gif differ