All Projects → Angular-RU → Universal Starter

Angular-RU / Universal Starter

Licence: mit
Angular 9 Universal repo with many features

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Universal Starter

Razzle Material Ui Styled Example
Razzle Material-UI example with Styled Components using Express with compression
Stars: ✭ 117 (-77.41%)
Mutual labels:  webpack, universal, example, ssr, server-side-rendering
Reactql
Universal React+GraphQL starter kit: React 16, Apollo 2, MobX, Emotion, Webpack 4, GraphQL Code Generator, React Router 4, PostCSS, SSR
Stars: ✭ 1,833 (+253.86%)
Mutual labels:  webpack, universal, ssr, server-side-rendering
Suicrux
🚀 Ultimate universal starter with lazy-loading, SSR and i18n. [not maintained]
Stars: ✭ 958 (+84.94%)
Mutual labels:  webpack, universal, example, ssr
Sambell
wake me when it's quitting time
Stars: ✭ 101 (-80.5%)
Mutual labels:  webpack, universal, server-side-rendering
Mern
🎉 This is boilerplate for MERN stack with integrations like Redux and SSR 🎉
Stars: ✭ 77 (-85.14%)
Mutual labels:  webpack, ssr, server-side-rendering
Egg Vue Webpack Boilerplate
Egg Vue Server Side Render (SSR) / Client Side Render (CSR)
Stars: ✭ 1,302 (+151.35%)
Mutual labels:  webpack, ssr, server-side-rendering
React Core Boilerplate
Powerful ASP.NET Core 3 templates with React, true server-side rendering and Docker support
Stars: ✭ 169 (-67.37%)
Mutual labels:  webpack, ssr, server-side-rendering
After.js
Next.js-like framework for server-rendered React apps built with React Router
Stars: ✭ 4,051 (+682.05%)
Mutual labels:  webpack, ssr, server-side-rendering
Cra Universal
🌏 Create React App companion for universal app. No eject, auto SSR, zero config, full HMR, and more (inactive project)
Stars: ✭ 419 (-19.11%)
Mutual labels:  universal, ssr, server-side-rendering
React Router Server
Server Side Rendering library for React Router v4.
Stars: ✭ 443 (-14.48%)
Mutual labels:  webpack, ssr, server-side-rendering
Vuesion
Vuesion is a boilerplate that helps product teams build faster than ever with fewer headaches and modern best practices across engineering & design.
Stars: ✭ 2,510 (+384.56%)
Mutual labels:  webpack, server-side-rendering, universal
webpack-isomorphic-compiler
A compiler that makes your life easier if you are building isomorphic webpack powered apps, that is, single page applications with server-side rendering
Stars: ✭ 16 (-96.91%)
Mutual labels:  universal, ssr, server-side-rendering
React Universal Boiler
A bold way to begin your next great universal React application. Uses Webpack 3, React 16, Redux, and more for a great developer experience.
Stars: ✭ 65 (-87.45%)
Mutual labels:  webpack, ssr, server-side-rendering
Rpg Boilerplate
Relay (React), Postgres, and Graphile (GraphQL): A Modern Frontend and API Boilerplate
Stars: ✭ 62 (-88.03%)
Mutual labels:  webpack, ssr, server-side-rendering
Ssr Sample
A minimum sample of Server-Side-Rendering, Single-Page-Application and Progressive Web App
Stars: ✭ 285 (-44.98%)
Mutual labels:  webpack, ssr, server-side-rendering
Universal
Seed project for Angular Universal apps featuring Server-Side Rendering (SSR), Webpack, CLI scaffolding, dev/prod modes, AoT compilation, HMR, SCSS compilation, lazy loading, config, cache, i18n, SEO, and TSLint/codelyzer
Stars: ✭ 669 (+29.15%)
Mutual labels:  webpack, universal, server-side-rendering
Loadable Components
The recommended Code Splitting library for React ✂️✨
Stars: ✭ 6,194 (+1095.75%)
Mutual labels:  webpack, ssr, server-side-rendering
React App
Create React App with server-side code support
Stars: ✭ 614 (+18.53%)
Mutual labels:  webpack, ssr, server-side-rendering
Crate
👕 👖 📦 A sample web and mobile application built with Node, Express, React, React Native, Redux and GraphQL. Very basic replica of stitchfix.com / krate.in (allows users to get monthly subscription of trendy clothes and accessories).
Stars: ✭ 2,281 (+340.35%)
Mutual labels:  webpack, ssr, server-side-rendering
movies
Real world isomorphic application for movies search, based on Webpack 5 / Express / React 17 + Redux-Saga / Bootstrap 4.6 + CSS Modules / i18next / SSR
Stars: ✭ 20 (-96.14%)
Mutual labels:  ssr, example, server-side-rendering

Angular RU Universal Starter Angular-RU Angular-RU Universal

Build Status Build Status

If you like this project please show your support with a GitHub star. Much appreciated!

Repository with Angular CLI and Angular Universal

Translations:

Resources:

Plans:

  • [x] Angular 8
  • [x] document is not defined and window is not defined - here
  • [x] Angular Material2 UI components - individual branch
  • [x] Primeng UI components - [individual branch] (https://github.com/Angular-RU/angular-universal-starter/tree/primeng)
  • [x] modules import depending on the platform (MockServerBrowserModule)
  • [x] execution of queries to api on the server TransferHttp
  • [x] work with cookies on the server UniversalStorage
  • [x] Uses ngx-meta for SEO (title, meta tags, and Open Graph tags for social sharing).
  • [x] uses ngx-translate to support internationalization (i18n)
  • [x] uses ORIGIN_URL - for absolute queries
  • [x] @angular/service-worker(ng add @angular/pwa --project universal-demo)

How to start

  • yarn or npm install
  • yarn start or npm run start - for client rendering
  • yarn ssr or npm run ssr - for server-side rendering
  • yarn build:universal or npm run build:universal - for assembly in release
  • yarn server or npm run server - to start the server
  • yarn build:prerender or npm run build:prerender - to generate static by static.paths.ts
  • for watch with ssr - npm run ssr:watch

How to use this repository in your project:

To transfer ssr to your repository, you need the following files:

  • .angular-cli.json
  • server.ts
  • prerender.ts
  • webpack.config.js
  • main.server.ts
  • main.browser.ts
  • shared/*
  • forStorage/*
  • environments/*
  • app.browser.module.ts
  • app.server.module.ts

References

Official example in English: https://github.com/angular/universal-starter Modules used for universal:

Features (Important)

  • The module for TransferHttp uses import {TransferState} from '@angular/platform-browser'; and it is necessary to implement the request rest api on the server and the absence of the second request a second time. See home.component.ts (delay 3c)
this.http.get('https://reqres.in/api/users?delay=3').subscribe(result => {
    this.result = result;
});
  • export const AppRoutes = RouterModule.forRoot(routes, { initialNavigation: 'enabled' });- so that there is no flashing of the page!

  • to work with cookies, it is written AppStorage, which with DI allows you to give different implementations for the server and the browser. See server.storage.ts and browser.storage.ts for implementations. In server.ts there is

providers: [
    {
        provide: REQUEST, useValue: (req)
    },
    {
        provide: RESPONSE, useValue: (res)
    }
]

to work with REQUEST and RESPONSE via DI - this is necessary for implementing UniversalStorage when working with cookies.

  • webpack.config.js is written exclusively for building server.ts file in server.js, since angular-cli has [bug](https: //github.com / angular/angular-cli/issues/7200) to work with 3d dependencies. - To solve some problems, use the following code in server.ts Solving the problems of global variables, including document is not defined and window is not defined
const domino = require('domino');
const fs = require('fs');
const path = require('path');
const template = fs.readFileSync(path.join(__dirname, '.', 'dist', 'index.html')).toString();
const win = domino.createWindow(template);
const files = fs.readdirSync(`${process.cwd()}/dist-server`);
// const styleFiles = files.filter(file => file.startsWith('styles'));
// const hashStyle = styleFiles[0].split('.')[1];
// const style = fs.readFileSync(path.join(__dirname, '.', 'dist-server', `styles.${hashStyle}.bundle.css`)).toString();

global['window'] = win;
Object.defineProperty(win.document.body.style, 'transform', {
  value: () => {
    return {
      enumerable: true,
      configurable: true
    };
  },
});
global['document'] = win.document;
global['CSS'] = null;
// global['XMLHttpRequest'] = require('xmlhttprequest').XMLHttpRequest;
global['Prism'] = null;
  global['navigator'] = req['headers']['user-agent'];

this allows you to remove some of the problems when working with undefined.

Migrate 5 to 6

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].