:point_up::running: Modern Relay Starter Kit - Integrated with Relay, GraphQL, Express, ES6/ES7, JSX, Webpack, Babel, Material Design Lite, and PostCSS

Overview





Dependency Status devDependency Status

Relay Fullstack is a Relay scaffolding application that aims to help you get up and running a project without worrying about integrating tools. It comes with many modern technologies; Relay, GraphQL, Express, ES6/ES7, JSX, Webpack, Babel, Material Design Lite, and PostCSS. Relay Fullstack is also using Hot-reload to real time update the screen whenever any code changes.

Example

Demo

Check out the Live demo on Heroku.

Usage

Basic

The basic installation contains only general technologies needed by most of the projects, Relay Fullstack is totally unopinionated. If you wanted to include a database, flow, or any specific technologies, please see the Advance section.

First, you need watchman installed, please follow its installation guide. Then, clone the repository to your local directory

$ git clone https://github.com/lvarayut/relay-fullstack.git
$ cd relay-fullstack

Install all dependencies & Start developing

$ npm install
$ npm start

Launch your favorite web browser and go to http://localhost:3000 for Relay application or http://localhost:8000 for GraphiQL.

Advance

Relay Fullstack is integrated with Yeoman that allows you to choose technologies that suit your needs, the options are including database, flow, and etc.

Install yo and generator-relay-fullstack globally

$ npm install -g yo generator-relay-fullstack

Create a new directory and start the generator, it will prompt some questions to help you get up and running

$ mkdir relay-fullstack && cd $_
$ yo relay-fullstack
$ npm start

Launch your favorite web browser and go to http://localhost:3000 for Relay application or http://localhost:8000 for GraphiQL.

NOTE: generator-relay-fullstack is currently working with minimal functionalities. Database, Flow, and Sub-generator are work-in-progress.

Deployment

Local machine

In order to deploy a project, it is a good practice to minify all JavaScript files, stop spawning the GraphiQL server, pull off some duplicate dependencies, and remove all unnecessary scripts, for example, Hot-reload. All of these can be done by executing the following command:

$ npm run deploy

Again, launch your favorite web browser and go to http://localhost:3000.

Heroku

Before getting started, make sure you already installed the Heroku Toolbelt, which is a command-line tooling for managing Heroku applications that makes it easy to deploy an application in a few steps:

$ heroku create                     # Create a new Heroku application
$ git push heroku master            # Push your code into the created Heroku repository
$ heroku ps:scale web=1             # Run the deployed application

That is it! Now, open the application on your default browser using heroku open.

Schema

Whenever you start a server, it will automatically execute updateSchema.js script in order to compile the schema definitions, defined in schema.js, to schema.json and schema.graphql. This is required by Relay framework. However, you could also run the script manually:

$ npm run update

Project Structure

├── client                          - All of the client side code resides in this folder
│   ├── assets                      - Images and fonts
│   ├── components                  - Relay containers, React components, and SCSS files used in the components
│   │   └── variables.scss          - Common SCSS variables
│   ├── routes                      - React-router-relay 
│   │   ├── Route.js                - All route definitions
│   │   └── ViewerQuery.js          - Entry node of a GraphQL query
│   ├── index.html                  - HTML template file used by html-webpack-plugin 
│   └── index.js                    - Client entry point
├── server                          - All of the server side code resides in this folder
│   ├── config                      - Configuration 
│   │   └── environment             - Separate configuration for each environment
│   │       ├── development.js      - Development configuration
│   │       ├── index.js            - Common configuration used in any environment
│   │       ├── production.js       - Production configuration
│   │       └── test.js             - Test configuration
│   ├── data                        - Data and APIs 
│   │   ├── database.js             - Mock up database which should be replaced with your real database logic
│   │   ├── schema.graphql          - Compiled schema in a readable form
│   │   ├── schema.js               - Schema definitions
│   │   └── schema.json             - Compiled schema to be used by Relay 
│   ├── utils                       - Utilities 
│   │   ├── babelRelayPlugin.js     - Babel-relay-plugin provided by Relay
│   │   └── updateSchema.js         - Code for compiling the defined schema to schema.json and schema.graphql
│   └── index.js                    - Server entry point
├── package.json                    - List of dependencies
├── webpack.config.js               - Webpack configuration

Technologies

Frameworks

Relay - A JavaScript framework for building data-driven react applications. It is required to be used with React and GraphQL.

React - A JavaScript library for building user interfaces. It introduces many great concepts, such as, Virtual DOM, Data flow, etc.

GraphQL - GraphQL is a query language and execution engine tied to any backend service.

Express - Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.

Module bundler & Syntax transformers

Webpack - Webpack is a module bundler that takes modules with dependencies and generates static assets representing those modules.

Babel - Babel is a JavaScript compiler which allows you to use next generation, ES6/ES7, JavaScript, today.

Languages

ES6/ES7 - ECMAScript 6, also known as ECMAScript 2015, is the latest version of the ECMAScript standard. ES6 is a significant update to the language.

JSX - JSX is a JavaScript syntax extension that looks similar to XML. You can use a simple JSX syntactic transform with React.

Designs

Material Design Lite - Material Design Lite lets you add a Material Design look and feel to your websites.

PostCSS - PostCSS is a tool for transforming CSS with JavaScript. It has roughly 200 plugins to help you write CSS easier.

Additional Tools

React transform HMR - A React Transform that enables hot reloading React classes.

React router relay - Relay integration for React Router.

Eslint - The pluggable linting utility for JavaScript and JSX.

Autoprefixer - Parse CSS and add vendor prefixes to rules.

Precss - Use Sass-like markup in your CSS.

Nodemon - Monitor for any changes in your node.js application and automatically restart the server.

CSS Modules - CSS file in which all class names and animation names are scoped locally by default.

Credits

Contributors

lvarayut ncrmro Neitsch maksugr AdamZaczek BlakeBrown
lvarayut ncrmro Neitsch maksugr AdamZaczek BlakeBrown
ianaya89 crucialfelix arnif jtfell kennydee kkostov
ianaya89 crucialfelix arnif jtfell kennydee kkostov
lexun narongdejsrn sankalpk jg123
lexun narongdejsrn sankalpk jg123

License

MIT © Varayut Lerdkanlayanawat

Comments
  • problem with replacing django backend with provided express

    problem with replacing django backend with provided express

    hello i am using relay fullstack as frontend , i have developed the backend in django using graphene and i am serving a graphql endpoint from http://localhost:8000/graphiql here is my error log

    module.js:442
        throw err;
        ^
    
    Error: Cannot find module '/back/schema'
        at Function.Module._resolveFilename (module.js:440:15)
        at Function.Module._load (module.js:388:25)
        at Module.require (module.js:468:17)
        at require (internal/module.js:20:19)
        at Object.<anonymous> (babelRelayPlugin.js:2:14)
        at Module._compile (module.js:541:32)
        at loader (/home/imran/emberredbox/relay-fullstack/node_modules/babel-register/lib/node.js:148:5)
        at Object.require.extensions.(anonymous function) [as .js] (/home/imran/emberredbox/relay-fullstack/node_modules/babel-register/lib/node.js:158:7)
        at Module.load (module.js:458:32)
    
    
    
    
    0 info it worked if it ends with ok
    1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'update' ]
    2 info using [email protected]
    3 info using [email protected]
    4 verbose run-script [ 'preupdate', 'update', 'postupdate' ]
    5 info lifecycle [email protected]~preupdate: [email protected]
    6 silly lifecycle [email protected]~preupdate: no script for preupdate, continuing
    7 info lifecycle [email protected]~update: [email protected]
    8 verbose lifecycle [email protected]~update: unsafe-perm in lifecycle true
    9 verbose lifecycle [email protected]~update: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/imran/emberredbox/relay-fullstack/node_modules/.bin:/usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/imran/emberredbox/relay-fullstack/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    10 verbose lifecycle [email protected]~update: CWD: /home/imran/emberredbox/relay-fullstack
    11 silly lifecycle [email protected]~update: Args: [ '-c', 'babel-node server/utils/updateSchema.js' ]
    12 silly lifecycle [email protected]~update: Returned: code: 1  signal: null
    13 info lifecycle [email protected]~update: Failed to exec update script
    14 verbose stack Error: [email protected] update: `babel-node server/utils/updateSchema.js`
    14 verbose stack Exit status 1
    14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
    14 verbose stack     at emitTwo (events.js:106:13)
    14 verbose stack     at EventEmitter.emit (events.js:191:7)
    14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
    14 verbose stack     at emitTwo (events.js:106:13)
    14 verbose stack     at ChildProcess.emit (events.js:191:7)
    14 verbose stack     at maybeClose (internal/child_process.js:852:16)
    14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
    15 verbose pkgid [email protected]
    16 verbose cwd /home/imran/emberredbox/relay-fullstack
    17 error Linux 4.4.0-34-generic
    18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "update"
    19 error node v6.2.2
    20 error npm  v3.10.6
    21 error code ELIFECYCLE
    22 error [email protected] update: `babel-node server/utils/updateSchema.js`
    22 error Exit status 1
    23 error Failed at the [email protected] update script 'babel-node server/utils/updateSchema.js'.
    23 error Make sure you have the latest version of node.js and npm installed.
    23 error If you do, this is most likely a problem with the relay-fullstack package,
    23 error not with npm itself.
    23 error Tell the author that this fails on your system:
    23 error     babel-node server/utils/updateSchema.js
    23 error You can get information on how to open an issue for this project with:
    23 error     npm bugs relay-fullstack
    23 error Or if that isn't available, you can get their info via:
    23 error     npm owner ls relay-fullstack
    23 error There is likely additional logging output above.
    24 verbose exit [ 1, true ]
    
    question 
    opened by imzautomation 13
  • Relay debugging.

    Relay debugging.

    I'm frequently running into a situation where my application is syntactically correct but it is only rendering a blank screen (due to a Relay error).

    The problem is that there's no indication of where the exact is occurring so it's very difficult to debug.

    What is the best way to solve this issue (aside from rebuilding my app piece by piece until I locate the error since it's very inefficent)?

    opened by Extra-lightwill 9
  • Fresh clone gives error when running `npm start`

    Fresh clone gives error when running `npm start`

    I'm on a Windows 7 Machine and followed the Readme's commands. Node version: 6.9.1

    After npm start I get the following:

    $ npm start

    [email protected] start c:\dev\relay-fullstack nodemon --watch server/data/**/*.js --exec "npm run update && ./node_modules/.bin/babel-node server/index.js"

    [nodemon] 1.11.0 [nodemon] to restart at any time, enter rs [nodemon] watching: server/data/**/*.js [nodemon] starting npm run update && ./node_modules/.bin/babel-node server/index.js

    [email protected] update c:\dev\relay-fullstack babel-node server/utils/updateSchema.js

    Schema has been regenerated '.' is not recognized as an internal or external command, operable program or batch file. [nodemon] app crashed - waiting for file changes before starting...

    opened by Magneticmagnum 9
  • External graphql server?

    External graphql server?

    How could I go about connecting to an external graphql server in production? I can see in the development configuration that I just need to change the proxy to point to the external graphql url, but how would I do it in production? Here's what I have so far:

    index.js
    ...
    if (config.env === 'development') {
      // Launch Relay by using webpack.config.js
      const relayServer = new WebpackDevServer(webpack(webpackConfig), {
        contentBase: '/build/',
        proxy: {
          '/graphql': config.externalUrl
        },
        stats: {
          colors: true
        },
        hot: true,
        historyApiFallback: true
      });
    
      // Serve static resources
      relayServer.use('/', express.static(path.join(__dirname, '../build')));
      relayServer.listen(config.port, () => console.log(chalk.green(`Relay is listening on port ${config.port}`)));
    } else if (config.env === 'production') {
      // Launch Relay by creating a normal express server
      const relayServer = express();
      relayServer.use(historyApiFallback());
      relayServer.use('/', express.static(path.join(__dirname, '../build')));
      relayServer.use('/graphql', graphQLHTTP({ schema }));
      relayServer.listen(config.port, () => console.log(chalk.green(`Relay is listening on port ${config.port}`)));
    }
    
    question 
    opened by Rohit-cheddr 8
  • Added simple generator

    Added simple generator

    So this is my first approach to adding generators. For now I left almost everything untouched and just have generators for client, server and config that copy all files over.

    opened by Neitsch 7
  • Adds circle.yml file for continuous integration

    Adds circle.yml file for continuous integration

    Build and runs the stack then simply curls the server to make sure it's live and sending data.

    @ivarayut you'll need to activate this repo on circle ci for this to take affect.

    You can see it build my fork with this commit here

    opened by ncrmro 7
  • app crashed - waiting for file changes before starting

    app crashed - waiting for file changes before starting

    OS: Windows 10 Pro NPM: 3.9.5

    So I:

    1. git clone https://github.com/lvarayut/relay-fullstack.git
    2. cd relay-fullstack
    3. npm install
    4. npm start

    and am then issued with the following message:

    > [email protected] start C:\Users\Theo\Documents\Visual Studio 2015\Projects\relay-fullstack > nodemon --watch 'server/data/**/*.js' --exec 'npm run update && babel-node server/index.js'

    [nodemon] 1.10.0 [nodemon] to restart at any time, enterrs[nodemon] watching: 'server/data/**/*.js'[nodemon] starting 'npm run update ''npm' is not recognized as an internal or external command, operable program or batch file. [nodemon] app crashed - waiting for file changes before starting...

    What is the issue here?

    question 
    opened by TheoMer 7
  • Consider use of MongoDB, Mongoose

    Consider use of MongoDB, Mongoose

    MongoDB, Mongoose, and Graffiti all work perfectly well when used with GraphQL. the mongoose schema using MongoDB and Mongoose would look like the one I did in the fork.

    discussion 
    opened by keon 7
  • ERROR in   TypeError: Cannot read property 'request' of undefined

    ERROR in TypeError: Cannot read property 'request' of undefined

    when i execute npm install i got errors

    Actual Behavior

    ERROR in TypeError: Cannot read property 'request' of undefined

    • ExternalModuleFactoryPlugin.js:37 handleExternals [pelerelay]/[html-webpack-plugin]/[webpack]/lib/ExternalModuleFactoryPlugin.js:37:33

    • ExternalModuleFactoryPlugin.js:46 next [pelerelay]/[html-webpack-plugin]/[webpack]/lib/ExternalModuleFactoryPlugin.js:46:8

    • ExternalModuleFactoryPlugin.js:59 handleExternals [pelerelay]/[html-webpack-plugin]/[webpack]/lib/ExternalModuleFactoryPlugin.js:59:7

    • ExternalModuleFactoryPlugin.js:79 ExternalModuleFactoryPlugin. [pelerelay]/[html-webpack-plugin]/[webpack]/lib/ExternalModuleFactoryPlugin.js:79:5

    • NormalModuleFactory.js:246 applyPluginsAsyncWaterfall [pelerelay]/[webpack]/lib/NormalModuleFactory.js:246:4

    • Tapable.js:196 NormalModuleFactory.applyPluginsAsyncWaterfall [pelerelay]/[webpack]/[tapable]/lib/Tapable.js:196:70

    • NormalModuleFactory.js:230 NormalModuleFactory.create [pelerelay]/[webpack]/lib/NormalModuleFactory.js:230:8

    • Compilation.js:383 Compilation._addModuleChain [pelerelay]/[webpack]/lib/Compilation.js:383:17

    • Compilation.js:465 Compilation.addEntry [pelerelay]/[webpack]/lib/Compilation.js:465:8

    • SingleEntryPlugin.js:22 SingleEntryPlugin. [pelerelay]/[html-webpack-plugin]/[webpack]/lib/SingleEntryPlugin.js:22:15

    • Tapable.js:229 Compiler.applyPluginsParallel [pelerelay]/[webpack]/[tapable]/lib/Tapable.js:229:14

    • Compiler.js:505 [pelerelay]/[webpack]/lib/Compiler.js:505:8

    • Tapable.js:131 Compiler.applyPluginsAsyncSeries [pelerelay]/[webpack]/[tapable]/lib/Tapable.js:131:46

    • Compiler.js:498 Compiler.compile [pelerelay]/[webpack]/lib/Compiler.js:498:7

    • Compiler.js:284 Compiler.runAsChild [pelerelay]/[webpack]/lib/Compiler.js:284:7

    • compiler.js:70 [pelerelay]/[html-webpack-plugin]/lib/compiler.js:70:19

    opened by webmobiles 6
  • airbnb depends on eslint-plugin-jsx-a11y 1.2.0, 2.1.0 is provided

    airbnb depends on eslint-plugin-jsx-a11y 1.2.0, 2.1.0 is provided

    Hello there,

    first of all, thank you for your project! I really appreciate what you did here!

    But...while trying to install the package as documented, the following error occured:

    258235 error Darwin 14.5.0
    258236 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
    258237 error node v4.5.0
    258238 error npm  v2.15.9
    258239 error code EPEERINVALID
    258240 error peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
    258240 error peerinvalid Peer [email protected] wants [email protected]^1.2.0
    258241 verbose exit [ 1, true ]
    

    I figured that this should be clearly stated in the dependencies when installing the package and thus is an issue directly directed to you.

    Thanks for your support and for making such a great job this far!

    Greetings Tizian

    question 
    opened by CDRO 6
  • Generate Schema from remote server

    Generate Schema from remote server

    I'm recently playing with this relay-fullstack. I wonder if I can make a request to remove server (currently, server and client are running in localhost).

    For example, my server is in http://127.0.0.1:8529/_db/_system/api/graphql (I'm using ArangoDB for the backend). I've read Relay's documentation which says that I can achieve it with the following:

    Relay.injectNetworkLayer( new Relay.DefaultNetworkLayer('http://127.0.0.1:8529/_db/_system/api/graphql', { fetchTimeout: 30000, // Timeout after 30s. retryDelays: [5000], // Only retry once after a 5s delay. }) );

    Everything should be fine. But every time I run the app, there's always an error that demands me to update the schema. In my case:

    Uncaught Error: GraphQL validation error``Cannot query field "human" on type "User".``in fileC:/xampp/htdocs/relay-starwars/client/components/Feature/FeatureContainer.js. Try updating your GraphQL schema if an argument/field/type was recently added.

    How do I solve this? Is it possible to generate/update the schema from a remote server? I'm sure that the backend is already settled and running fine.. *checked with GraphiQL and Postman

    Any thoughts?

    question 
    opened by agungsb 6
  • Heroku Build getting failed

    Heroku Build getting failed

    I have cloned the repo and linked with Heroku, But I'm getting the build error, Can someone help me on this? @crucialfelix @claym @jg123 @arnif @sankalpk

    -----> Node.js app detected

    -----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false
    

    -----> Installing binaries engines.node (package.json): >=6.6.0 engines.npm (package.json): >=3.10.8 engines.yarn (package.json): unspecified (use default)

       Resolving node version >=6.6.0...
       Downloading and installing node 12.7.0...
       Bootstrapping npm >=3.10.8 (replacing 6.10.0)...
       npm >=3.10.8 installed
       Resolving yarn version 1.x...
       Downloading and installing yarn (1.17.3)...
       Installed yarn 1.17.3
    

    -----> Installing dependencies Installing node modules (yarn.lock) yarn install v1.17.3 [1/4] Resolving packages... [2/4] Fetching packages... info [email protected]: The platform "linux" is incompatible with this module. info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning " > [email protected]" has incorrect peer dependency "[email protected] || ^15.0.0-rc". warning " > [email protected]" has incorrect peer dependency "[email protected] || ^15.0.0-rc". warning "react-relay > [email protected]" has incorrect peer dependency "[email protected]". warning "react-router-relay > [email protected]" has incorrect peer dependency "[email protected]^0.13.0 || ^0.14.0 || ^15.0.0". [4/4] Building fresh packages... Done in 47.99s.

    -----> Build Running heroku-postbuild (yarn) yarn run v1.17.3 $ cross-env NODE_ENV=production webpack --config webpack.config.js && cross-env NODE_ENV=production ./node_modules/.bin/babel ./server --out-dir ./lib Hash: b19942a7fb58fe42f49c Version: webpack 3.8.1 Time: 28009ms Asset Size Chunks Chunk Names icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-57x57.png 4.88 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-72x72.png 6.73 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-60x60.png 5.22 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-120x120.png 12.5 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-152x152.png 16.6 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-144x144.png 15.6 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-167x167.png 18.5 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-180x180.png 20.4 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-114x114.png 11.9 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-precomposed.png 20.4 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-76x76.png 7.11 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-icon.png 20.4 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/android-chrome-48x48.png 4.2 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/android-chrome-36x36.png 2.78 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/android-chrome-72x72.png 7.4 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/android-chrome-96x96.png 10.5 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/android-chrome-144x144.png 17.1 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/android-chrome-192x192.png 23.8 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/android-chrome-256x256.png 33.4 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/android-chrome-384x384.png 55.8 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/android-chrome-512x512.png 83.6 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/favicon-16x16.png 801 bytes [emitted]
    icons-cc4a24232900b36655174d837376d93c/favicon-32x32.png 2.3 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/favicon-96x96.png 10.5 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/favicon-230x230.png 29.7 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/favicon.ico 33.3 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-320x460.png 42 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-640x920.png 113 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-640x1096.png 114 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-768x1004.png 148 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-750x1294.png 145 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-748x1024.png 135 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-1182x2208.png 206 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-1242x2148.png 313 kB [emitted] [big]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-1496x2048.png 389 kB [emitted] [big]
    icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-1536x2008.png 428 kB [emitted] [big]
    icons-cc4a24232900b36655174d837376d93c/firefox_app_60x60.png 6.63 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/firefox_app_128x128.png 17.6 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/firefox_app_512x512.png 99.1 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/manifest.json 1.22 kB [emitted]
    icons-cc4a24232900b36655174d837376d93c/manifest.webapp 258 bytes [emitted]
    icons-cc4a24232900b36655174d837376d93c/.cache 7.49 kB [emitted]
    assets/d206d2e2f1fdb8e4d9d7413d694a5e3b.png 38.7 kB [emitted]
    assets/5e61d42f90dec92bff7469af6cfa9d0d.png 274 kB [emitted] [big]
    assets/9fe7584b6d29bec74a66024829929697.png 16.4 kB [emitted]
    assets/b8e28b87360ea89a0a480e0f3c6f7dbd.png 23.5 kB [emitted]
    assets/05d6144b469f642bbdb658d00ac86ca4.png 31.6 kB [emitted]
    assets/51639fae709b54583375e29c5b37cd35.png 3.42 kB [emitted]
    assets/cc4a24232900b36655174d837376d93c.png 57 kB [emitted]
    assets/ceb93e626a615170db0bdcafecdfa2bb.png 5.53 kB [emitted]
    assets/52babf49fcfc71790b5dd4dfce8d69fb.png 11.5 kB [emitted]
    assets/c7cf5a9ec08c90b691ec092ee8839c4a.png 54.5 kB [emitted]
    assets/37fe8322b169ddbdeabf75930e886ac6.png 49 kB [emitted]
    assets/92bf77d3b4b73653b20eae7b4ee7dccc.png 25.9 kB [emitted]
    assets/4ddcd5c7b92b7d8071d31305e857c15d.png 54.7 kB [emitted]
    app.js 268 kB 0 [emitted] [big] app vendor.js 666 kB 1 [emitted] [big] vendor index.html 4.91 kB [emitted]
    [43] (webpack)/buildin/global.js 488 bytes {1} [built] [208] (webpack)/buildin/module.js 495 bytes {1} [built] [318] ./client/assets/yeoman.png 89 bytes {0} [built] [319] multi ./client/index.js 28 bytes {0} [built] [320] ./client/index.js 944 bytes {0} [built] [335] ./client/root.js 931 bytes {0} [built] [606] ./client/routes/Route.js 1.54 kB {0} [built] [607] ./client/routes/ViewerQuery.js 819 bytes {0} [built] [687] ./client/assets ^./.*.png$ 373 bytes {0} [built] [688] ./client/assets/babel.png 89 bytes {0} [optional] [built] [689] ./client/assets/css.png 89 bytes {0} [optional] [built] [690] ./client/assets/express.png 89 bytes {0} [optional] [built] [691] ./client/assets/graphql.png 89 bytes {0} [optional] [built] [692] ./client/assets/html5.png 89 bytes {0} [optional] [built] [702] multi react react-dom react-mdl react-relay react-router react-router-relay 88 bytes {1} [built] + 690 hidden modules

       ERROR in ./client/components/Feature/AddFeatureMutation.js
       Module not found: Error: Can't resolve './__generated__/AddFeatureMutation.graphql' in '/tmp/build_499e01a560b17122c64193c77e94e4e4/client/components/Feature'
        @ ./client/components/Feature/AddFeatureMutation.js 11:11-64
        @ ./client/components/Feature/AddFeatureComponent.js
        @ ./client/components/Feature/FeatureComponent.js
        @ ./client/components/Feature/FeatureContainer.js
        @ ./client/routes/Route.js
        @ ./client/root.js
        @ ./client/index.js
        @ multi ./client/index.js
       
       ERROR in ./client/components/App/AppContainer.js
       Module not found: Error: Can't resolve './__generated__/AppContainer_viewer.graphql' in '/tmp/build_499e01a560b17122c64193c77e94e4e4/client/components/App'
        @ ./client/components/App/AppContainer.js 22:13-67
        @ ./client/routes/Route.js
        @ ./client/root.js
        @ ./client/index.js
        @ multi ./client/index.js
       
       ERROR in ./client/components/Feature/FeatureContainer.js
       Module not found: Error: Can't resolve './__generated__/FeatureContainer_viewer.graphql' in '/tmp/build_499e01a560b17122c64193c77e94e4e4/client/components/Feature'
        @ ./client/components/Feature/FeatureContainer.js 18:13-71
        @ ./client/routes/Route.js
        @ ./client/root.js
        @ ./client/index.js
        @ multi ./client/index.js
       
       ERROR in ./client/components/Footer/FooterContainer.js
       Module not found: Error: Can't resolve './__generated__/FooterContainer_viewer.graphql' in '/tmp/build_499e01a560b17122c64193c77e94e4e4/client/components/Footer'
        @ ./client/components/Footer/FooterContainer.js 18:13-70
        @ ./client/components/App/AppContainer.js
        @ ./client/routes/Route.js
        @ ./client/root.js
        @ ./client/index.js
        @ multi ./client/index.js
       Child html-webpack-plugin for "index.html":
            1 asset
              [0] ./node_modules/html-webpack-plugin/lib/loader.js!./client/index.html 4.63 kB {0} [built]
              [2] (webpack)/buildin/global.js 488 bytes {0} [built]
              [3] (webpack)/buildin/module.js 495 bytes {0} [built]
               + 1 hidden module
       Child favicons-webpack-plugin for "iconstats-[hash].json":
                                                                                    Asset       Size  Chunks                    Chunk Names
                        icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-57x57.png    4.88 kB          [emitted]         
                        icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-72x72.png    6.73 kB          [emitted]         
                        icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-60x60.png    5.22 kB          [emitted]         
                      icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-120x120.png    12.5 kB          [emitted]         
                      icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-152x152.png    16.6 kB          [emitted]         
                      icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-144x144.png    15.6 kB          [emitted]         
                      icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-167x167.png    18.5 kB          [emitted]         
                      icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-180x180.png    20.4 kB          [emitted]         
                      icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-114x114.png    11.9 kB          [emitted]         
                  icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-precomposed.png    20.4 kB          [emitted]         
                        icons-cc4a24232900b36655174d837376d93c/apple-touch-icon-76x76.png    7.11 kB          [emitted]         
                              icons-cc4a24232900b36655174d837376d93c/apple-touch-icon.png    20.4 kB          [emitted]         
                          icons-cc4a24232900b36655174d837376d93c/android-chrome-48x48.png     4.2 kB          [emitted]         
                          icons-cc4a24232900b36655174d837376d93c/android-chrome-36x36.png    2.78 kB          [emitted]         
                          icons-cc4a24232900b36655174d837376d93c/android-chrome-72x72.png     7.4 kB          [emitted]         
                          icons-cc4a24232900b36655174d837376d93c/android-chrome-96x96.png    10.5 kB          [emitted]         
                        icons-cc4a24232900b36655174d837376d93c/android-chrome-144x144.png    17.1 kB          [emitted]         
                        icons-cc4a24232900b36655174d837376d93c/android-chrome-192x192.png    23.8 kB          [emitted]         
                        icons-cc4a24232900b36655174d837376d93c/android-chrome-256x256.png    33.4 kB          [emitted]         
                        icons-cc4a24232900b36655174d837376d93c/android-chrome-384x384.png    55.8 kB          [emitted]         
                        icons-cc4a24232900b36655174d837376d93c/android-chrome-512x512.png    83.6 kB          [emitted]         
                                 icons-cc4a24232900b36655174d837376d93c/favicon-16x16.png  801 bytes          [emitted]         
                                 icons-cc4a24232900b36655174d837376d93c/favicon-32x32.png     2.3 kB          [emitted]         
                                 icons-cc4a24232900b36655174d837376d93c/favicon-96x96.png    10.5 kB          [emitted]         
                               icons-cc4a24232900b36655174d837376d93c/favicon-230x230.png    29.7 kB          [emitted]         
                                       icons-cc4a24232900b36655174d837376d93c/favicon.ico    33.3 kB          [emitted]         
             icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-320x460.png      42 kB          [emitted]         
             icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-640x920.png     113 kB          [emitted]         
            icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-640x1096.png     114 kB          [emitted]         
            icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-768x1004.png     148 kB          [emitted]         
            icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-750x1294.png     145 kB          [emitted]         
            icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-748x1024.png     135 kB          [emitted]         
           icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-1182x2208.png     206 kB          [emitted]         
           icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-1242x2148.png     313 kB          [emitted]  [big]  
           icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-1496x2048.png     389 kB          [emitted]  [big]  
           icons-cc4a24232900b36655174d837376d93c/apple-touch-startup-image-1536x2008.png     428 kB          [emitted]  [big]  
                             icons-cc4a24232900b36655174d837376d93c/firefox_app_60x60.png    6.63 kB          [emitted]         
                           icons-cc4a24232900b36655174d837376d93c/firefox_app_128x128.png    17.6 kB          [emitted]         
                           icons-cc4a24232900b36655174d837376d93c/firefox_app_512x512.png    99.1 kB          [emitted]         
                                     icons-cc4a24232900b36655174d837376d93c/manifest.json    1.22 kB          [emitted]         
                                   icons-cc4a24232900b36655174d837376d93c/manifest.webapp  258 bytes          [emitted]         
                                            icons-cc4a24232900b36655174d837376d93c/.cache    7.49 kB          [emitted]         
            + 1 hidden asset
              [0] ./node_modules/favicons-webpack-plugin/lib/favicons.js?{"outputFilePrefix":"icons-[hash]/","icons":{"android":true,"appleIcon":true,"appleStartup":true,"coast":false,"favicons":true,"firefox":true,"opengraph":false,"twitter":false,"yandex":false,"windows":false},"background":"#fff","persistentCache":true,"appName":"relay-fullstack"}!./client/assets/logo.png 7.38 kB {0} [built]
    

    error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. -----> Build failed

       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys
       
       Some possible problems:
       
       - Dangerous semver range (>) in engines.node
         https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
       
       Love,
       Heroku
    

    ! Push rejected, failed to compile Node.js app. ! Push failed

    opened by stenalpjolly 0
  • Added i18n

    Added i18n

    I added a i18n library (react-i18next) and created the base structure to make the internationalization. I also updated almost all the texts to the new i18n pattern and translated the file to Brazilian Portuguese. I also added i18n as a feature of the boilerplate.

    opened by caioflores 2
  • Testing and CI

    Testing and CI

    At the moment I have a project that whenever the repo get's pushed to has circle ci

    • build the project
    • tests graphql end point query works
    • uses selenium to
      • navigate to a few pages to make sure they load
      • test form validation errors such as sign up form
      • takes a picture which circle ci stores

    I'd like to add some of this testing to this project. I'm thinking the first pull request would simply be to get the project to build on ci.

    Then go from there.

    Browser Testing

    • mocha
    • Selenium

    Unit Testing

    • Jest

    CI Contentious Integration

    • circle ci
    enhancement 
    opened by ncrmro 4
  • [FEATURE] webpack.config.js for server-side rendering

    [FEATURE] webpack.config.js for server-side rendering

    Hello!

    First of all, I'd like to thank you for this awesome work! This really got us kickstarted quite well and we'll be able to work with this as a solid base for our React projects! It's awesome!

    Still, I found one major concern with the current state of the project and it's mainly SEO.

    So, with webpack it is possible to render the HTML staticaly (https://github.com/webpack/react-webpack-server-side-example) but I haven't figured out how to configure my relay-fullstack instance to do that, at all.

    Here's my webpack.config.js, maybe you can tell me what is wrong or maybe suggest a way to do it properly?

    Regards Tizian

    webpack.config.js: 'use strict';

    const path = require('path');
    const webpack = require('webpack');
    const autoprefixer = require('autoprefixer');
    const precss = require('precss');
    const HtmlWebpackPlugin = require('html-webpack-plugin');
    const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
    
    let appEntry;
    let devtool;
    let plugins;
    
    if (process.env.NODE_ENV === 'production') {
      appEntry = [path.join(__dirname, 'client/index.js')];
      devtool = 'source-map';
      plugins = [
        new webpack.optimize.DedupePlugin(),
        new webpack.optimize.OccurrenceOrderPlugin(),
        new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
        new webpack.DefinePlugin({
          'process.env': {
            NODE_ENV: JSON.stringify('production')
          }
        }),
        new webpack.optimize.UglifyJsPlugin({
          compress: {
            warnings: false,
            screw_ie8: true
          }
        }),
        new HtmlWebpackPlugin({
          title: 'Relay Starter Kit - Integrated with Relay, GraphQL, Express, ES6/ES7, JSX, Webpack, Babel, Material Design Lite, and PostCSS',
          template: './client/index.html',
          mobile: true,
          inject: false
        }),
        new FaviconsWebpackPlugin('./client/assets/logo.png')
      ];
    } else {
      appEntry = [
        path.join(__dirname, 'client/index.js'),
        'webpack-dev-server/client?http://localhost:3000',
        'webpack/hot/only-dev-server'
      ];
      devtool = 'eval';
      plugins = [
        new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
        new webpack.NoErrorsPlugin(),
        new webpack.HotModuleReplacementPlugin(),
        new webpack.DefinePlugin({
          __DEV__: true
        }),
        new HtmlWebpackPlugin({
          title: 'Relay Starter Kit - Integrated with Relay, GraphQL, Express, ES6/ES7, JSX, Webpack, Babel, Material Design Lite, and PostCSS',
          template: './client/index.html',
          mobile: true,
          inject: false
        }),
        new FaviconsWebpackPlugin('./client/assets/logo.png')
      ];
    }
    
    
    var commonLoaders = [
        { test: /\.js$/, loader: 'babel-loader', },
        { test: /\.png$/, loader: "url-loader" },
        { test: /\.jpg$/, loader: "file-loader" },
    ];
    
    var assetsPath = path.join(__dirname, "public", "assets");
    var publicPath = "assets/";
    
    module.exports = [
        {
            // The configuration for the server-side rendering
            name: "server-side rendering",
            entry: "./server/page.js",
            target: "node",
            output: {
                path: assetsPath,
                filename: "../../server/page.generated.js",
                publicPath: publicPath,
                libraryTarget: "commonjs2"
            },
            resolve: {
                extensions: ['', '.jsx', '.js']
            },
            externals: /^[a-z\-0-9]+$/,
            module: {
                loaders:[
                    { test: /\.jsx?$/, loader: "babel-loader", query: { presets: ['react', 'es2015'] } },
                    { test: /\.jpe?g$|\.png$|\.gif$/, loader: "file-loader" }
                ]
            }
        }
    ];
    
    /*
    module.exports = {
      entry: {
        app: appEntry,
        vendor: ['react', 'react-dom', 'react-mdl', 'react-relay', 'react-router', 'react-router-relay']
      },
      output: {
        path: path.join(__dirname, 'build'),
        publicPath: '/',
        filename: '[name].js'
      },
      devtool,
      module: {
        loaders: [{
          test: /\.jsx?$/,
          loader: 'babel-loader',
          exclude: /node_modules/
        }, {
          test: /\.css$/,
          loaders: ['style', 'css']
        }, {
          test: /\.scss$/,
          loaders: [
            'style',
            'css?modules&importLoaders=1' +
              '&localIdentName=[name]__[local]___[hash:base64:5]!postcss'
          ]
        }, {
          test: /\.(png|jpg|jpeg|gif|svg|woff|woff2|eot|ttf)(\?\S*)?$/,
          loader: 'url-loader?limit=10000&name=assets/[hash].[ext]'
          //loader: 'file'
        }
        //,{test: /test woff/, loader}
        ]
      },
      postcss: () => [precss, autoprefixer],
      plugins
    };
    */
    
    help wanted question 
    opened by CDRO 2
  • Roadmap

    Roadmap

    Update: We stop supporting Yeoman for now, until we can find a good way to maintain it in our project, see more details https://github.com/lvarayut/relay-fullstack/issues/72.

    Here is all the features planned to be developed. I list them out in order to make it easy for everybody to discuss and participate in the project. These features could be changed as needed, so don't hesitate to express your ideas. If you wanted to help developing some features, which would be very appreciated, please leave a comment below.

    • [x] Example on Heroku @lvarayut
    • [x] Official website (gh-pages) @lvarayut
    • [x] Yeoman generator @lvarayut
    • [x] Integrate css-modules @lexun
    • [x] Mutation example @zenyai
    • [x] Flow* @Neitsch
    • [x] Data loader* @Neitsch
    • [ ] Database integration* (MongoDB, MySQL, Postgres, and Cassandra)
    • [ ] Yeoman sub-generators (Component, Container, Query, Mutation)*
    • [ ] Testing framework (which one do you prefer: Jest, Mocha, Jasmine, Ava?) @lvarayut
    • [ ] Server Side Rendering
    • [ ] JSON Web Tokens* (Implement* Signup and Login pages) - This will be developed after Database integration
    • [ ] Browsersync

    *must be developed in canary branch.

    enhancement help wanted discussion 
    opened by lvarayut 35
Releases(v1.2.0)
Owner
Varayut Lerdkanlayanawat
🎈👨🏻‍💻 Software Development Engineer at Amazon
Varayut Lerdkanlayanawat
A frontend Framework for building B2B applications running in the browser on top of REST/GraphQL APIs, using ES6, React and Material Design

react-admin A frontend Framework for building data-driven applications running in the browser on top of REST/GraphQL APIs, using ES6, React and Materi

marmelab 21.3k Jan 6, 2023
Large SPA boilerplate use react redux webpack babel es6 express browsync nodemon...

React-workflow Why Large SPA application is hard to design, because a lot of things need to consider The boilerplate had solved the difficulty for

云霜儿 66 Mar 27, 2021
Large SPA boilerplate use react redux webpack babel es6 express browsync nodemon...

React-workflow Why Large SPA application is hard to design, because a lot of things need to consider The boilerplate had solved the difficulty for

云霜儿 66 Mar 27, 2021
React + Redux starter kit / boilerplate with Babel, hot reloading, testing, linting and a working example app built in

A comprehensive starter kit for rapid application development using React. Why Slingshot? One command to get started - Type npm start to start develop

Cory House 9.8k Dec 22, 2022
A universal Javascript starter kit inc. React, Redux, Redux Dev Tools, Universal Redux Router, CSS Modules, hot module reloading, Babel for ES2015+ and ESLint

UniversalJS A universal Javascript starter kit inc. React, Redux, Redux Dev Tools, Universal Redux Router, CSS Modules, hot module reloading, Babel fo

Colin Meinke 65 Oct 13, 2022
demo with react,ant-design,redux,react-router,webpack,babel

star-initReact-example A demo with star-initReact-example ##效果截图 首页 列表页 弹框 表格组件 echart 使用技术和实现功能 webpack + React +React-router + React-redux +ES6 + an

对影三人 76 Apr 15, 2022
dApp Starter Kit is flexible production grade Web3 boilerplate with Next.js, React, Material Design and Typescript

dApp Starter Kit is flexible production grade Web3 boilerplate with Next.js 12, React.js, Material-UI, Typescript and web3-react (beta).

ETH Salt Lake 8 Nov 1, 2022
Full Stack boilerplate with JWT Authentication - Built with React, Typescript, Node, Express, GraphQL, PostgreSQL, Redis, and Webpack

Full Stack boilerplate with JWT Authentication - Built with React, Typescript, Node, Express, GraphQL, PostgreSQL, Redis, and Webpack

Scott Jason 7 Sep 21, 2022
Free-from-jsx.macro - Babel macro that allows you to use a flutter like render syntax

Free-from-jsx.macro - Babel macro that allows you to use a flutter like render syntax

Gabriel Rohden 3 Jul 7, 2022
Ts-next-chakra-motion-kit - Starter kit with Next.js, Chakra-UI, Framer-Motion in Typescript

Typescript Next.js Chakra-UI Framer-Motion Starter Kit Start with a powerful tem

Alexandre Gossard 39 Oct 14, 2022
A complete set up of the React application with Typescript, Webpack 5, Babel v7, SSR, Code Splitting and HMR.

A complete set up of the React application with Typescript, Webpack 5, Babel v7, SSR, Code Splitting and HMR.

null 24 Dec 22, 2022
Starting project with react from scratch using webpack and babel

React Part 2 Meliuz Iniciando projeto com react do zero usando webpack e babel. O que é? (Onde vivem? O que comem?) webpack (com “w” minúsculo, respei

Douglas Morais 4 Oct 30, 2021
A boilerplate for a Redux-React 'Cordova' application because react native is too new to use in prod. It also has Babel, Webpack and Gulp

react-redux-cordova-boilerplate A boilerplate for a Redux-React Cordova application using Babel, Webpack and Gulp Development Run npm install Run npm

Inderpal Singh 19 Oct 11, 2022
Minimal Electron boilerplate built with Typescript, Webpack 5 and Babel 7

electron-webpack-boilerplate Minimal Electron Starter Kit built with Typescript, React, Webpack 5 and Babel 7 To create a JS library, check out js-lib

Francisco Hodge 10 Aug 16, 2022
Nextacular 19 Dec 1, 2022
GraphQL first full-stack starter kit with Node, React. Powered by TypeScript

GraphQL first full-stack starter kit with Node, React. Powered by TypeScript

Karan Pratap Singh 1.1k Dec 15, 2022
A Demo SPA developed with React, ES6, Webpack (2.x), and Antd (1.0.1) 【move to react-seed】

Target 使用React技术栈开发SPA. Tech Stack UI库:React & React-Dom UI组件:Antd 路由:React-Router & History 框架:Reflux JS:ES6 样式:Less 图标:Antd自带/FontAwesome 动画:Animate

Jason Bai 515 Dec 1, 2022
A starter boilerplate for a universal webapp using express, react, redux, webpack, and react-transform

React Redux Universal Hot Example About This is a starter boilerplate app I've put together using the following technologies: Isomorphic Universal ren

Erik Rasmussen 12.1k Jan 5, 2023
React-jsx-classnames - React JSX runtime for adding a classNames or clsx prop

@tpdewolf/react-jsx-classnames JSX runtime for adding a classNames or clsx prop.

Tim de Wolf 2 Jan 15, 2022