├── .gitignore ├── .meteor ├── .gitignore ├── release ├── platforms ├── .id ├── .finished-upgraders ├── packages └── versions ├── renovate.json ├── client ├── src │ ├── index.css │ ├── App.test.js │ ├── app.css │ ├── index.js │ ├── app.js │ └── registerServiceWorker.js └── public │ ├── favicon.ico │ ├── manifest.json │ └── index.html ├── server └── main.js ├── package.json └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@1.6 2 | -------------------------------------------------------------------------------- /.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /client/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /client/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexsicart/Create-React-Meteor-App/HEAD/client/public/favicon.ico -------------------------------------------------------------------------------- /server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | 3 | Meteor.startup(() => { 4 | // code to run on server at startup 5 | }); 6 | -------------------------------------------------------------------------------- /client/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | }); 9 | -------------------------------------------------------------------------------- /.meteor/.id: -------------------------------------------------------------------------------- 1 | # This file contains a token that is unique to your project. 2 | # Check it into your repository along with the rest of this directory. 3 | # It can be used for purposes such as: 4 | # - ensuring you don't accidentally deploy one app on top of another 5 | # - providing package authors with aggregated statistics 6 | 7 | 1t88q1v5i6ghw148zgrs 8 | -------------------------------------------------------------------------------- /client/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-react-meteor-app", 3 | "description": "Create React-Meteor apps with no build configuration.", 4 | "version": "0.0.1", 5 | "scripts": { 6 | "start": "meteor run" 7 | }, 8 | "dependencies": { 9 | "babel-runtime": "6.26.0", 10 | "core-js": "2.5.7", 11 | "meteor-node-stubs": "0.4.1", 12 | "react": "15.6.2", 13 | "react-dom": "15.6.2" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /client/src/app.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | animation: App-logo-spin infinite 20s linear; 7 | height: 80px; 8 | } 9 | 10 | .App-header { 11 | background-color: #222; 12 | height: 150px; 13 | padding: 20px; 14 | color: white; 15 | } 16 | 17 | .App-intro { 18 | font-size: large; 19 | } 20 | 21 | @keyframes App-logo-spin { 22 | from { transform: rotate(0deg); } 23 | to { transform: rotate(360deg); } 24 | } 25 | -------------------------------------------------------------------------------- /client/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './app.js'; 5 | import registerServiceWorker from './registerServiceWorker'; 6 | 7 | const Index = () => { 8 | return ( 9 |
10 | 11 |
12 | ) 13 | } 14 | 15 | Meteor.startup(() => { 16 | ReactDOM.render(, document.querySelector('.container')); 17 | registerServiceWorker(); 18 | }); 19 | -------------------------------------------------------------------------------- /.meteor/.finished-upgraders: -------------------------------------------------------------------------------- 1 | # This file contains information which helps Meteor properly upgrade your 2 | # app when you run 'meteor update'. You should check it into version control 3 | # with your project. 4 | 5 | notices-for-0.9.0 6 | notices-for-0.9.1 7 | 0.9.4-platform-file 8 | notices-for-facebook-graph-api-2 9 | 1.2.0-standard-minifiers-package 10 | 1.2.0-meteor-platform-split 11 | 1.2.0-cordova-changes 12 | 1.2.0-breaking-changes 13 | 1.3.0-split-minifiers-package 14 | 1.4.0-remove-old-dev-bundle-link 15 | 1.4.1-add-shell-server-package 16 | 1.4.3-split-account-service-packages 17 | 1.5-add-dynamic-import-package 18 | -------------------------------------------------------------------------------- /client/src/app.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import './app.css'; 3 | 4 | class app extends Component { 5 | render() { 6 | return ( 7 |
8 |
9 | logo 10 | logo 11 |

Welcome to React-Meteor

12 |
13 |

14 | To get started, edit src/App.js and save to reload. 15 |

16 |
17 | ); 18 | } 19 | } 20 | 21 | export default app; 22 | -------------------------------------------------------------------------------- /.meteor/packages: -------------------------------------------------------------------------------- 1 | # Meteor packages used by this project, one per line. 2 | # Check this file (and the other files in this directory) into your repository. 3 | # 4 | # 'meteor add' and 'meteor remove' will edit this file for you, 5 | # but you can also edit it by hand. 6 | 7 | meteor-base@1.2.0 # Packages every Meteor app needs to have 8 | mobile-experience@1.0.5 # Packages for a great mobile UX 9 | mongo@1.3.0 # The database Meteor supports right now 10 | blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views 11 | reactive-var@1.0.11 # Reactive variable for tracker 12 | tracker@1.1.3 # Meteor's client-side reactive programming library 13 | 14 | standard-minifier-css@1.3.5 # CSS minifier run for production mode 15 | standard-minifier-js@2.2.0 # JS minifier run for production mode 16 | es5-shim@4.6.15 # ECMAScript 5 compatibility for older browsers 17 | ecmascript@0.9.0 # Enable ECMAScript2015+ syntax in app code 18 | shell-server@0.3.0 # Server-side component of the `meteor shell` command 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Create-React-Meteor-App 2 | ## Meteor + React for fast prototyping. 3 | 4 | ![img](https://cdn-images-1.medium.com/max/1184/1*-KyRdRGJA-Esr1W8taQoNg.png) 5 | 6 | Full-Stack Web Development is the most popular developer occupation today. There are many ways to create a fullstack web application. 7 | 8 | **React**, is a Javascript library for building user interfaces. 9 | 10 | **Meteor**, is a free and open-source isomorphic JavaScript web framework written using Node.js. 11 | 12 | ## Installation 13 | 14 | git clone git@github.com:alexsicart/Create-React-Meteor-App.git 15 | cd Create-React-Meteor-App 16 | npm i 17 | meteor 18 | 19 | ## Tech Stack 20 | 21 | The skeleton app has been created using 22 | - Meteor 23 | - React 24 | 25 | 26 | ## Contributors 27 | 28 | We love pull requests from everyone. By participating in this project, you agree to abide by the thoughtbot 29 | [code of conduct]: https://thoughtbot.com/open-source-code-of-conduct 30 | 31 | Fork, then clone the repo: 32 | Push to your fork and [submit a pull request]. 33 | 34 | 35 | ## License 36 | 37 | `Create-React-Meteor-App` is licensed under the [MIT](http://www.opensource.org/licenses/mit-license.php) license. 38 | -------------------------------------------------------------------------------- /.meteor/versions: -------------------------------------------------------------------------------- 1 | allow-deny@1.1.0 2 | autoupdate@1.3.12 3 | babel-compiler@6.24.7 4 | babel-runtime@1.1.1 5 | base64@1.0.10 6 | binary-heap@1.0.10 7 | blaze@2.3.2 8 | blaze-html-templates@1.1.2 9 | blaze-tools@1.0.10 10 | boilerplate-generator@1.3.0 11 | caching-compiler@1.1.9 12 | caching-html-compiler@1.1.2 13 | callback-hook@1.0.10 14 | check@1.2.5 15 | ddp@1.4.0 16 | ddp-client@2.2.0 17 | ddp-common@1.3.0 18 | ddp-server@2.1.0 19 | deps@1.0.12 20 | diff-sequence@1.0.7 21 | dynamic-import@0.2.0 22 | ecmascript@0.9.0 23 | ecmascript-runtime@0.5.0 24 | ecmascript-runtime-client@0.5.0 25 | ecmascript-runtime-server@0.5.0 26 | ejson@1.1.0 27 | es5-shim@4.6.15 28 | geojson-utils@1.0.10 29 | hot-code-push@1.0.4 30 | html-tools@1.0.11 31 | htmljs@1.0.11 32 | http@1.3.0 33 | id-map@1.0.9 34 | jquery@1.11.10 35 | launch-screen@1.1.1 36 | livedata@1.0.18 37 | logging@1.1.19 38 | meteor@1.8.0 39 | meteor-base@1.2.0 40 | minifier-css@1.2.16 41 | minifier-js@2.2.1 42 | minimongo@1.4.0 43 | mobile-experience@1.0.5 44 | mobile-status-bar@1.0.14 45 | modules@0.11.0 46 | modules-runtime@0.9.0 47 | mongo@1.3.0 48 | mongo-dev-server@1.1.0 49 | mongo-id@1.0.6 50 | npm-mongo@2.2.33 51 | observe-sequence@1.0.16 52 | ordered-dict@1.0.9 53 | promise@0.10.0 54 | random@1.0.10 55 | reactive-var@1.0.11 56 | reload@1.1.11 57 | retry@1.0.9 58 | routepolicy@1.0.12 59 | shell-server@0.3.0 60 | spacebars@1.0.15 61 | spacebars-compiler@1.1.3 62 | standard-minifier-css@1.3.5 63 | standard-minifier-js@2.2.1 64 | templating@1.3.2 65 | templating-compiler@1.3.3 66 | templating-runtime@1.3.2 67 | templating-tools@1.1.2 68 | tracker@1.1.3 69 | ui@1.0.13 70 | underscore@1.0.10 71 | url@1.1.0 72 | webapp@1.4.0 73 | webapp-hashing@1.0.9 74 | -------------------------------------------------------------------------------- /client/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 20 | React-Meteor App 21 | 22 | 23 | 26 |
27 | 37 | 38 | -------------------------------------------------------------------------------- /client/src/registerServiceWorker.js: -------------------------------------------------------------------------------- 1 | // In production, we register a service worker to serve assets from local cache. 2 | 3 | // This lets the app load faster on subsequent visits in production, and gives 4 | // it offline capabilities. However, it also means that developers (and users) 5 | // will only see deployed updates on the "N+1" visit to a page, since previously 6 | // cached resources are updated in the background. 7 | 8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy. 9 | // This link also includes instructions on opting out of this behavior. 10 | 11 | const isLocalhost = Boolean( 12 | window.location.hostname === 'localhost' || 13 | // [::1] is the IPv6 localhost address. 14 | window.location.hostname === '[::1]' || 15 | // 127.0.0.1/8 is considered localhost for IPv4. 16 | window.location.hostname.match( 17 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ 18 | ) 19 | ); 20 | 21 | export default function register() { 22 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { 23 | // The URL constructor is available in all browsers that support SW. 24 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location); 25 | if (publicUrl.origin !== window.location.origin) { 26 | // Our service worker won't work if PUBLIC_URL is on a different origin 27 | // from what our page is served on. This might happen if a CDN is used to 28 | // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374 29 | return; 30 | } 31 | 32 | window.addEventListener('load', () => { 33 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; 34 | 35 | if (!isLocalhost) { 36 | // Is not local host. Just register service worker 37 | registerValidSW(swUrl); 38 | } else { 39 | // This is running on localhost. Lets check if a service worker still exists or not. 40 | checkValidServiceWorker(swUrl); 41 | } 42 | }); 43 | } 44 | } 45 | 46 | function registerValidSW(swUrl) { 47 | navigator.serviceWorker 48 | .register(swUrl) 49 | .then(registration => { 50 | registration.onupdatefound = () => { 51 | const installingWorker = registration.installing; 52 | installingWorker.onstatechange = () => { 53 | if (installingWorker.state === 'installed') { 54 | if (navigator.serviceWorker.controller) { 55 | // At this point, the old content will have been purged and 56 | // the fresh content will have been added to the cache. 57 | // It's the perfect time to display a "New content is 58 | // available; please refresh." message in your web app. 59 | console.log('New content is available; please refresh.'); 60 | } else { 61 | // At this point, everything has been precached. 62 | // It's the perfect time to display a 63 | // "Content is cached for offline use." message. 64 | console.log('Content is cached for offline use.'); 65 | } 66 | } 67 | }; 68 | }; 69 | }) 70 | .catch(error => { 71 | console.error('Error during service worker registration:', error); 72 | }); 73 | } 74 | 75 | function checkValidServiceWorker(swUrl) { 76 | // Check if the service worker can be found. If it can't reload the page. 77 | fetch(swUrl) 78 | .then(response => { 79 | // Ensure service worker exists, and that we really are getting a JS file. 80 | if ( 81 | response.status === 404 || 82 | response.headers.get('content-type').indexOf('javascript') === -1 83 | ) { 84 | // No service worker found. Probably a different app. Reload the page. 85 | navigator.serviceWorker.ready.then(registration => { 86 | registration.unregister().then(() => { 87 | window.location.reload(); 88 | }); 89 | }); 90 | } else { 91 | // Service worker found. Proceed as normal. 92 | registerValidSW(swUrl); 93 | } 94 | }) 95 | .catch(() => { 96 | console.log( 97 | 'No internet connection found. App is running in offline mode.' 98 | ); 99 | }); 100 | } 101 | 102 | export function unregister() { 103 | if ('serviceWorker' in navigator) { 104 | navigator.serviceWorker.ready.then(registration => { 105 | registration.unregister(); 106 | }); 107 | } 108 | } 109 | --------------------------------------------------------------------------------