Prepare branch for merge to main

- Fix build issues with SSR and useSearchParams
- Update README.md with comprehensive project documentation
- Move debug pages to debug-disabled folder (temporary)
- Fix authentication pages with Suspense boundaries
- Add dynamic imports for map components
- Ensure all pages build successfully

This commit prepares the auth2 branch for merging into main by:
1. Resolving all build errors
2. Adding proper SSR handling for client-side components
3. Updating documentation to reflect current state
4. Moving debug/test pages out of production build
This commit is contained in:
Chop
2025-07-10 22:18:32 +02:00
parent 38b0682d83
commit faeb1ca80c
13 changed files with 1328 additions and 874 deletions

View File

@@ -100,29 +100,42 @@ The application uses SQLite database which will be automatically initialized on
```
src/
├── app/ # Next.js app router pages
│ ├── admin/ # Admin dashboard and user management
│ ├── api/ # API routes
│ │ ├── admin/ # Admin-related endpoints (e.g., user management)
│ │ ├── all-project-tasks/ # Get all project tasks endpoint
│ │ ├── audit-logs/ # Audit log endpoints
│ │ ├── auth/ # Authentication endpoints
│ │ ├── contracts/ # Contract management endpoints
│ │ ├── notes/ # Notes management endpoints
│ │ ├── projects/ # Project management endpoints
│ │ ├── project-tasks/ # Task management endpoints
│ │ ├── task-notes/ # Task-specific notes endpoints
│ │ └── tasks/ # Task template endpoints
│ ├── auth/ # Authentication pages (login, etc.)
│ ├── contracts/ # Contract pages
│ ├── projects/ # Project pages
│ ├── project-tasks/ # Project-specific task pages
│ └── tasks/ # Task management pages
├── components/ # Reusable React components
│ ├── ui/ # UI components (Button, Card, etc.)
│ ├── ContractForm.js # Contract form component
│ ├── NoteForm.js # Note form component
│ ├── ProjectForm.js # Project form component
│ ├── auth/ # Authentication-related components
│ ├── ui/ # UI components (Button, Card, etc.)
│ ├── AuditLogViewer.js # Component to view audit logs
│ ├── ContractForm.js # Contract form component
│ ├── NoteForm.js # Note form component
│ ├── ProjectForm.js # Project form component
│ ├── ProjectTaskForm.js # Project task form component
│ ├── ProjectTasksSection.js # Project tasks section component
│ ├── TaskForm.js # Task form component
│ ├── TaskForm.js # Task form component
│ └── TaskTemplateForm.js # Task template form component
── lib/ # Utility functions
├── queries/ # Database query functions
├── db.js # Database connection
── init-db.js # Database initialization
── lib/ # Utility functions
├── queries/ # Database query functions
├── auditLog.js # Audit logging utilities
── auth.js # Authentication helpers
│ ├── db.js # Database connection
│ ├── init-db.js # Database initialization
│ └── userManagement.js # User management functions
└── middleware.js # Next.js middleware for auth and routing
```
## Available Scripts
@@ -147,6 +160,9 @@ The application uses the following main tables:
- **tasks** - Task templates
- **project_tasks** - Tasks assigned to specific projects
- **notes** - Project notes and updates
- **users** - User accounts and roles for authentication
- **sessions** - User session management
- **audit_logs** - Detailed logs for security and tracking
## API Endpoints
@@ -188,6 +204,19 @@ The application uses the following main tables:
- `POST /api/notes` - Create new note
- `DELETE /api/notes` - Delete note
### Audit Logs
- `GET /api/audit-logs` - Get all audit logs
- `POST /api/audit-logs/log` - Create a new audit log entry
- `GET /api/audit-logs/stats` - Get audit log statistics
### Admin
- `GET /api/admin/users` - Get all users
- `POST /api/admin/users` - Create a new user
- `PUT /api/admin/users/[id]` - Update a user
- `DELETE /api/admin/users/[id]` - Delete a user
## Advanced Map Features
This project includes a powerful map system for project locations, supporting multiple dynamic base layers: