How raghadmjbel/ai-smartpm works
1. Repository shape
- This is a three-tier system: a React frontend, an ASP.NET Core backend API, and a separate Python AI module.
- The root also contains docker-compose for orchestration plus docs for requirements and integration planning.
2. Frontend subsystem (smartpm-frontend)
- Built with React + Vite.
- It is the user interaction layer for login/register, project management, and artifact generation.
- Key pages/components suggest flows for project lists, project details, specification entry, AI-generated artifacts, WBS tree, and Gantt chart visualization.
3. Frontend data access boundary
- API calls are isolated under src/api with dedicated clients for auth and project operations.
- axios.js centralizes HTTP transport, so the UI is not directly coupled to backend endpoints.
- This makes the frontend mostly a consumer of backend-provided project, auth, and AI-related data.
4. Backend API subsystem (Backend/SmartPm.Api)
- Built on ASP.NET Core Web API.
- Controllers are split by domain: AuthController and projectsController.
- DTOs are explicit and numerous, which indicates the backend is designed as a contract-first API layer rather than exposing entities directly.
5. Backend domain and persistence
- The backend uses Entity Framework Core with migrations and an AppDbContext.
- Core models include User, Project, ProjectSpecification, ProjectArtifact, and ArtifactType.
- The migration history shows the system evolved to include authentication, user-project relationships, and artifact versioning.
6. Backend service layer
- Business logic is separated from controllers into services such as:
- ArtifactGenerationService
- ProjectContextBuilder
- AIResponseValidator
- JwtService
- PasswordHasher
- This suggests the backend owns orchestration, validation, auth token creation, and preparation of context before any AI call is made.
7. AI integration boundary
- The Python AI_Module is a separate service boundary, not just a library.
- Its structure implies a pipeline for:
- building prompts,
- appending project context,
- generating outputs,
- normalizing AI responses.
- The module’s tests include generation behavior, real AI integration, and WBS-from-Gantt conversion, which indicates it is responsible for structured project-planning outputs.
8. Likely data flow for artifact generation
- A user submits a project/specification in the frontend.
- The frontend sends the request to the backend API.
- The backend loads project context from the database, validates/assembles it, and forwards the request to the AI module.
- The AI module returns normalized structured output.
- The backend validates and persists the generated artifact, including versioning.
9. Authentication and authorization
- Auth is handled in the backend with JWT and password hashing.
- The presence of AuthController, User model, and auth DTOs indicates the backend is the source of truth for identity.
- The frontend likely stores and reuses tokens via its API layer, but token issuance and validation belong to the backend.
10. Project and artifact domain
- The main business object appears to be a project with associated specifications and artifacts.
- Artifacts appear to be generated outputs tied to project versions, which is reinforced by the version-related migrations.
- The UI components for WBS tree and Gantt chart suggest artifact outputs are not just text, but structured project-planning data.
11. Operational/container boundary
- docker-compose.yml is the top-level integration point for running the system together.
- Each major subsystem also has its own packaging file:
- SmartPm.Api.csproj for backend,
- package.json for frontend,
- requirements.txt and DockerFile for AI.
- That means deployment is likely service-based rather than a single monolith.
12. Documentation and design artifacts
- docs/Requirements.md and docs/Integration_Plan.md indicate the repo is still in an early integration phase.
- The README also says the system is in the “Initial Structure” phase, so some runtime wiring is expected to be incomplete even though the architecture is already partitioned.
13. Testing boundaries
- Backend and frontend are separated by their own APIs and UI components; the AI module has focused tests around generation logic.
- The AI tests are especially important because they validate the structure of machine-generated outputs, which is a critical contract for the backend and UI.
14. Best architecture-diagram summary
- Draw this as: React UI → ASP.NET Core API → database + Python AI service.
- Put auth, project persistence, and AI orchestration in the backend boundary.
- Put prompting/generation/normalization in the AI boundary.
- Put presentation and user interaction in the frontend boundary.
Main entry points: ArtifactGenerationService.cs Artifact Service · App.jsx React UI · docker-compose.yml Docker Compose · AuthController.cs Auth API
Components 20
Frontend
React + Vite user interface and API boundary
- React UI · User-facing application shell and routing
smartpm-frontend/src/App.jsx - Home · Entry and landing screen
smartpm-frontend/src/pages/Home.jsx - Auth Pages · Login and registration screens
smartpm-frontend/src/pages/Login.jsx - Project Details · Project view and artifact workflow
smartpm-frontend/src/pages/ProjectDetails.jsx - Project Views · Project list, form, specification, artifact, and visualization components
smartpm-frontend/src/components/ProjectList.jsx - API Layer · Frontend HTTP access for auth and project operations
smartpm-frontend/src/api/axios.js
Backend API
ASP.NET Core application, domain logic, and persistence
- Auth API · JWT login and registration endpoints
Backend/SmartPm.Api/Controllers/AuthController.cs - Projects API · Project, specification, and artifact endpoints
Backend/SmartPm.Api/Controllers/projectsController.cs - DTOs · Request and response shapes for API boundaries
Backend/SmartPm.Api/DTOs/ProjectDto.cs - Artifact Service · Coordinates generation and persistence of artifacts
Backend/SmartPm.Api/Services/ArtifactGenerationService.cs - Context Builder · Assembles project context before AI calls
Backend/SmartPm.Api/Services/ProjectContextBuilder.cs - Validation & Auth · AI response validation, JWT, and password hashing
Backend/SmartPm.Api/Services/AIResponseValidator.cs - App DbContext · Database access and entity mapping
Backend/SmartPm.Api/Data/AppDbContext.cs - Domain Models · User, project, specification, and artifact entities
Backend/SmartPm.Api/Models/project.cs
AI Module
Python service for prompt, generation, and normalization
- Prompt Pipeline · Builds prompts and appends project context
AI_Module/app/prompt_builder.py - Generation Core · AI generation routines and output shaping
AI_Module/app/generators.py - Normalizer · Normalizes AI responses into structured outputs
AI_Module/app/response_normalizer.py - AI Service · Python service entrypoint for generation requests
AI_Module/app/main.py
Integration
Top-level orchestration and documentation
- Docker Compose · Runs the frontend, backend, and AI service together
docker-compose.yml - Docs · Requirements and integration plan
docs/Requirements.md
Connections 23
- React UI → Home: routes to · App includes the landing experience
- React UI → Auth Pages: shows · Login and registration screens are part of the UI
- React UI → Project Details: shows · Project workflow is centered in the details page
- React UI → Project Views: composes · Reusable project, artifact, and chart components
- Project Views → API Layer: calls · UI components use the API client layer
- API Layer → Auth API: auth requests · Authentication traffic goes through the backend API
- API Layer → Projects API: project requests · Project and artifact operations go to the backend
- Auth API → DTOs: uses · Controller contracts are DTO-driven
- Projects API → DTOs: uses · Project endpoints exchange explicit DTOs
- Auth API → Validation & Auth: delegates · Token and password handling are service-backed
- Projects API → Artifact Service: delegates · Artifact generation is coordinated in services
- Artifact Service → Context Builder: prepares context · Project data is assembled before AI generation
- Artifact Service → Normalizer: validates output · AI output is checked before persistence
- Artifact Service → App DbContext: persists · Generated artifacts and project data are stored in the database
- App DbContext → Domain Models: maps · EF Core maps the core entities
- Artifact Service → AI Service: calls · Backend forwards generation work to the Python service
- AI Service → Prompt Pipeline: orchestrates · Service entry coordinates prompt construction
- Prompt Pipeline → Generation Core: feeds · Built prompts drive generation routines
- Generation Core → Normalizer: returns · Raw AI output is normalized into structured data
- Docker Compose → React UI: runs · Orchestration includes the frontend service
- Docker Compose → Auth API: runs · Orchestration includes the backend API
- Docker Compose → AI Service: runs · Orchestration includes the AI service
- Docs → Docker Compose: describes · Documentation captures the integration setup