{"id":18614804,"url":"https://github.com/andrewjbateman/angular-material-ssr","last_synced_at":"2026-04-18T07:31:37.735Z","repository":{"id":96858841,"uuid":"391030283","full_name":"AndrewJBateman/angular-material-ssr","owner":"AndrewJBateman","description":":clipboard: Angular app to deploy to Firebase functions as Server Side rendered","archived":false,"fork":false,"pushed_at":"2023-06-13T14:24:06.000Z","size":3652,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-17T01:34:27.590Z","etag":null,"topics":["angular","angular-material16","angular16","angularmaterial","firebase","lighthouse-score","pwa","rxjs7","scss-styles","server-side-rendering","ssr","template"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndrewJBateman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-30T10:49:44.000Z","updated_at":"2023-06-13T14:25:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"1f8a3f19-1f64-4902-8f77-f25562a56e0e","html_url":"https://github.com/AndrewJBateman/angular-material-ssr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AndrewJBateman/angular-material-ssr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-material-ssr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-material-ssr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-material-ssr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-material-ssr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/angular-material-ssr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-material-ssr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31961094,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angular-material16","angular16","angularmaterial","firebase","lighthouse-score","pwa","rxjs7","scss-styles","server-side-rendering","ssr","template"],"created_at":"2024-11-07T03:27:04.370Z","updated_at":"2026-04-18T07:31:37.720Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"TypeScript","readme":"# Angular Material SSR\n\n* Angular app deployed to Firebase functions with Server Side Rendering.\n* Progressive Web App\n* Optimised for an excellent Lighthouse score\n* **Note:** to open web links in a new window use: _ctrl+click on link_\n\n![GitHub repo size](https://img.shields.io/github/repo-size/AndrewJBateman/angular-material-ssr?style=plastic)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/angular-material-ssr?style=plastic)\n![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/angular-material-ssr?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/angular-material-ssr?style=plastic)\n\n## :page_facing_up: Table of contents\n\n* [Angular Material SSR](#angular-material-ssr)\n  * [:page\\_facing\\_up: Table of contents](#page_facing_up-table-of-contents)\n  * [:books: General info](#books-general-info)\n  * [:camera: Screenshots](#camera-screenshots)\n  * [:signal\\_strength: Technologies](#signal_strength-technologies)\n  * [:floppy\\_disk: Setup](#floppy_disk-setup)\n  * [:computer: Code Examples](#computer-code-examples)\n  * [:cool: Features](#cool-features)\n  * [:clipboard: Status \\\u0026 To-Do List](#clipboard-status--to-do-list)\n  * [:clap: Inspiration](#clap-inspiration)\n  * [:file\\_folder: License](#file_folder-license)\n  * [:envelope: Contact](#envelope-contact)\n\n## :books: General info\n\n* Firebase functions used to serve Node.js SSR app\n* Dist folder contains functions folder with browser and server SSR code.\n* Functions folder contains a copy of dependencies from the src package.json file\n* App contains Angular Material card to see effect on rendering speed.\n* [Roboto font style: Regular 400](https://fonts.google.com/specimen/Roboto) used\n\n## :camera: Screenshots\n\n![Frontend screenshot](./img/home.png)\n\n## :signal_strength: Technologies\n\n* [Angular v16](https://angular.io/)\n* [Angular Universal v16](https://angular.io/guide/universal) added for Server Side Rendering (SSR)\n* [Angular Material v16](https://material.angular.io/) Material Design components\n* [Firebase Functions](https://firebase.google.com/docs/functions) serverless framework to automatically run SSR node.js server app\n* [Firebase Emulator](https://firebase.google.com/docs/emulator-suite) tools to test Cloud Functions\n* [RxJS v7](http://reactivex.io/) - not used as yet\n* [Express v4](https://www.npmjs.com/package/express) Node.js framework\n\n## :floppy_disk: Setup\n\n* Create project in Firebase console then add functions. This can all be done from firebase init in VS COde\n* `npm i` to install dependencies\n* `npm prune` to remove unused npm modules\n* `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.\n* `ng update` to update Angular\n\n* Run `npm run dev:ssr` to see SSR app on a dev server\n* Run `npm run build:ssr` to build SSR project. The browser \u0026 server build folders will be stored in the `dist/functions` directory.\n* `cd dist/functions` then run `firebase emulators:start` for Firebase emulator\n* From `/dist/functions` run `npm run deploy` to deploy app to firebase functions \u0026 hosting\n\n## :computer: Code Examples\n\n* `server.ts` Express app exported so that it can be used by serverless Functions.\n\n```typescript\n//\nexport function app(): express.Express {\n  const server = express();\n  const websiteFileLocation = environment.production\n    ? 'browser'\n    : 'dist/functions/browser';\n  const distFolder = join(process.cwd(), websiteFileLocation);\n  const indexHtml = existsSync(join(distFolder, 'index.original.html'))\n    ? 'index.original.html'\n    : 'index';\n\n  // Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine)\n  server.engine(\n    'html',\n    ngExpressEngine({\n      bootstrap: AppServerModule,\n    })\n  );\n\n  server.set('view engine', 'html');\n  server.set('views', distFolder);\n\n  server.get(\n    '*.*',\n    express.static(distFolder, {\n      maxAge: '1y',\n    })\n  );\n\n  server.get('*', (req, res) =\u003e {\n    res.render(indexHtml, {\n      req,\n      providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }],\n    });\n  });\n\n  return server;\n}\n```\n\n## :cool: Features\n\n* Excellent Lighthouse score\n\n## :clipboard: Status \u0026 To-Do List\n\n* Status: Working SSR \u0026 PWA. Deployed to Firebase Functions\n* To-Do: Use to create an actual app with content. Update sitemap \u0026 robots.txt\n\n## :clap: Inspiration\n\n* [Codeible: Server Side Rendering with Angular, Angular Universal, \u0026 Firebase 2021](https://www.youtube.com/watch?v=k7pLxaKkHYs)\n* [Dev.to: Loading Google Fonts and any other web fonts as fast as possible in early 2021](https://dev.to/masakudamatsu/loading-google-fonts-and-any-other-web-fonts-as-fast-as-possible-in-early-2021-4f5o)\n* [MDN: Link types: preload](https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types/preload#Cross-origin_fetches)\n\n## :file_folder: License\n\n* This project is licensed under the terms of the MIT license.\n\n## :envelope: Contact\n\n* Repo created by [ABateman](https://github.com/AndrewJBateman), email: `gomezbateman@yahoo.com`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fangular-material-ssr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fangular-material-ssr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fangular-material-ssr/lists"}