How aymensat/satsat_first works
Project type and purpose
• This is a full-stack Angular Universal project:
• Frontend: Angular SPA with multiple feature modules (admin, teacher, student).
• SSR layer: server.ts and main.server.ts set up an Express server for server-side rendering.
• No embedded database code—data is fetched from external REST APIs via services (e.g., admin.service.ts, auth.service.ts).
File structure
• Top-level:
• Angular CLI files (angular.json, tsconfig.json, etc.)
• public/ and src/ directories
• src/ breakdown:
• app/ – core Angular modules, components and routing (app.routes.ts)
• app/guards/ – route-guard classes (auth.guard.ts, etc.)
• app/services/ – HTTP services & an interceptor for JWT
• Feature modules:
– admin-space/
– teacher-space/
– student-space/
– login/, navbar/
• main.ts – client bootstrap
• main.server.ts & server.ts – SSR bootstrap and Express server
Extract architecture hints from the README
• Built/served via ng serve for dev
• Built into dist/ for production (separate browser + server bundles)
• No mention of internal DB: it relies on remote HTTP backends.
Main components & interactions
a. Browser Client
– Loads initial HTML/CSS/JS assets.
– Runs Angular app in the browser after hydration.
b. Angular Universal Server
– Express app in server.ts uses main.server.ts to pre-render pages.
– Serves static assets plus pre-rendered HTML.
c. External REST API
– Unspecified (likely running elsewhere).
– Services (auth.service.ts, admin.service.ts, etc.) make HTTP calls.
d. Feature Modules
– AdminSpace, TeacherSpace, StudentSpace, Login, Navbar.
– Route guards secure routes (AuthGuard, AdminGuard, TeacherGuard).
Relationships:
– Browser ↔ SSR Server: HTTP requests for pages & assets
– SSR Server ↔ External API: HTTP for data fetching during SSR
– Browser App ↔ External API: HTTP via JWT-intercepted requests after hydration
Architectural patterns & design principles
• Modular design: each feature is a separate Angular module/component folder
• Separation of concerns:
• Guards handle routing/security
• Services handle API interaction
• Universal rendering: dual bootstraps (client & server)