myCRM/README.md
olli fcfda9d9be feat: Implement user management functionality with CRUD operations
- Added UserManagement.vue component for managing users with PrimeVue DataTable.
- Integrated API endpoints for user CRUD operations in the backend.
- Implemented user password hashing using a custom state processor.
- Updated router to include user management route with admin access control.
- Enhanced Dashboard.vue and app.scss for improved styling and responsiveness.
- Documented user management features and API usage in USER-CRUD.md.
2025-11-08 10:50:00 +01:00

217 lines
5.7 KiB
Markdown

# myCRM - Moderne CRM-Lösung
Eine moderne, modulare CRM-Anwendung basierend auf Symfony 7.1 LTS, Vue.js 3 und PrimeVue.
## 🚀 Features
- **Symfony 7.1 LTS** - Stabile PHP-Backend-Framework
- **Vue.js 3** - Modernes, reaktives Frontend mit Composition API
- **PrimeVue** - Professionelle UI-Komponenten (DataTable, Charts, Forms)
- **API Platform** - RESTful API mit OpenAPI-Dokumentation
- **MariaDB** - Zuverlässige relationale Datenbank
- **Webpack Encore** - Asset-Management und Hot Module Replacement
- **Modulares Berechtigungssystem** - Flexible Rollen mit Modul-basierter Rechteverwaltung
- **User CRUD** - Vollständige Benutzerverwaltung via API Platform
- **Login-System** - Form-basierte Authentifizierung mit Remember Me
## 📋 Voraussetzungen
- PHP 8.2 oder höher
- Composer 2.x
- Node.js 18.x oder höher
- MariaDB/MySQL 10.x oder höher
- NPM oder Yarn
## 🛠️ Installation
```bash
# 1. Repository klonen
git clone <repository-url> mycrm
cd mycrm
# 2. PHP-Abhängigkeiten installieren
composer install
# 3. NPM-Abhängigkeiten installieren
npm install
# 4. Umgebungsvariablen konfigurieren
# Kopiere .env zu .env.local und passe DATABASE_URL an
cp .env .env.local
# 5. Datenbank erstellen
php bin/console doctrine:database:create
# 6. Datenbank-Schema erstellen
php bin/console doctrine:migrations:migrate
# 7. Test-Daten laden (optional)
php bin/console doctrine:fixtures:load
```
### Testbenutzer
Nach dem Laden der Fixtures stehen folgende Testbenutzer zur Verfügung:
- **Administrator**: admin@mycrm.local / admin123
- **Vertriebsmitarbeiter**: sales@mycrm.local / sales123
## 🎯 Entwicklung
### Backend-Server starten
```bash
# Mit PHP Built-in Server
php -S localhost:8000 -t public/
# ODER mit Symfony CLI (wenn installiert)
symfony serve -d
```
### Frontend-Assets kompilieren
```bash
# Einmalig kompilieren
npm run dev
# Mit Auto-Reload (empfohlen für Entwicklung)
npm run watch
# Für Production
npm run build
```
### Parallel Development (empfohlen)
Öffne zwei Terminal-Fenster:
**Terminal 1:**
```bash
php -S localhost:8000 -t public/
```
**Terminal 2:**
```bash
npm run watch
```
## 📂 Projektstruktur
```
/assets
/js
/components - Wiederverwendbare Vue-Komponenten
/views - Page-Level Vue-Komponenten
/composables - Vue Composition API Functions
/stores - Pinia State Management
/api - API Client Wrapper
/styles - SCSS/CSS Styles
/config - Symfony-Konfiguration
/src
/Controller - HTTP Controllers
/Entity - Doctrine Entities
/Repository - Database Queries
/Service - Business Logic
/Security/Voter - Permission Logic
/templates - Twig Templates
/public - Public Assets & Entry Point
/migrations - Doctrine Migrations
/tests - Tests (PHPUnit, Jest/Vitest)
```
## 🎨 Technologie-Stack
### Backend
- **Symfony 7.1 LTS** - PHP Framework
- **Doctrine ORM** - Database Abstraction
- **API Platform** - REST API Generation
- **Symfony Security** - Authentication & Authorization
### Frontend
- **Vue.js 3** - Progressive JavaScript Framework
- **Vue Router** - SPA Navigation
- **Pinia** - State Management
- **PrimeVue** - UI Component Library
- **Webpack Encore** - Asset Bundler
### Database
- **MariaDB** - Primary Database
## 📱 Module
- **Dashboard** - Übersicht und KPIs
- **Kontakte** - Kontaktverwaltung mit Status-Tracking (in Entwicklung)
- **Unternehmen** - Firmendatenbank (in Entwicklung)
- **Deals** - Sales-Pipeline Management (in Entwicklung)
- **Aktivitäten** - Interaktions-Historie (in Entwicklung)
- **Benutzerverwaltung** - CRUD für User (✅ implementiert)
## 🔐 Sicherheit
- Symfony Security Component mit Voter-Pattern
- CSRF-Schutz aktiviert
- Password Hashing mit Symfony PasswordHasher (bcrypt)
- Session-basierte Authentifizierung mit Remember Me (7 Tage)
- API-Sicherheit mit granularen Berechtigungen (ROLE_ADMIN, object == user)
- Modulares Berechtigungssystem mit 6 Aktionstypen (View, Create, Edit, Delete, Export, Manage)
## 🧪 Testing
```bash
# Backend Tests (PHPUnit)
php bin/phpunit
# Frontend Tests (wenn konfiguriert)
npm run test:unit
# Doctrine Schema validieren
php bin/console doctrine:schema:validate
```
## 📚 Weitere Dokumentationen
- [LOGIN.md](docs/LOGIN.md) - Authentifizierungssystem
- [PERMISSIONS.md](docs/PERMISSIONS.md) - Modulares Berechtigungssystem
- [USER-CRUD.md](docs/USER-CRUD.md) - Benutzerverwaltung mit API Platform
- [AI Agent Instructions](.github/copilot-instructions.md) - Entwickler-Richtlinien
- [Symfony Documentation](https://symfony.com/doc/current/index.html)
- [API Platform Documentation](https://api-platform.com/docs/)
- [Vue.js Guide](https://vuejs.org/guide/)
- [PrimeVue Documentation](https://primevue.org/)
## 🤝 Entwicklungs-Konventionen
Siehe `.github/copilot-instructions.md` für detaillierte Informationen zu:
- Architektur-Patterns
- Code-Standards
- Testing-Strategien
- CRM Domain Logic
## 📝 Lizenz
Proprietary - Alle Rechte vorbehalten
## 👥 Autoren
Dein Team
---
**Status:** ✅ Grundsystem implementiert - Ready for CRM-Module!
**Implementiert:**
- ✅ Projekt-Setup (Symfony 7.1 + Vue.js 3 + PrimeVue)
- ✅ Modulares Berechtigungssystem (User, Role, Module, RolePermission)
- ✅ Login-System mit Remember Me
- ✅ User-CRUD mit API Platform
- ✅ Vue.js Frontend mit PrimeVue DataTable, Dialogs, Forms
- ✅ Password-Hashing via State Processor
- ✅ Admin-Navigation und Schutz
**Next Steps:**
1. Contact-Entity erstellen: `php bin/console make:entity Contact`
2. Company-Entity erstellen: `php bin/console make:entity Company`
3. Deal-Entity mit Pipeline-Stages erstellen
4. Activity-Entity für Interaktionshistorie
5. Vue.js-Komponenten für Contact/Company/Deal-Management