{"id":18614808,"url":"https://github.com/andrewjbateman/angular-pwa-ssr","last_synced_at":"2025-08-10T20:07:18.803Z","repository":{"id":50575996,"uuid":"355069542","full_name":"AndrewJBateman/angular-pwa-ssr","owner":"AndrewJBateman","description":":clipboard: Angular app with Server Side Rendering working as a Progressive Web App. Deployed to Netlify.","archived":false,"fork":false,"pushed_at":"2023-05-28T14:23:06.000Z","size":6049,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T11:01:32.270Z","etag":null,"topics":["angular","angular-universal","angular16","api-rest","lighthouse-score","pwa","rxjs","rxjs7","ssr","universal"],"latest_commit_sha":null,"homepage":"https://ecstatic-turing-a45442.netlify.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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":"LICENSE","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-04-06T05:38:45.000Z","updated_at":"2024-06-23T10:10:18.000Z","dependencies_parsed_at":"2024-11-07T03:41:02.392Z","dependency_job_id":null,"html_url":"https://github.com/AndrewJBateman/angular-pwa-ssr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AndrewJBateman/angular-pwa-ssr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-pwa-ssr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-pwa-ssr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-pwa-ssr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-pwa-ssr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/angular-pwa-ssr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-pwa-ssr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269780617,"owners_count":24474686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"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-universal","angular16","api-rest","lighthouse-score","pwa","rxjs","rxjs7","ssr","universal"],"created_at":"2024-11-07T03:27:05.144Z","updated_at":"2025-08-10T20:07:18.780Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :zap: Angular PWA SSR\n\n* Angular used to display data from an API with Server Side Rendering as a Progressive Web App.[Deployed to Netlify](https://ecstatic-turing-a45442.netlify.app/).\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-pwa-ssr?style=plastic)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/angular-pwa-ssr?style=plastic)\n![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/angular-pwa-ssr?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/angular-pwa-ssr?style=plastic)\n\n## :page_facing_up: Table of contents\n\n* [:zap: Angular PWA SSR](#zap-angular-pwa-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  * [:wrench: Testing](#wrench-testing)\n  * [:computer: Code Examples](#computer-code-examples)\n  * [:cool: Features](#cool-features)\n  * [:clipboard: Status, Testing \\\u0026 To-Do List](#clipboard-status-testing--to-do-list)\n  * [:clap: Inspiration/General Tools](#clap-inspirationgeneral-tools)\n  * [:file\\_folder: License](#file_folder-license)\n  * [:envelope: Contact](#envelope-contact)\n\n## :books: General info\n\n* User can enter a post code to search for all commercial enterprises around the RATP station in that post code\n* Data comes from the RATP API\n* Using Angular Server Side Rendering (ngUniversal) and Service Workers for a Progressive Web App\n* Includes Transloco i18n translation json files so user can switch languages from nav buttons\n* Deployed from Github so each Commit causes an auto-deploy in Netlify. Netlify performs the build process.\n\n* **Important note:** I had to specify Node version in Netlify in `site-name/settings/deploys/Environment/Environment variables/` `key - value` `NODE_VERSION - 16.13.2` or deploy would fail - see image below\n\n## :camera: Screenshots\n\n![Frontend screenshot](./imgs/ratp-lh.png)\n![Frontend screenshot](./imgs/about-lh.png)\n![Frontend screenshot](./imgs/contact-lh.png)\n![Frontend screenshot](./imgs/netlify.png)\n\n## :signal_strength: Technologies\n\n* [Angular framework v16](https://angular.io/)\n* [Angular Universal v16](https://angular.io/guide/universal) Server-Side Rendering(SSR) by a Node Express web server\n* [Angular Express Engine v16](https://www.npmjs.com/package/@nguniversal/express-engine) for running Angular Apps on the server for server side rendering\n* [Tailwind CSS v3](https://tailwindcss.com/)\n* [Transloco v4](https://ngneat.github.io/transloco/) used for i18n translations\n* [Google Chrome Lighthouse](https://developers.google.com/web/tools/lighthouse) to check quality of website\n* [SSR Cookie Service v16](https://www.npmjs.com/package/ngx-cookie-service) to read, set and delete browser cookies\n\n## :floppy_disk: Setup\n\n* Install dependencies using `npm i`\n* Run `npm outdated` to see if any dependencies are outdated.\n* Run `ng serve` for a non-SSR dev server. Frontend will open at `http://localhost:4200/` - refreshes on code changes\n* Run `npm run dev:ssr` for an SSR dev server.\n* Run `npm run build` to generate a build file without SSR\n* Run `npm run build:ssr` to generate a build file with SSR. Add `defer` to browser CSS file ref.\n* Run `npm run serve:ssr` to see on a dev server `http://localhost:4000`\n* Run `npm run prerender` to prerender SSR app\n\n## :wrench: Testing\n\n* Run `ng test` to run Jasmine unit tests via [Karma](https://karma-runner.github.io) - passes 2/6 tests\n\n## :computer: Code Examples\n\n* function to serve browser content using SSR - code from ngUniversal\n\n```typescript\n// The Express app is exported so that it can be used by serverless Functions.\nexport function app(): express.Express {\n  const server = express();\n  const distFolder = join(process.cwd(), 'dist/angular-pwa-ssr/browser');\n  const indexHtml = existsSync(join(distFolder, 'index.original.html')) ? 'index.original.html' : 'index';\n\n  server.engine('html', ngExpressEngine({\n    bootstrap: AppServerModule,\n  }));\n\n  server.set('view engine', 'html');\n  server.set('views', distFolder);\n\n  server.get('*.*', express.static(distFolder, {\n    maxAge: '1y'\n  }));\n\n  server.get('*', (req, res) =\u003e {\n    res.render(indexHtml, { req, providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }] });\n  });\n\n  return server;\n}\n```\n\n## :cool: Features\n\n* Dummy `Robots.txt` \u0026 `sitemap.xml` documents added to improve Lighthouse score\n* Lighthouse scores: 97 - 99%\n\n## :clipboard: Status, Testing \u0026 To-Do List\n\n* Status: Working PWR \u0026 SSR app deployed to Netlify. Lighthouse score \u003e 97% for all pages\n* Testing: 6/6 tests pass\n* To-Do: Add tests, add eslint\n\n## :clap: Inspiration/General Tools\n\n* [RATP API: Commerces de proximité agréés RATP](https://dataratp2.opendatasoft.com/explore/dataset/commerces-de-proximite-agrees-ratp/information/)\n* [StackOverflow: Property has no initializer and is not definitely assigned in the constructor](https://stackoverflow.com/questions/64874221/property-has-no-initializer-and-is-not-definitely-assigned-in-the-constructor) includes useful summary of how to avoid errors with initializers\n* [Code Shots with Profanis: Discover How to Unit Test Angular Components with RouterTestingHarness](https://www.youtube.com/watch?v=RG5iN783rAY)\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fangular-pwa-ssr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fangular-pwa-ssr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fangular-pwa-ssr/lists"}