Yasith Jayawardana created AIRAVATA-3979:
--------------------------------------------

             Summary: Revamped Airavata REST API and NextJS Portal
                 Key: AIRAVATA-3979
                 URL: https://issues.apache.org/jira/browse/AIRAVATA-3979
             Project: Airavata
          Issue Type: New Feature
            Reporter: Yasith Jayawardana


# feat: Complete Next.js portal and REST API for Airavata
 
## Summary
 
This PR completes the Next.js-based Airavata portal (`airavata-portal/`) and 
its supporting Spring Boot REST API (`airavata-api/modules/rest-api/`), 
extending the foundation laid in `feat/svclayer`. The `feat/svclayer` branch 
modernized Airavata from legacy Thrift services to a Spring Boot service-layer 
architecture with 30+ REST controllers, Temporal workflow integration, and 
significant cleanup of dead code and deprecated APIs. This PR builds on that 
work to deliver a fully functional, production-ready web portal.
 
## Context
 
The `feat/svclayer` branch introduced:
- **Spring Boot service-layer architecture** — replacing the legacy Thrift RPC 
layer
- **30+ REST controllers** covering experiments, applications, credentials, 
groups, projects, resources, workflows, gateway config, statistics, and more
- **Next.js portal scaffolding** — App Router structure with ~44 pages, Radix 
UI components, NextAuth authentication, and OpenAPI-generated TypeScript types
- **Monorepo consolidation** — restructured deployment (Ansible roles), removed 
Thrift IDL
 
The portal and REST API in `feat/svclayer` have the structure in place but many 
pages are stubs and several API endpoints need completion to support the full 
user-facing feature set.
 
## What This PR Does
 
### Next.js Portal (`airavata-portal/`)
 
Building on the existing 196 source files and 44 page routes:
 
#### Complete existing page implementations
- **Dashboard** (`(dashboard)/`) — wire up `DashboardStats`, 
`RecentExperiments`, `QuickActions` components with live data from REST API
- **Experiments** — complete `CreateExperimentWizard` flow: application 
selection, input configuration (file/string/select editors), compute resource + 
queue selection, binding selection, review & launch
- **Experiment detail** (`experiments/[experimentId]`) — real-time status 
polling, `ProcessTimeline`, output display factory (file, image, HTML, 
notebook, link renderers)
- **Projects** — full CRUD: list, create, detail view with experiment listing, 
edit
- **Applications** — `ApplicationList`/`ApplicationCard` with search, 
`ApplicationDetailsModal`, `CreateApplicationWizard`
- **Groups** — group CRUD, member management, role assignment
- **Credentials** — SSH key generation (via `/api/v1/ssh-keygen`), password 
credential management, `CredentialPicker` for resource binding
- **Catalog** (`catalog/`) — resource catalog with `ResourceGrid`, 
`ResourceFilters`, dataset/repository management (`AddDatasetModal`, 
`AddRepositoryModal`)
- **Admin pages** — user management, gateway settings, notices, statistics 
(`GatewayStatistics`), credential management, artifact management
 
#### Gateway-scoped views (`[gatewayName]/`)
- Complete gateway-scoped routing: experiments, applications, resources, 
workflows, groups, admin, access control
- `GatewaySelector` + `GatewayBadge` components for multi-gateway navigation
- Workflow viewer and run detail pages
 
#### Platform-level admin (`admin/`)
- Gateway management (list, detail/edit per gateway)
- Super-admin layout and access control
 
#### Infrastructure
- **API proxy** (`api/v1/[...path]/route.ts`) — Next.js route handler proxying 
to Spring Boot backend with auth token forwarding
- **Connectivity tests** — SSH, SFTP, SLURM test endpoints 
(`api/v1/connectivity-test/`)
- **Auth flow** — NextAuth with Keycloak OIDC, session-check endpoint, logout, 
error handling, middleware-based route protection
- **Hooks layer** — complete implementations for `useApplications`, 
`useExperiments`, `useProjects`, `useGroups`, `useCredentials`, `useResources`, 
`useBindings`, `useWorkflows`, `useGatewayConfig`, `useUsers`, `useCatalog`, 
`useArtifacts`, `useGateways`
- **Context providers** — `GatewayContext`, `PortalConfigContext`, 
`AdvancedFeaturesContext`, `CreateExperimentModalContext`
- **Testing** — Vitest unit tests, Playwright E2E tests (health, login flows), 
test data seeding script
 
### REST API (`airavata-api/modules/rest-api/`)
 
Extending the existing 30+ controllers to fully support portal operations:
 
#### Controllers requiring completion
- `ExperimentController` — launch, cancel, clone, output retrieval, status 
streaming
- `ApplicationController` / `ApplicationInstallationController` — full app 
catalog CRUD, deployment descriptions per compute resource
- `FileController` — file upload/download for experiment inputs and outputs
- `CredentialController` — SSH key generation, credential lifecycle, 
association with resources
- `ResourceController` / `ResourceBindingController` — compute/storage resource 
registration, queue configuration, resource-credential binding
- `GroupController` — group CRUD, membership, role-based sharing
- `StatisticsController` — gateway-level usage statistics, job counts, resource 
utilization
- `GatewayConfigController` / `GatewayController` — gateway preferences, 
notification configuration
- `WorkflowController` / `WorkflowRunController` — workflow template CRUD, run 
execution and status
- `ConnectivityTestController` — SSH/SFTP/SLURM reachability checks from backend
- `UserController` — user profile, role management, gateway access control
- `AuthController` — token exchange, session management, Keycloak integration
- `NoticeController` — system notice CRUD
- `PlanController` — allocation/resource plan management
- `SystemConfigController` / `SystemController` — system-wide configuration, 
health endpoints
 
#### Cross-cutting
- OpenAPI/Swagger documentation (`OpenApiConfiguration`) for generated 
TypeScript types
- Unified exception handling (`ApiErrorResponse`, module-specific exception 
handlers)
- Spring Security integration with Keycloak JWT validation
 
### Deployment
 
- **Ansible** — `deployment/ansible/roles/portal/` with systemd service, env 
templating, Keycloak webserver integration
- **Docker** — portal Dockerfile, `.dockerignore`
 
## Test Plan
 
- [ ] `npm run build` succeeds for `airavata-portal`
- [ ] `npm run test` — all Vitest unit tests pass
- [ ] `npm run test:e2e` — Playwright health and login tests pass
- [ ] `go test ./...` passes for `airavata-api` modules
- [ ] `mvn verify` passes for `rest-api` module
- [ ] Manual: login via Keycloak, navigate dashboard, create experiment, view 
results
- [ ] Manual: admin pages — user management, gateway settings, statistics render
- [ ] Manual: connectivity test (SSH/SFTP) against a registered compute resource
- [ ] Verify OpenAPI spec generation (`/v3/api-docs`) and `npm run 
generate:types` round-trip



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to