All Projects → scalable-react → Scalable React Typescript Boilerplate

scalable-react / Scalable React Typescript Boilerplate

Licence: mit
⭐️ Scalable micro-framework featuring React and TypeScript

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Scalable React Typescript Boilerplate

Scalable React Boilerplate
⭐️ Scalable feature-first React micro-framework made for Udacity Alumni collaborative projects
Stars: ✭ 260 (+49.43%)
Mutual labels:  graphql, apollo, hot-reloading, isomorphic, boilerplate
React App
Create React App with server-side code support
Stars: ✭ 614 (+252.87%)
Mutual labels:  graphql, webpack, isomorphic, boilerplate
React Redux Graphql Apollo Bootstrap Webpack Starter
react js + redux + graphQL + Apollo + react router + hot reload + devTools + bootstrap + webpack starter
Stars: ✭ 127 (-27.01%)
Mutual labels:  graphql, apollo, webpack, boilerplate
Project Webcube
Continuously updated JS infrastructure for modern web dev
Stars: ✭ 141 (-18.97%)
Mutual labels:  graphql, webpack, isomorphic, boilerplate
Vortigern
A universal boilerplate for building web applications w/ TypeScript, React, Redux, Server Side Rendering and more.
Stars: ✭ 647 (+271.84%)
Mutual labels:  webpack, isomorphic, boilerplate
Reactconfbr
Public infos and issues about React Conf Brasil organization
Stars: ✭ 156 (-10.34%)
Mutual labels:  graphql, apollo, webpack
Preact Redux Isomorphic
preact-redux-isomorphic PWA SPA SSR best practices and libraries in under 80kB page size (for live demo click the link below)
Stars: ✭ 85 (-51.15%)
Mutual labels:  graphql, isomorphic, boilerplate
Razzle Material Ui Styled Example
Razzle Material-UI example with Styled Components using Express with compression
Stars: ✭ 117 (-32.76%)
Mutual labels:  webpack, isomorphic, boilerplate
React Starter Kit
React Starter Kit — front-end starter kit using React, Relay, GraphQL, and JAM stack architecture
Stars: ✭ 21,060 (+12003.45%)
Mutual labels:  graphql, webpack, boilerplate
The Ultimate Boilerplate
webpack 2, react hotloader 3, react router v4, code splitting and more
Stars: ✭ 85 (-51.15%)
Mutual labels:  webpack, hot-reloading, boilerplate
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 (+953.45%)
Mutual labels:  graphql, apollo, webpack
Awesome Apollo Graphql
A curated list of amazingly awesome things regarding Apollo GraphQL ecosystem 🌟
Stars: ✭ 126 (-27.59%)
Mutual labels:  graphql, apollo, boilerplate
Apollo Universal Starter Kit
Apollo Universal Starter Kit is an SEO-friendly, fully-configured, modular starter application that helps developers to streamline web, server, and mobile development with cutting-edge technologies and ultimate code reuse.
Stars: ✭ 1,645 (+845.4%)
Mutual labels:  graphql, apollo, webpack
Pup
The Ultimate Boilerplate for Products.
Stars: ✭ 563 (+223.56%)
Mutual labels:  graphql, apollo, boilerplate
React Isomorphic Boilerplate
🌟 An universal React isomorphic boilerplate for building server-side render web app.
Stars: ✭ 653 (+275.29%)
Mutual labels:  webpack, isomorphic, boilerplate
Cookiecutter Django Vue
Cookiecutter Django Vue is a template for Django-Vue projects.
Stars: ✭ 462 (+165.52%)
Mutual labels:  graphql, apollo, webpack
Meteor Apollo Starter Kit
Meteor, Apollo, React, PWA, Styled-Components boilerplate
Stars: ✭ 91 (-47.7%)
Mutual labels:  graphql, apollo, boilerplate
Ssr Sample
A minimum sample of Server-Side-Rendering, Single-Page-Application and Progressive Web App
Stars: ✭ 285 (+63.79%)
Mutual labels:  graphql, apollo, webpack
Webpack Hot Server Middleware
🔥 Hot reload webpack bundles on the server
Stars: ✭ 319 (+83.33%)
Mutual labels:  webpack, hot-reloading, isomorphic
Serverless Prisma
AWS Serverless Prisma Boilerplate
Stars: ✭ 126 (-27.59%)
Mutual labels:  graphql, webpack, boilerplate

NOTICE:

The maintainers of this repo are no longer able to support a thriving open source community. This repo will stay put to serve as an example for the community, but should not be depended on in a production application unless you and are your team intend to build upon it.

If you're interested in helping to support and grow this library, please let us know in the issues!

Open UI

We are working on a ui kit, which you'll find located in the packages directory. Much like this project, this code is not yet production ready and we have yet to document it. Please stay tuned.

TypeScript

Scalable React TS Boilerplate

Build Status PRs Welcome Roadmap Star on Github Watch on Github Tweet

Checkout our website for documentation and examples.

Background Info

We know that there are a ton of react boilerplates and starter projects to choose from. Our hope with this project is to provide an example of one of the best front-end architectural patterns available: Feature First. We started initially with a vanilla JS version of this architecture and have since converted it entirely to strongly-typed TypeScript. Above all else, the hope of this repository is to provide the open source community with a great example of how to build large-scale apps with React and TypeScript using the feature-first modularization pattern. Read on to get started!

Main Features

  • Feature First
  • Statically Typed
  • TypeScript
  • Lerna
  • Starter UI Kit (Open UI)
  • Redux Logic
  • Webpack 2
  • React
  • Redux
  • Hot Module Reloading
  • Server Side Rendering
  • Highly optimized webpack configuration
    • Code Chunking
    • Lazy route loading
    • Uglification / minification

Getting Started

  1. Clone the Repo git clone https://github.com/RyanCCollins/scalable-react-ts-boilerplate

  2. Install Dependencies From the root of the project directory, run yarn if you have yarn installed globally. --- or --- npm install.

  3. Clear out the code you don't want. Run npm run clean to get rid of the docs package and to reset the codebase to the bare minimum (note: we are still working on this and this would be a great place to submit an improvement).

  4. Start the Development Server Run npm run start then browse http://localhost:1337 to see your running app.

What is Feature First?

In many projects and frameworks, files are organized by their file type. For example, you will find tests in a test folder, reducers in a reducers folder and so on and so forth. This framework takes a different approach.

We encourage modularization / encapsulation of features by asking that you organize your files by feature, rather than file type. When you begin working on your next container, instead of having to root through multiple files to find all of the files that the container depends on, you can expect to find these files in one place: with the feature that they represent. This helps to decouple the features in your app, lending itself well to code reuse, scalability and modularization.

On top of that, we also ask that you think about separation of concern as you are building your features. You will see in the example application in this repository that a feature is built up of a dozen or so small, single purpose modules. By following these simple patterns, you will set yourself up for maximum scalability. Give it a try! We think you will enjoy it.

Lerna

We are hard at work converting the structure of this boilerplate to use Lerna. Stay tuned for more information!

Styled Components

This project embraces styled-components as it's a fantastic way to style your React components.

Check the components directory for examples.

Full Stack

This boilerplate contains setup to quickly get started with a full stack application. Within the src/ directory, you will find a server and a client folder.

File Tree Structure

Client File Structure

src/client
├── apolloClient.ts
├── components
│   ├── Box
│   │   ├── __tests__
│   │   │   ├── __mocks__
│   │   │   │   └── boxMocks.mock.ts
│   │   │   ├── __snapshots__
│   │   │   │   └── index.test.tsx.snap
│   │   │   └── index.test.tsx
│   │   ├── index.tsx
│   │   ├── maps.ts
│   │   ├── styleUtils.ts
│   │   ├── styles.ts
│   │   └── types.ts
│   ├── Section
│   │   ├── __tests__
│   │   │   ├── __mocks__
│   │   │   │   └── sectionMocks.mock.ts
│   │   │   ├── __snapshots__
│   │   │   │   └── index.test.tsx.snap
│   │   │   └── index.test.tsx
│   │   ├── index.tsx
│   │   └── styles.ts
│   └── index.ts
├── containers
│   ├── Blog
│   │   ├── index.tsx
│   │   ├── posts.graphql.ts
│   │   └── styles.ts
│   ├── BlogPost
│   │   ├── comments.graphql.ts
│   │   ├── index.tsx
│   │   ├── post.graphql.ts
│   │   └── styles.ts
│   └── index.ts
├── index.tsx
├── reducers.ts
├── routes.tsx
├── store.tsx
└── styles
    └── index.css

Server file structure

src/server
├── db
│   ├── index.ts
│   ├── models
│   │   ├── comment.ts
│   │   └── post.ts
│   └── utils
│       └── uuid.ts
├── graph
│   ├── index.ts
│   ├── mutations
│   │   ├── comment
│   │   │   ├── createComment.ts
│   │   │   └── index.ts
│   │   └── index.ts
│   ├── queries
│   │   ├── comment
│   │   │   ├── comment.ts
│   │   │   ├── comments.ts
│   │   │   └── index.ts
│   │   ├── index.ts
│   │   └── post
│   │       ├── index.ts
│   │       ├── post.ts
│   │       └── posts.ts
│   ├── schema.json
│   └── types
│       ├── comment
│       │   ├── comment.ts
│       │   └── commentInput.ts
│       ├── index.ts
│       └── post
│           ├── post.ts
│           └── postInput.ts
├── graphqlEntry.ts
└── index.tsx

Apollo GraphQL

Recently, we've added support for Apollo and GraphQL both server and client side. The starter code in this repo demonstrates how to setup your GraphQL server. The /blog route will show you a very simple example of loading data via Apollo Graphql.

UI Components

Build your next UIKit with this library!

Included in this project are a few primitive components that you can use to bootstrap your next project, or as a reference for building a UIKit.

React Storybook

We've included react storybook to make it easy for you to test your ui kit components. Run npm run storybook and navigate to http://localhost:9001 to see your stories.

You can add more stories as you are building out your components within the ./config/.storybook/stories folder. Simply write a story and export it in the stories/index.js file. Checkout the React Storybook docs for more info!

Note: the components are currently being served from the build directory, so please make sure you have compiled (npm run compile) the app before running.

Generators

We've included some generators so that you can easily scaffold out components & containers from the command line.

To use the generators, run npm run generator and select the options you want to use. The generators will create your component or container and their accompanying imports / exports.

Server Rendering

We have included setup to get you server-rendering out of the box. Included in the setup is an Express server that will server render. Note that the server-rendering will not work with the TypeScript source code, so you must compile the project into the Build directory first. Also, you must copy any other assets (images, markdown, etc.) into the build folder.

Testing

Included is a test framework for all of your React testing needs. We are using Jest to run the test suite and generate snapshots, plus Enzyme for component introspection.

Tests should be collocated within the component / container they represent. Test files should be named index.test.tsx and mocks must be named myMock.mock.ts.

Please reference the Box and Section components for example tests. More will be added at a later time.

Note that the test are not compiled by TypeScript, that way there is no code duplication and you can use static types in your tests.

P.S. If you are looking to contribute, this would be a great first contribution!

Deployment

The documentation website built for this boilerplate is deployed to Heroku. Included is a Procfile that will run the server. The deployment is automated completely. After the install script, the deploy script will run on the server in order to compile the bundle and prepare the build folder for server-rendering.

Scripts

  • npm run setup:yarn
    • Install the package dependencies via yarn (recomended)
  • npm install
    • Install dependencies (the ol' fashioned way)
  • npm run start
    • Start the dev server
  • npm run build
    • Build the project
  • npm run deploy
    • Create a production bundle for deployment
  • npm run serve
    • Serve the production bundle on port 1337
  • npm run test
    • Run the test suite
  • npm run test:watch
    • Run the test suite in watch mode
  • npm run test:update
    • Update the failing snapshot tests
  • npm run storybook
    • Run the storybook server

Resources

Contributing

See here for our contribution guide. We are on slack, please go here for an invite! We'd love to hear from you!

License

See here for the license.

Roadmap

v1.0.2

  • [X] Add CI
  • [x] Introduce an async redux workflow
    • Redux logic
  • [x] Integrate storybook
  • [x] Standardize the tslint configuration
  • [x] Add more reusable modules, ala box / section
  • [x] Refactor reusable modules into uikit
  • [x] Remove requires and use es6 imports for all libs
  • [x] Add a no any rule and update source to use it
  • [ ] Migrate to a multi-module pattern using lerna (in progress)

Troubleshooting

Make sure to use the right version of node. You can reference the version in the .nvmrc file. For help installing and using NVM, please refer to this gist.

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].