extending web-gallery_webserver to SCS (user management etc)
Part of the Crow-Gallery Project
Table of Contents
CrowGallery Frontend is a modern, responsive single-page application (SPA) built to manage and view photo collections. It serves as the user interface for the high-performance C++ [CrowQtServer] backend.
Built with the latest Angular v21, it leverages Standalone Components, Signals for reactive state management, and Angular Material for a polished UI.
- JWT Authentication: Secure login with Access and Refresh Token handling.
- Role-Based Access Control: Distinct views and capabilities for
UserandAdmin. - Security Guards: Route protection via
AuthGuardandPasswordResetGuard. - Forced Password Rotation: Enforces password changes for new users or expired credentials.
- HTTP Interceptor: Automatically attaches Bearer tokens to outgoing requests.
- Responsive Dashboard: Adaptive grid layout for various screen sizes.
- Private & Public Views: Users can manage their own uploads (planned).
- Modern UI: Clean aesthetic using Material Design 3.
- User Management: Admins can Create, Delete, and Deactivate users.
- Status Monitoring: Visual indicators for user status (Active/Locked).
- Password Resets: Admin-triggered password resets via a dedicated Dialog UI.
- Node.js (v18 or higher)
- npm
Running instance of the CrowQtServer backend.
- Clone the repository
git clone https://github.com/yourusername/web-gallery-frontend.git
cd web-gallery-frontend- Install Dependencies
npm install- Configure Environment
Check src/environments/environment.ts. Ensure apiUrl points to your C++ backend.
export const environment = {
production: false,
apiUrl: 'http://localhost:8080' // Adjust port if necessary
};- Run Development Server
ng serveNavigate to http://localhost:4200/.
src
├── app/
│ ├── components/ # Shared UI (Navbar, etc.)
│ ├── dialogs/ # Modal Dialogs (Password Reset)
│ ├── guards/ # Route protection logic
│ ├── interceptors/ # HTTP Request modification
│ ├── models/ # TypeScript Interfaces
│ ├── pages/ # Views (Dashboard, Login, Admin)
│ ├── service/ # API communication & State
│ ├── app.component.ts # Root layout
│ ├── app.config.ts # Global provider config
│ └── app.routes.ts # Routing definitions
└── environments/ # API configuration```
This project follows a Feature-Based Architecture using Angular Standalone Components. It moves away from NgModules to reduce boilerplate and improve tree-shaking.
graph TD
User[User / Browser] -->|Interaction| View[Component Template]
View -->|Event Binding| Component[Standalone Component]
subgraph "State Management (Signals)"
Component -->|Read| Signal[AuthService Signals]
Signal -->|Update UI| View
end
subgraph "Data Layer"
Component -->|Call| Service[Admin/Auth Service]
Service -->|HTTP Request| HttpClient
HttpClient -->|Intercept| Interceptor[AuthInterceptor]
Interceptor -->|Add Token| API[Backend API]
end
signal-Driven State:
We utilize Angular Signals (e.g., currentUser, passwordChangeRequired) instead of complex RxJS streams for synchronous state management.
This ensures "Zoneless" compatibility and fine-grained UI updates.
Standalone Components:
Components (e.g., UserManagementComponent, NavbarComponent) directly import their dependencies.
This makes the codebase easier to refactor and test.
Security Layer:
- Interceptor: The authInterceptor centrally manages the Authorization header.
- Guards: Functional guards (CanActivateFn) handle redirect logic (e.g., forcing a user to change their password before accessing the dashboard).
- Framework: Angular v21
- Language: TypeScript 5.x
- UI Library: Angular Material v21 & CDK
- Styling: SCSS / CSS3 (Grid & Flexbox)
- Icons: Material Icons
- Build Tool: Angular CLI
Distributed under the MIT License. See LICENSE for more information.
Copyright (c) 2025 ZHENG Robert
🖖