├── .nvmrc ├── .prettierignore ├── src ├── simple-todos │ ├── step01 │ │ ├── .gitignore │ │ ├── .meteor │ │ │ ├── .gitignore │ │ │ ├── release │ │ │ ├── platforms │ │ │ ├── .id │ │ │ ├── .finished-upgraders │ │ │ └── packages │ │ ├── client │ │ │ ├── main.css │ │ │ ├── main.jsx │ │ │ └── main.html │ │ ├── imports │ │ │ ├── api │ │ │ │ └── links.js │ │ │ └── ui │ │ │ │ ├── Task.jsx │ │ │ │ └── App.jsx │ │ ├── tests │ │ │ └── main.js │ │ ├── package.json │ │ └── server │ │ │ └── main.js │ ├── step02 │ │ ├── .gitignore │ │ ├── .meteor │ │ │ ├── .gitignore │ │ │ ├── release │ │ │ ├── platforms │ │ │ ├── .id │ │ │ ├── .finished-upgraders │ │ │ └── packages │ │ ├── client │ │ │ ├── main.css │ │ │ ├── main.jsx │ │ │ └── main.html │ │ ├── imports │ │ │ ├── ui │ │ │ │ ├── Task.jsx │ │ │ │ └── App.jsx │ │ │ └── api │ │ │ │ └── TasksCollection.js │ │ ├── server │ │ │ └── main.js │ │ ├── tests │ │ │ └── main.js │ │ └── package.json │ ├── step03 │ │ ├── .gitignore │ │ ├── .meteor │ │ │ ├── .gitignore │ │ │ ├── release │ │ │ ├── platforms │ │ │ ├── .id │ │ │ ├── .finished-upgraders │ │ │ └── packages │ │ ├── client │ │ │ ├── main.css │ │ │ ├── main.jsx │ │ │ └── main.html │ │ ├── imports │ │ │ ├── ui │ │ │ │ ├── Task.jsx │ │ │ │ ├── App.jsx │ │ │ │ └── TaskForm.jsx │ │ │ └── api │ │ │ │ └── TasksCollection.js │ │ ├── server │ │ │ └── main.js │ │ ├── tests │ │ │ └── main.js │ │ └── package.json │ ├── step04 │ │ ├── .gitignore │ │ ├── .meteor │ │ │ ├── .gitignore │ │ │ ├── release │ │ │ ├── platforms │ │ │ ├── .id │ │ │ ├── .finished-upgraders │ │ │ └── packages │ │ ├── client │ │ │ ├── main.css │ │ │ ├── main.jsx │ │ │ └── main.html │ │ ├── imports │ │ │ ├── api │ │ │ │ └── TasksCollection.js │ │ │ └── ui │ │ │ │ ├── Task.jsx │ │ │ │ ├── TaskForm.jsx │ │ │ │ └── App.jsx │ │ ├── server │ │ │ └── main.js │ │ ├── tests │ │ │ └── main.js │ │ └── package.json │ ├── step05 │ │ ├── .gitignore │ │ ├── .meteor │ │ │ ├── .gitignore │ │ │ ├── release │ │ │ ├── platforms │ │ │ ├── .id │ │ │ ├── .finished-upgraders │ │ │ └── packages │ │ ├── imports │ │ │ ├── api │ │ │ │ └── TasksCollection.js │ │ │ └── ui │ │ │ │ ├── Task.jsx │ │ │ │ ├── TaskForm.jsx │ │ │ │ └── App.jsx │ │ ├── client │ │ │ ├── main.jsx │ │ │ └── main.html │ │ ├── server │ │ │ └── main.js │ │ ├── tests │ │ │ └── main.js │ │ └── package.json │ ├── step06 │ │ ├── .gitignore │ │ ├── .meteor │ │ │ ├── .gitignore │ │ │ ├── release │ │ │ ├── platforms │ │ │ ├── .id │ │ │ ├── .finished-upgraders │ │ │ └── packages │ │ ├── imports │ │ │ ├── api │ │ │ │ └── TasksCollection.js │ │ │ └── ui │ │ │ │ ├── Task.jsx │ │ │ │ └── TaskForm.jsx │ │ ├── client │ │ │ ├── main.jsx │ │ │ └── main.html │ │ ├── server │ │ │ └── main.js │ │ ├── tests │ │ │ └── main.js │ │ └── package.json │ ├── step07 │ │ ├── .gitignore │ │ ├── .meteor │ │ │ ├── .gitignore │ │ │ ├── release │ │ │ ├── platforms │ │ │ ├── .id │ │ │ ├── .finished-upgraders │ │ │ └── packages │ │ ├── imports │ │ │ ├── api │ │ │ │ └── TasksCollection.js │ │ │ └── ui │ │ │ │ ├── Task.jsx │ │ │ │ ├── TaskForm.jsx │ │ │ │ └── LoginForm.jsx │ │ ├── client │ │ │ ├── main.jsx │ │ │ └── main.html │ │ ├── tests │ │ │ └── main.js │ │ ├── package.json │ │ └── server │ │ │ └── main.js │ ├── step08 │ │ ├── .gitignore │ │ ├── .meteor │ │ │ ├── .gitignore │ │ │ ├── release │ │ │ ├── platforms │ │ │ ├── .id │ │ │ ├── .finished-upgraders │ │ │ └── packages │ │ ├── imports │ │ │ ├── api │ │ │ │ └── TasksCollection.js │ │ │ └── ui │ │ │ │ ├── Task.jsx │ │ │ │ ├── TaskForm.jsx │ │ │ │ ├── LoginForm.jsx │ │ │ │ └── LoginWithGithub.jsx │ │ ├── client │ │ │ ├── main.jsx │ │ │ └── main.html │ │ ├── tests │ │ │ └── main.js │ │ ├── package.json │ │ └── server │ │ │ └── main.js │ ├── step09 │ │ ├── .gitignore │ │ ├── .meteor │ │ │ ├── .gitignore │ │ │ ├── release │ │ │ ├── platforms │ │ │ ├── .id │ │ │ ├── .finished-upgraders │ │ │ └── packages │ │ ├── imports │ │ │ ├── db │ │ │ │ └── TasksCollection.js │ │ │ ├── ui │ │ │ │ ├── Task.jsx │ │ │ │ ├── TaskForm.jsx │ │ │ │ ├── LoginForm.jsx │ │ │ │ └── LoginWithGithub.jsx │ │ │ └── api │ │ │ │ └── tasksMethods.js │ │ ├── client │ │ │ ├── main.jsx │ │ │ └── main.html │ │ ├── tests │ │ │ └── main.js │ │ ├── package.json │ │ └── server │ │ │ └── main.js │ ├── step10 │ │ ├── .gitignore │ │ ├── .meteor │ │ │ ├── .gitignore │ │ │ ├── release │ │ │ ├── platforms │ │ │ ├── .id │ │ │ ├── .finished-upgraders │ │ │ └── packages │ │ ├── imports │ │ │ ├── db │ │ │ │ └── TasksCollection.js │ │ │ ├── api │ │ │ │ ├── tasksPublications.js │ │ │ │ └── tasksMethods.js │ │ │ └── ui │ │ │ │ ├── Task.jsx │ │ │ │ ├── TaskForm.jsx │ │ │ │ ├── LoginForm.jsx │ │ │ │ └── LoginWithGithub.jsx │ │ ├── client │ │ │ ├── main.jsx │ │ │ └── main.html │ │ ├── tests │ │ │ └── main.js │ │ ├── package.json │ │ └── server │ │ │ └── main.js │ ├── step11 │ │ ├── .gitignore │ │ ├── .meteor │ │ │ ├── .gitignore │ │ │ ├── release │ │ │ ├── platforms │ │ │ ├── .id │ │ │ ├── .finished-upgraders │ │ │ └── packages │ │ ├── imports │ │ │ ├── db │ │ │ │ └── TasksCollection.js │ │ │ ├── api │ │ │ │ ├── tasksPublications.js │ │ │ │ └── tasksMethods.js │ │ │ └── ui │ │ │ │ ├── Task.jsx │ │ │ │ ├── TaskForm.jsx │ │ │ │ ├── LoginForm.jsx │ │ │ │ └── LoginWithGithub.jsx │ │ ├── client │ │ │ ├── main.jsx │ │ │ └── main.html │ │ ├── tests │ │ │ └── main.js │ │ ├── package.json │ │ └── server │ │ │ └── main.js │ ├── step12 │ │ ├── .gitignore │ │ ├── .meteor │ │ │ ├── .gitignore │ │ │ ├── release │ │ │ ├── platforms │ │ │ ├── .id │ │ │ ├── .finished-upgraders │ │ │ └── packages │ │ ├── tests │ │ │ └── main.js │ │ ├── imports │ │ │ ├── db │ │ │ │ └── TasksCollection.js │ │ │ ├── api │ │ │ │ ├── tasksPublications.js │ │ │ │ └── tasksMethods.js │ │ │ └── ui │ │ │ │ ├── Task.jsx │ │ │ │ ├── TaskForm.jsx │ │ │ │ ├── LoginForm.jsx │ │ │ │ └── LoginWithGithub.jsx │ │ ├── client │ │ │ ├── main.jsx │ │ │ └── main.html │ │ ├── package.json │ │ └── server │ │ │ └── main.js │ └── step13 │ │ ├── .gitignore │ │ ├── .meteor │ │ ├── .gitignore │ │ ├── release │ │ ├── platforms │ │ ├── .id │ │ ├── .finished-upgraders │ │ └── packages │ │ ├── tests │ │ └── main.js │ │ ├── imports │ │ ├── db │ │ │ └── TasksCollection.js │ │ ├── api │ │ │ ├── tasksPublications.js │ │ │ └── tasksMethods.js │ │ └── ui │ │ │ ├── Task.jsx │ │ │ ├── TaskForm.jsx │ │ │ ├── LoginForm.jsx │ │ │ └── LoginWithGithub.jsx │ │ ├── client │ │ ├── main.jsx │ │ └── main.html │ │ ├── package.json │ │ └── server │ │ └── main.js └── simple-todos-graphql │ ├── step01 │ ├── .gitignore │ ├── .meteor │ │ ├── .gitignore │ │ ├── release │ │ ├── platforms │ │ ├── .id │ │ ├── .finished-upgraders │ │ └── packages │ ├── tests │ │ └── main.js │ ├── imports │ │ ├── db │ │ │ └── TasksCollection.js │ │ ├── api │ │ │ ├── tasksPublications.js │ │ │ ├── graphql.js │ │ │ └── tasksMethods.js │ │ └── ui │ │ │ ├── Task.jsx │ │ │ ├── TaskForm.jsx │ │ │ └── LoginForm.jsx │ ├── client │ │ ├── main.html │ │ └── main.jsx │ ├── package.json │ └── server │ │ └── main.js │ ├── step02 │ ├── .gitignore │ ├── .meteor │ │ ├── .gitignore │ │ ├── release │ │ ├── platforms │ │ ├── .id │ │ ├── .finished-upgraders │ │ └── packages │ ├── tests │ │ └── main.js │ ├── imports │ │ ├── db │ │ │ └── TasksCollection.js │ │ ├── api │ │ │ ├── tasksPublications.js │ │ │ ├── graphql.js │ │ │ └── tasksMethods.js │ │ └── ui │ │ │ ├── Task.jsx │ │ │ ├── TaskForm.jsx │ │ │ └── LoginForm.jsx │ ├── client │ │ ├── main.html │ │ └── main.jsx │ ├── package.json │ └── server │ │ └── main.js │ ├── step03 │ ├── .gitignore │ ├── .meteor │ │ ├── .gitignore │ │ ├── release │ │ ├── platforms │ │ ├── .id │ │ ├── .finished-upgraders │ │ └── packages │ ├── tests │ │ └── main.js │ ├── imports │ │ ├── db │ │ │ └── TasksCollection.js │ │ ├── api │ │ │ ├── tasksPublications.js │ │ │ ├── tasksMethods.js │ │ │ └── graphql.js │ │ └── ui │ │ │ ├── Task.jsx │ │ │ ├── TaskForm.jsx │ │ │ └── LoginForm.jsx │ ├── client │ │ ├── main.html │ │ └── main.jsx │ ├── server │ │ └── main.js │ └── package.json │ └── step04 │ ├── .gitignore │ ├── .meteor │ ├── .gitignore │ ├── release │ ├── platforms │ ├── .id │ ├── .finished-upgraders │ └── packages │ ├── tests │ └── main.js │ ├── imports │ ├── api │ │ ├── tasksPublications.js │ │ └── tasksMethods.js │ ├── db │ │ └── TasksCollection.js │ └── ui │ │ ├── Task.jsx │ │ ├── LoginForm.jsx │ │ └── TaskForm.jsx │ ├── client │ ├── main.html │ └── main.jsx │ ├── server │ └── main.js │ └── package.json ├── assets └── theme-colors.less ├── netlify.toml ├── prettier.config.js ├── tutorial ├── simple-todos │ ├── assets │ │ ├── step06-all.png │ │ ├── step07-login.png │ │ ├── step04-checkbox.png │ │ ├── step05-styles.png │ │ ├── step06-filtered.png │ │ ├── step07-logout.png │ │ ├── step13-sign-up.png │ │ ├── step02-tasks-list.png │ │ ├── step06-extension.png │ │ ├── step02-connect-mongo.png │ │ ├── step02-see-your-db.png │ │ ├── step03-form-new-task.png │ │ ├── step04-delete-button.png │ │ ├── step06-ddp-messages.png │ │ ├── step08-github-login.png │ │ ├── step11-ios-simulator.png │ │ ├── step12-test-report.png │ │ ├── step03-new-task-on-list.png │ │ ├── step11-android-emulator.png │ │ ├── step02-see-your-collection.png │ │ ├── step01-dev-tools-mobile-toggle.png │ │ ├── step01-mobile-with-meta-tags.png │ │ └── step01-mobile-without-meta-tags.png │ ├── index.md │ └── 14-next-steps.md └── simple-todos-graphql │ ├── assets │ ├── step02-minimongo.png │ ├── step01-query-result.png │ ├── step01-query-no-result.png │ ├── step01-testing-query.png │ ├── step02-tasks-no-name.png │ └── step01-apollo-dev-tools-view.png │ └── index.md ├── .eslintignore ├── .gitignore ├── .gitmodules ├── scripts ├── legacy-warning.js └── dl.js └── _config.yml /.nvmrc: -------------------------------------------------------------------------------- 1 | 8.11.2 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | **/.meteor/local/* 2 | -------------------------------------------------------------------------------- /src/simple-todos/step01/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos/step01/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos/step02/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos/step02/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos/step03/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos/step03/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos/step04/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos/step04/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos/step05/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos/step05/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos/step06/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos/step06/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos/step07/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos/step07/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos/step08/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos/step08/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos/step09/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos/step09/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos/step10/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos/step10/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos/step11/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos/step11/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos/step12/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos/step12/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos/step13/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos/step13/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos/step01/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos/step02/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos/step03/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos/step04/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos/step05/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos/step06/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos/step07/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos/step08/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos/step09/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos/step10/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos/step11/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos/step12/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos/step13/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.7.1 2 | -------------------------------------------------------------------------------- /src/simple-todos/step01/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /src/simple-todos/step02/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /src/simple-todos/step03/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /src/simple-todos/step04/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /src/simple-todos/step05/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /src/simple-todos/step06/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /src/simple-todos/step07/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /src/simple-todos/step08/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /src/simple-todos/step09/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /src/simple-todos/step10/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /src/simple-todos/step11/.meteor/platforms: -------------------------------------------------------------------------------- 1 | android 2 | browser 3 | ios 4 | server 5 | -------------------------------------------------------------------------------- /src/simple-todos/step12/.meteor/platforms: -------------------------------------------------------------------------------- 1 | android 2 | browser 3 | ios 4 | server 5 | -------------------------------------------------------------------------------- /src/simple-todos/step12/tests/main.js: -------------------------------------------------------------------------------- 1 | import '/imports/api/tasksMethods.tests.js'; 2 | -------------------------------------------------------------------------------- /src/simple-todos/step13/.meteor/platforms: -------------------------------------------------------------------------------- 1 | android 2 | browser 3 | ios 4 | server 5 | -------------------------------------------------------------------------------- /src/simple-todos/step13/tests/main.js: -------------------------------------------------------------------------------- 1 | import '/imports/api/tasksMethods.tests.js'; 2 | -------------------------------------------------------------------------------- /assets/theme-colors.less: -------------------------------------------------------------------------------- 1 | // Haven't made any changes as we want the default Meteor colors 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/.meteor/platforms: -------------------------------------------------------------------------------- 1 | android 2 | browser 3 | ios 4 | server 5 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/.meteor/platforms: -------------------------------------------------------------------------------- 1 | android 2 | browser 3 | ios 4 | server 5 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/.meteor/platforms: -------------------------------------------------------------------------------- 1 | android 2 | browser 3 | ios 4 | server 5 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/.meteor/platforms: -------------------------------------------------------------------------------- 1 | android 2 | browser 3 | ios 4 | server 5 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | publish = "public" 3 | command = "npm install && npm run build" 4 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@quave/eslint-config-quave/prettier.config'); 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/tests/main.js: -------------------------------------------------------------------------------- 1 | import '/imports/api/tasksMethods.tests.js'; 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/tests/main.js: -------------------------------------------------------------------------------- 1 | import '/imports/api/tasksMethods.tests.js'; 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/tests/main.js: -------------------------------------------------------------------------------- 1 | import '/imports/api/tasksMethods.tests.js'; 2 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/tests/main.js: -------------------------------------------------------------------------------- 1 | import '/imports/api/tasksMethods.tests.js'; 2 | -------------------------------------------------------------------------------- /src/simple-todos/step01/client/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 10px; 3 | font-family: sans-serif; 4 | } 5 | -------------------------------------------------------------------------------- /src/simple-todos/step02/client/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 10px; 3 | font-family: sans-serif; 4 | } 5 | -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step06-all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step06-all.png -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # general 2 | **/.meteor/local/* 3 | **/node_modules/* 4 | 5 | # specific for tutorial repo 6 | public/script/* 7 | scripts/* 8 | -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step07-login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step07-login.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step04-checkbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step04-checkbox.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step05-styles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step05-styles.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step06-filtered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step06-filtered.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step07-logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step07-logout.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step13-sign-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step13-sign-up.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | Thumbs.db 3 | db.json 4 | *.log 5 | node_modules/ 6 | public/ 7 | .deploy*/ 8 | data/ 9 | _multiconfig.yml 10 | .idea/ 11 | -------------------------------------------------------------------------------- /src/simple-todos/step01/imports/api/links.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const LinksCollection = new Mongo.Collection('links'); 4 | -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step02-tasks-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step02-tasks-list.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step06-extension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step06-extension.png -------------------------------------------------------------------------------- /src/simple-todos/step01/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task }) => { 4 | return
  • {task.text}
  • ; 5 | }; 6 | -------------------------------------------------------------------------------- /src/simple-todos/step02/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task }) => { 4 | return
  • {task.text}
  • ; 5 | }; 6 | -------------------------------------------------------------------------------- /src/simple-todos/step03/client/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 10px; 3 | font-family: sans-serif; 4 | } 5 | 6 | .task-form { 7 | margin-top: 1rem; 8 | } 9 | -------------------------------------------------------------------------------- /src/simple-todos/step03/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task }) => { 4 | return
  • {task.text}
  • ; 5 | }; 6 | -------------------------------------------------------------------------------- /src/simple-todos/step04/client/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 10px; 3 | font-family: sans-serif; 4 | } 5 | 6 | .task-form { 7 | margin-top: 1rem; 8 | } 9 | -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step02-connect-mongo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step02-connect-mongo.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step02-see-your-db.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step02-see-your-db.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step03-form-new-task.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step03-form-new-task.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step04-delete-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step04-delete-button.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step06-ddp-messages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step06-ddp-messages.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step08-github-login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step08-github-login.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step11-ios-simulator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step11-ios-simulator.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step12-test-report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step12-test-report.png -------------------------------------------------------------------------------- /src/simple-todos/step02/imports/api/TasksCollection.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const TasksCollection = new Mongo.Collection('tasks'); 4 | -------------------------------------------------------------------------------- /src/simple-todos/step03/imports/api/TasksCollection.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const TasksCollection = new Mongo.Collection('tasks'); 4 | -------------------------------------------------------------------------------- /src/simple-todos/step04/imports/api/TasksCollection.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const TasksCollection = new Mongo.Collection('tasks'); 4 | -------------------------------------------------------------------------------- /src/simple-todos/step05/imports/api/TasksCollection.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const TasksCollection = new Mongo.Collection('tasks'); 4 | -------------------------------------------------------------------------------- /src/simple-todos/step06/imports/api/TasksCollection.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const TasksCollection = new Mongo.Collection('tasks'); 4 | -------------------------------------------------------------------------------- /src/simple-todos/step07/imports/api/TasksCollection.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const TasksCollection = new Mongo.Collection('tasks'); 4 | -------------------------------------------------------------------------------- /src/simple-todos/step08/imports/api/TasksCollection.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const TasksCollection = new Mongo.Collection('tasks'); 4 | -------------------------------------------------------------------------------- /src/simple-todos/step09/imports/db/TasksCollection.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const TasksCollection = new Mongo.Collection('tasks'); 4 | -------------------------------------------------------------------------------- /src/simple-todos/step10/imports/db/TasksCollection.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const TasksCollection = new Mongo.Collection('tasks'); 4 | -------------------------------------------------------------------------------- /src/simple-todos/step11/imports/db/TasksCollection.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const TasksCollection = new Mongo.Collection('tasks'); 4 | -------------------------------------------------------------------------------- /src/simple-todos/step12/imports/db/TasksCollection.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const TasksCollection = new Mongo.Collection('tasks'); 4 | -------------------------------------------------------------------------------- /src/simple-todos/step13/imports/db/TasksCollection.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const TasksCollection = new Mongo.Collection('tasks'); 4 | -------------------------------------------------------------------------------- /tutorial/simple-todos-graphql/assets/step02-minimongo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos-graphql/assets/step02-minimongo.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step03-new-task-on-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step03-new-task-on-list.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step11-android-emulator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step11-android-emulator.png -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/imports/db/TasksCollection.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const TasksCollection = new Mongo.Collection('tasks'); 4 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/imports/db/TasksCollection.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const TasksCollection = new Mongo.Collection('tasks'); 4 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/imports/db/TasksCollection.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const TasksCollection = new Mongo.Collection('tasks'); 4 | -------------------------------------------------------------------------------- /tutorial/simple-todos-graphql/assets/step01-query-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos-graphql/assets/step01-query-result.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step02-see-your-collection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step02-see-your-collection.png -------------------------------------------------------------------------------- /tutorial/simple-todos-graphql/assets/step01-query-no-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos-graphql/assets/step01-query-no-result.png -------------------------------------------------------------------------------- /tutorial/simple-todos-graphql/assets/step01-testing-query.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos-graphql/assets/step01-testing-query.png -------------------------------------------------------------------------------- /tutorial/simple-todos-graphql/assets/step02-tasks-no-name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos-graphql/assets/step02-tasks-no-name.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step01-dev-tools-mobile-toggle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step01-dev-tools-mobile-toggle.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step01-mobile-with-meta-tags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step01-mobile-with-meta-tags.png -------------------------------------------------------------------------------- /tutorial/simple-todos/assets/step01-mobile-without-meta-tags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos/assets/step01-mobile-without-meta-tags.png -------------------------------------------------------------------------------- /tutorial/simple-todos-graphql/assets/step01-apollo-dev-tools-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteor/react-tutorial/HEAD/tutorial/simple-todos-graphql/assets/step01-apollo-dev-tools-view.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "themes/meteor"] 2 | path = themes/meteor 3 | url = https://github.com/meteor/hexo-theme-meteor.git 4 | [submodule "code"] 5 | path = code 6 | url = https://github.com/meteor/meteor.git 7 | -------------------------------------------------------------------------------- /src/simple-todos/step10/imports/api/tasksPublications.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { TasksCollection } from '/imports/db/TasksCollection'; 3 | 4 | Meteor.publish('tasks', function publishTasks() { 5 | return TasksCollection.find({ userId: this.userId }); 6 | }); 7 | -------------------------------------------------------------------------------- /src/simple-todos/step11/imports/api/tasksPublications.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { TasksCollection } from '/imports/db/TasksCollection'; 3 | 4 | Meteor.publish('tasks', function publishTasks() { 5 | return TasksCollection.find({ userId: this.userId }); 6 | }); 7 | -------------------------------------------------------------------------------- /src/simple-todos/step12/imports/api/tasksPublications.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { TasksCollection } from '/imports/db/TasksCollection'; 3 | 4 | Meteor.publish('tasks', function publishTasks() { 5 | return TasksCollection.find({ userId: this.userId }); 6 | }); 7 | -------------------------------------------------------------------------------- /src/simple-todos/step13/imports/api/tasksPublications.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { TasksCollection } from '/imports/db/TasksCollection'; 3 | 4 | Meteor.publish('tasks', function publishTasks() { 5 | return TasksCollection.find({ userId: this.userId }); 6 | }); 7 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/imports/api/tasksPublications.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { TasksCollection } from '/imports/db/TasksCollection'; 3 | 4 | Meteor.publish('tasks', function publishTasks() { 5 | return TasksCollection.find({ userId: this.userId }); 6 | }); 7 | -------------------------------------------------------------------------------- /src/simple-todos/step01/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | Meteor.startup(() => { 7 | render(, document.getElementById('react-target')); 8 | }); 9 | -------------------------------------------------------------------------------- /src/simple-todos/step02/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | Meteor.startup(() => { 7 | render(, document.getElementById('react-target')); 8 | }); 9 | -------------------------------------------------------------------------------- /src/simple-todos/step03/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | Meteor.startup(() => { 7 | render(, document.getElementById('react-target')); 8 | }); 9 | -------------------------------------------------------------------------------- /src/simple-todos/step04/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | Meteor.startup(() => { 7 | render(, document.getElementById('react-target')); 8 | }); 9 | -------------------------------------------------------------------------------- /src/simple-todos/step05/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | Meteor.startup(() => { 7 | render(, document.getElementById('react-target')); 8 | }); 9 | -------------------------------------------------------------------------------- /src/simple-todos/step06/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | Meteor.startup(() => { 7 | render(, document.getElementById('react-target')); 8 | }); 9 | -------------------------------------------------------------------------------- /src/simple-todos/step07/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | Meteor.startup(() => { 7 | render(, document.getElementById('react-target')); 8 | }); 9 | -------------------------------------------------------------------------------- /src/simple-todos/step08/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | Meteor.startup(() => { 7 | render(, document.getElementById('react-target')); 8 | }); 9 | -------------------------------------------------------------------------------- /src/simple-todos/step09/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | Meteor.startup(() => { 7 | render(, document.getElementById('react-target')); 8 | }); 9 | -------------------------------------------------------------------------------- /src/simple-todos/step10/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | Meteor.startup(() => { 7 | render(, document.getElementById('react-target')); 8 | }); 9 | -------------------------------------------------------------------------------- /src/simple-todos/step11/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | Meteor.startup(() => { 7 | render(, document.getElementById('react-target')); 8 | }); 9 | -------------------------------------------------------------------------------- /src/simple-todos/step12/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | Meteor.startup(() => { 7 | render(, document.getElementById('react-target')); 8 | }); 9 | -------------------------------------------------------------------------------- /src/simple-todos/step13/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | Meteor.startup(() => { 7 | render(, document.getElementById('react-target')); 8 | }); 9 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/imports/api/tasksPublications.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { TasksCollection } from '/imports/db/TasksCollection'; 3 | 4 | Meteor.publish('tasks', function publishTasks() { 5 | return TasksCollection.find( 6 | { userId: this.userId }, 7 | { fields: { _id: 1, isChecked: 1, userId: 1 } } 8 | ); 9 | }); 10 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/imports/api/tasksPublications.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { TasksCollection } from '/imports/db/TasksCollection'; 3 | 4 | Meteor.publish('tasks', function publishTasks() { 5 | return TasksCollection.find( 6 | { userId: this.userId }, 7 | { fields: { _id: 1, isChecked: 1, userId: 1 } } 8 | ); 9 | }); 10 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/imports/api/tasksPublications.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { TasksCollection } from '/imports/db/TasksCollection'; 3 | 4 | Meteor.publish('tasks', function publishTasks() { 5 | return TasksCollection.find( 6 | { userId: this.userId }, 7 | { fields: { _id: 1, isChecked: 1, userId: 1 } } 8 | ); 9 | }); 10 | -------------------------------------------------------------------------------- /src/simple-todos/step01/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /src/simple-todos/step02/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /src/simple-todos/step03/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /src/simple-todos/step04/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /src/simple-todos/step05/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /src/simple-todos/step06/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /src/simple-todos/step07/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /src/simple-todos/step08/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /src/simple-todos/step09/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /src/simple-todos/step10/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /src/simple-todos/step11/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /src/simple-todos/step12/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /src/simple-todos/step13/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/.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 | jmajmz85eqdd.z30wyw6z2cdu 8 | -------------------------------------------------------------------------------- /tutorial/simple-todos-graphql/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Introduction GraphQL 3 | description: Learn how to use GraphQL with Meteor and React 4 | --- 5 | 6 | In this tutorial we will use GraphQL in the to-do app that we created in [this tutorial](https://react-tutorial.meteor.com/simple-todos/). 7 | 8 | We recommend that you have already finished that tutorial, as we will start from the last step of it. 9 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/imports/db/TasksCollection.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | const tasksCollection = Object.assign(new Mongo.Collection('tasks'), { 4 | save({ text, userId }) { 5 | const newTaskId = this.insert({ 6 | text, 7 | userId, 8 | createdAt: new Date(), 9 | }); 10 | return this.findOne(newTaskId); 11 | } 12 | }); 13 | 14 | export { tasksCollection as TasksCollection } 15 | -------------------------------------------------------------------------------- /src/simple-todos/step04/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task, onCheckboxClick, onDeleteClick }) => { 4 | return ( 5 |
  • 6 | onCheckboxClick(task)} 10 | readOnly 11 | /> 12 | {task.text} 13 | 14 |
  • 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/simple-todos/step05/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task, onCheckboxClick, onDeleteClick }) => { 4 | return ( 5 |
  • 6 | onCheckboxClick(task)} 10 | readOnly 11 | /> 12 | {task.text} 13 | 14 |
  • 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/simple-todos/step06/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task, onCheckboxClick, onDeleteClick }) => { 4 | return ( 5 |
  • 6 | onCheckboxClick(task)} 10 | readOnly 11 | /> 12 | {task.text} 13 | 14 |
  • 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/simple-todos/step07/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task, onCheckboxClick, onDeleteClick }) => { 4 | return ( 5 |
  • 6 | onCheckboxClick(task)} 10 | readOnly 11 | /> 12 | {task.text} 13 | 14 |
  • 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/simple-todos/step08/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task, onCheckboxClick, onDeleteClick }) => { 4 | return ( 5 |
  • 6 | onCheckboxClick(task)} 10 | readOnly 11 | /> 12 | {task.text} 13 | 14 |
  • 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/simple-todos/step09/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task, onCheckboxClick, onDeleteClick }) => { 4 | return ( 5 |
  • 6 | onCheckboxClick(task)} 10 | readOnly 11 | /> 12 | {task.text} 13 | 14 |
  • 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/simple-todos/step10/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task, onCheckboxClick, onDeleteClick }) => { 4 | return ( 5 |
  • 6 | onCheckboxClick(task)} 10 | readOnly 11 | /> 12 | {task.text} 13 | 14 |
  • 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/simple-todos/step11/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task, onCheckboxClick, onDeleteClick }) => { 4 | return ( 5 |
  • 6 | onCheckboxClick(task)} 10 | readOnly 11 | /> 12 | {task.text} 13 | 14 |
  • 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/simple-todos/step12/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task, onCheckboxClick, onDeleteClick }) => { 4 | return ( 5 |
  • 6 | onCheckboxClick(task)} 10 | readOnly 11 | /> 12 | {task.text} 13 | 14 |
  • 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/simple-todos/step13/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task, onCheckboxClick, onDeleteClick }) => { 4 | return ( 5 |
  • 6 | onCheckboxClick(task)} 10 | readOnly 11 | /> 12 | {task.text} 13 | 14 |
  • 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task, onCheckboxClick, onDeleteClick }) => { 4 | return ( 5 |
  • 6 | onCheckboxClick(task)} 10 | readOnly 11 | /> 12 | {task.text} 13 | 14 |
  • 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task, onCheckboxClick, onDeleteClick }) => { 4 | return ( 5 |
  • 6 | onCheckboxClick(task)} 10 | readOnly 11 | /> 12 | {task.text} 13 | 14 |
  • 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task, onCheckboxClick, onDeleteClick }) => { 4 | return ( 5 |
  • 6 | onCheckboxClick(task)} 10 | readOnly 11 | /> 12 | {task.text} 13 | 14 |
  • 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/imports/ui/Task.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Task = ({ task, onCheckboxClick, onDeleteClick }) => { 4 | return ( 5 |
  • 6 | onCheckboxClick(task)} 10 | readOnly 11 | /> 12 | {task.text} 13 | 14 |
  • 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/simple-todos/step01/imports/ui/App.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { Task } from './Task'; 4 | 5 | const tasks = [ 6 | { _id: 1, text: 'First Task' }, 7 | { _id: 2, text: 'Second Task' }, 8 | { _id: 3, text: 'Third Task' }, 9 | ]; 10 | 11 | export const App = () => ( 12 |
    13 |

    Welcome to Meteor!

    14 |
      15 | {tasks.map(task => ( 16 | 17 | ))} 18 |
    19 |
    20 | ); 21 | -------------------------------------------------------------------------------- /src/simple-todos/step02/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { TasksCollection } from '/imports/api/TasksCollection'; 3 | 4 | const insertTask = taskText => TasksCollection.insert({ text: taskText }); 5 | 6 | Meteor.startup(() => { 7 | if (TasksCollection.find().count() === 0) { 8 | [ 9 | 'First Task', 10 | 'Second Task', 11 | 'Third Task', 12 | 'Fourth Task', 13 | 'Fifth Task', 14 | 'Sixth Task', 15 | 'Seventh Task', 16 | ].forEach(insertTask); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /src/simple-todos/step03/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { TasksCollection } from '/imports/api/TasksCollection'; 3 | 4 | const insertTask = taskText => TasksCollection.insert({ text: taskText }); 5 | 6 | Meteor.startup(() => { 7 | if (TasksCollection.find().count() === 0) { 8 | [ 9 | 'First Task', 10 | 'Second Task', 11 | 'Third Task', 12 | 'Fourth Task', 13 | 'Fifth Task', 14 | 'Sixth Task', 15 | 'Seventh Task', 16 | ].forEach(insertTask); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /src/simple-todos/step04/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { TasksCollection } from '/imports/api/TasksCollection'; 3 | 4 | const insertTask = taskText => TasksCollection.insert({ text: taskText }); 5 | 6 | Meteor.startup(() => { 7 | if (TasksCollection.find().count() === 0) { 8 | [ 9 | 'First Task', 10 | 'Second Task', 11 | 'Third Task', 12 | 'Fourth Task', 13 | 'Fifth Task', 14 | 'Sixth Task', 15 | 'Seventh Task', 16 | ].forEach(insertTask); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /src/simple-todos/step05/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { TasksCollection } from '/imports/api/TasksCollection'; 3 | 4 | const insertTask = taskText => TasksCollection.insert({ text: taskText }); 5 | 6 | Meteor.startup(() => { 7 | if (TasksCollection.find().count() === 0) { 8 | [ 9 | 'First Task', 10 | 'Second Task', 11 | 'Third Task', 12 | 'Fourth Task', 13 | 'Fifth Task', 14 | 'Sixth Task', 15 | 'Seventh Task', 16 | ].forEach(insertTask); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /src/simple-todos/step06/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { TasksCollection } from '/imports/api/TasksCollection'; 3 | 4 | const insertTask = taskText => TasksCollection.insert({ text: taskText }); 5 | 6 | Meteor.startup(() => { 7 | if (TasksCollection.find().count() === 0) { 8 | [ 9 | 'First Task', 10 | 'Second Task', 11 | 'Third Task', 12 | 'Fourth Task', 13 | 'Fifth Task', 14 | 'Sixth Task', 15 | 'Seventh Task', 16 | ].forEach(insertTask); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /scripts/legacy-warning.js: -------------------------------------------------------------------------------- 1 | /* global hexo */ 2 | 3 | hexo.extend.filter.register('after_render:html', function (str) { 4 | const warningMessage = ` 5 |
    6 | ⚠️ This is a legacy version of the React tutorial. Please visit docs.meteor.com/tutorials/react for the current version. 7 |
    8 | `; 9 | 10 | return str.replace(/
    /, `
    ${warningMessage}`); 11 | }); -------------------------------------------------------------------------------- /src/simple-todos/step01/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos/step02/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos/step02/imports/ui/App.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { useTracker } from 'meteor/react-meteor-data'; 3 | import { TasksCollection } from '/imports/api/TasksCollection'; 4 | import { Task } from './Task'; 5 | 6 | export const App = () => { 7 | const tasks = useTracker(() => TasksCollection.find({}).fetch()); 8 | 9 | return ( 10 |
    11 |

    Welcome to Meteor!

    12 | 13 |
      14 | {tasks.map(task => ( 15 | 16 | ))} 17 |
    18 |
    19 | ); 20 | }; 21 | -------------------------------------------------------------------------------- /src/simple-todos/step03/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos/step04/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos/step05/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos/step06/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos/step07/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos/step08/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos/step09/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos/step10/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos/step11/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos/step12/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos/step13/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | Meteor React To Do List 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | import { startGraphQLClient } from 'meteor/quave:graphql/client'; 7 | 8 | import { ApolloProvider } from '@apollo/react-hooks'; 9 | 10 | const apolloClient = startGraphQLClient({ connectToDevTools: true }); 11 | 12 | Meteor.startup(() => { 13 | render( 14 | 15 | 16 | , 17 | document.getElementById('react-target') 18 | ); 19 | }); 20 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | import { startGraphQLClient } from 'meteor/quave:graphql/client'; 7 | 8 | import { ApolloProvider } from '@apollo/react-hooks'; 9 | 10 | const apolloClient = startGraphQLClient({ connectToDevTools: true }); 11 | 12 | Meteor.startup(() => { 13 | render( 14 | 15 | 16 | , 17 | document.getElementById('react-target') 18 | ); 19 | }); 20 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | import { startGraphQLClient } from 'meteor/quave:graphql/client'; 7 | 8 | import { ApolloProvider } from '@apollo/react-hooks'; 9 | 10 | const apolloClient = startGraphQLClient({ connectToDevTools: true }); 11 | 12 | Meteor.startup(() => { 13 | render( 14 | 15 | 16 | , 17 | document.getElementById('react-target') 18 | ); 19 | }); 20 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/client/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { render } from 'react-dom'; 4 | import { App } from '/imports/ui/App'; 5 | 6 | import { startGraphQLClient } from 'meteor/quave:graphql/client'; 7 | 8 | import { ApolloProvider } from '@apollo/react-hooks'; 9 | 10 | const apolloClient = startGraphQLClient({ connectToDevTools: true }); 11 | 12 | Meteor.startup(() => { 13 | render( 14 | 15 | 16 | , 17 | document.getElementById('react-target') 18 | ); 19 | }); 20 | -------------------------------------------------------------------------------- /tutorial/simple-todos/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Introduction 3 | description: Learn how to create a Simple Todos with Meteor and React 4 | --- 5 | 6 | In this tutorial we will build a simple to-do tasks app using [React](https://reactjs.org) with the Meteor platform. Meteor works out-of-the-box with several other frameworks like [Blaze](https://guide.meteor.com/blaze.html), [Angular](https://guide.meteor.com/angular.html) and [Vue](https://guide.meteor.com/vue.html). 7 | 8 | We recommend you check out all of our [tutorials here](https://www.meteor.com/tutorials). For now, let's get started with building your React To-Do app with Meteor! 9 | -------------------------------------------------------------------------------- /src/simple-todos/step01/tests/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import assert from 'assert'; 3 | 4 | describe('simple-todos-react', function() { 5 | it('package.json has correct name', async function() { 6 | const { name } = await import('../package.json'); 7 | assert.strictEqual(name, 'simple-todos-react'); 8 | }); 9 | 10 | if (Meteor.isClient) { 11 | it('client is not server', function() { 12 | assert.strictEqual(Meteor.isServer, false); 13 | }); 14 | } 15 | 16 | if (Meteor.isServer) { 17 | it('server is not client', function() { 18 | assert.strictEqual(Meteor.isClient, false); 19 | }); 20 | } 21 | }); 22 | -------------------------------------------------------------------------------- /src/simple-todos/step02/tests/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import assert from 'assert'; 3 | 4 | describe('simple-todos-react', function() { 5 | it('package.json has correct name', async function() { 6 | const { name } = await import('../package.json'); 7 | assert.strictEqual(name, 'simple-todos-react'); 8 | }); 9 | 10 | if (Meteor.isClient) { 11 | it('client is not server', function() { 12 | assert.strictEqual(Meteor.isServer, false); 13 | }); 14 | } 15 | 16 | if (Meteor.isServer) { 17 | it('server is not client', function() { 18 | assert.strictEqual(Meteor.isClient, false); 19 | }); 20 | } 21 | }); 22 | -------------------------------------------------------------------------------- /src/simple-todos/step03/tests/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import assert from 'assert'; 3 | 4 | describe('simple-todos-react', function() { 5 | it('package.json has correct name', async function() { 6 | const { name } = await import('../package.json'); 7 | assert.strictEqual(name, 'simple-todos-react'); 8 | }); 9 | 10 | if (Meteor.isClient) { 11 | it('client is not server', function() { 12 | assert.strictEqual(Meteor.isServer, false); 13 | }); 14 | } 15 | 16 | if (Meteor.isServer) { 17 | it('server is not client', function() { 18 | assert.strictEqual(Meteor.isClient, false); 19 | }); 20 | } 21 | }); 22 | -------------------------------------------------------------------------------- /src/simple-todos/step04/tests/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import assert from 'assert'; 3 | 4 | describe('simple-todos-react', function() { 5 | it('package.json has correct name', async function() { 6 | const { name } = await import('../package.json'); 7 | assert.strictEqual(name, 'simple-todos-react'); 8 | }); 9 | 10 | if (Meteor.isClient) { 11 | it('client is not server', function() { 12 | assert.strictEqual(Meteor.isServer, false); 13 | }); 14 | } 15 | 16 | if (Meteor.isServer) { 17 | it('server is not client', function() { 18 | assert.strictEqual(Meteor.isClient, false); 19 | }); 20 | } 21 | }); 22 | -------------------------------------------------------------------------------- /src/simple-todos/step05/tests/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import assert from 'assert'; 3 | 4 | describe('simple-todos-react', function() { 5 | it('package.json has correct name', async function() { 6 | const { name } = await import('../package.json'); 7 | assert.strictEqual(name, 'simple-todos-react'); 8 | }); 9 | 10 | if (Meteor.isClient) { 11 | it('client is not server', function() { 12 | assert.strictEqual(Meteor.isServer, false); 13 | }); 14 | } 15 | 16 | if (Meteor.isServer) { 17 | it('server is not client', function() { 18 | assert.strictEqual(Meteor.isClient, false); 19 | }); 20 | } 21 | }); 22 | -------------------------------------------------------------------------------- /src/simple-todos/step06/tests/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import assert from 'assert'; 3 | 4 | describe('simple-todos-react', function() { 5 | it('package.json has correct name', async function() { 6 | const { name } = await import('../package.json'); 7 | assert.strictEqual(name, 'simple-todos-react'); 8 | }); 9 | 10 | if (Meteor.isClient) { 11 | it('client is not server', function() { 12 | assert.strictEqual(Meteor.isServer, false); 13 | }); 14 | } 15 | 16 | if (Meteor.isServer) { 17 | it('server is not client', function() { 18 | assert.strictEqual(Meteor.isClient, false); 19 | }); 20 | } 21 | }); 22 | -------------------------------------------------------------------------------- /src/simple-todos/step07/tests/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import assert from 'assert'; 3 | 4 | describe('simple-todos-react', function() { 5 | it('package.json has correct name', async function() { 6 | const { name } = await import('../package.json'); 7 | assert.strictEqual(name, 'simple-todos-react'); 8 | }); 9 | 10 | if (Meteor.isClient) { 11 | it('client is not server', function() { 12 | assert.strictEqual(Meteor.isServer, false); 13 | }); 14 | } 15 | 16 | if (Meteor.isServer) { 17 | it('server is not client', function() { 18 | assert.strictEqual(Meteor.isClient, false); 19 | }); 20 | } 21 | }); 22 | -------------------------------------------------------------------------------- /src/simple-todos/step08/tests/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import assert from 'assert'; 3 | 4 | describe('simple-todos-react', function() { 5 | it('package.json has correct name', async function() { 6 | const { name } = await import('../package.json'); 7 | assert.strictEqual(name, 'simple-todos-react'); 8 | }); 9 | 10 | if (Meteor.isClient) { 11 | it('client is not server', function() { 12 | assert.strictEqual(Meteor.isServer, false); 13 | }); 14 | } 15 | 16 | if (Meteor.isServer) { 17 | it('server is not client', function() { 18 | assert.strictEqual(Meteor.isClient, false); 19 | }); 20 | } 21 | }); 22 | -------------------------------------------------------------------------------- /src/simple-todos/step09/tests/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import assert from 'assert'; 3 | 4 | describe('simple-todos-react', function() { 5 | it('package.json has correct name', async function() { 6 | const { name } = await import('../package.json'); 7 | assert.strictEqual(name, 'simple-todos-react'); 8 | }); 9 | 10 | if (Meteor.isClient) { 11 | it('client is not server', function() { 12 | assert.strictEqual(Meteor.isServer, false); 13 | }); 14 | } 15 | 16 | if (Meteor.isServer) { 17 | it('server is not client', function() { 18 | assert.strictEqual(Meteor.isClient, false); 19 | }); 20 | } 21 | }); 22 | -------------------------------------------------------------------------------- /src/simple-todos/step10/tests/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import assert from 'assert'; 3 | 4 | describe('simple-todos-react', function() { 5 | it('package.json has correct name', async function() { 6 | const { name } = await import('../package.json'); 7 | assert.strictEqual(name, 'simple-todos-react'); 8 | }); 9 | 10 | if (Meteor.isClient) { 11 | it('client is not server', function() { 12 | assert.strictEqual(Meteor.isServer, false); 13 | }); 14 | } 15 | 16 | if (Meteor.isServer) { 17 | it('server is not client', function() { 18 | assert.strictEqual(Meteor.isClient, false); 19 | }); 20 | } 21 | }); 22 | -------------------------------------------------------------------------------- /src/simple-todos/step11/tests/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import assert from 'assert'; 3 | 4 | describe('simple-todos-react', function() { 5 | it('package.json has correct name', async function() { 6 | const { name } = await import('../package.json'); 7 | assert.strictEqual(name, 'simple-todos-react'); 8 | }); 9 | 10 | if (Meteor.isClient) { 11 | it('client is not server', function() { 12 | assert.strictEqual(Meteor.isServer, false); 13 | }); 14 | } 15 | 16 | if (Meteor.isServer) { 17 | it('server is not client', function() { 18 | assert.strictEqual(Meteor.isClient, false); 19 | }); 20 | } 21 | }); 22 | -------------------------------------------------------------------------------- /src/simple-todos/step03/imports/ui/App.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { useTracker } from 'meteor/react-meteor-data'; 3 | import { TasksCollection } from '/imports/api/TasksCollection'; 4 | import { Task } from './Task'; 5 | import { TaskForm } from './TaskForm'; 6 | 7 | export const App = () => { 8 | const tasks = useTracker(() => 9 | TasksCollection.find({}, { sort: { createdAt: -1 } }).fetch() 10 | ); 11 | 12 | return ( 13 |
    14 |

    Welcome to Meteor!

    15 | 16 | 17 | 18 |
      19 | {tasks.map(task => ( 20 | 21 | ))} 22 |
    23 |
    24 | ); 25 | }; 26 | -------------------------------------------------------------------------------- /src/simple-todos/step01/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos/step02/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos/step03/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos/step04/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos/step05/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos/step06/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos/step07/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos/step08/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos/step09/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos/step10/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos/step11/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos/step12/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos/step13/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/.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 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/imports/api/graphql.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { startGraphQLServer } from 'meteor/quave:graphql/server'; 3 | 4 | const log = error => console.error('GraphQL server error', error); 5 | 6 | const UserSchema = ` 7 | type Query { 8 | loggedUser: User 9 | } 10 | 11 | type User { 12 | _id: ID! 13 | username: String 14 | } 15 | `; 16 | 17 | const UserResolvers = { 18 | Query: { 19 | async loggedUser(root, args, { userId }) { 20 | if (!userId) { 21 | return null; 22 | } 23 | return Meteor.users.findOne(userId); 24 | }, 25 | }, 26 | }; 27 | 28 | startGraphQLServer({ typeDefs: [UserSchema], resolvers: [UserResolvers], log }); 29 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/imports/api/graphql.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { startGraphQLServer } from 'meteor/quave:graphql/server'; 3 | 4 | const log = error => console.error('GraphQL server error', error); 5 | 6 | const UserSchema = ` 7 | type Query { 8 | loggedUser: User 9 | } 10 | 11 | type User { 12 | _id: ID! 13 | username: String 14 | } 15 | `; 16 | 17 | const UserResolvers = { 18 | Query: { 19 | async loggedUser(root, args, { userId }) { 20 | if (!userId) { 21 | return null; 22 | } 23 | return Meteor.users.findOne(userId); 24 | }, 25 | }, 26 | }; 27 | 28 | startGraphQLServer({ typeDefs: [UserSchema], resolvers: [UserResolvers], log }); 29 | -------------------------------------------------------------------------------- /scripts/dl.js: -------------------------------------------------------------------------------- 1 | /* global hexo */ 2 | 3 | hexo.extend.tag.register( 4 | 'dtdd', 5 | function(args, content) { 6 | const options = parseTagOptions(args); 7 | 8 | let typespan = ''; 9 | if (options.type) { 10 | typespan = `${options.type}`; 11 | } 12 | 13 | let idstr = ''; 14 | if (options.id) { 15 | idstr = `id="${options.id}"`; 16 | } 17 | const namespan = `${options.name}`; 18 | 19 | return hexo.render 20 | .render({ text: content, engine: 'md' }) 21 | .then(function(markdownContent) { 22 | return `
    ${namespan}${typespan}
    ${markdownContent}
    `; 23 | }); 24 | }, 25 | { ends: true, async: true } 26 | ); 27 | -------------------------------------------------------------------------------- /src/simple-todos/step01/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@babel/runtime": "^7.15.4", 12 | "meteor-node-stubs": "^1.1.0", 13 | "react": "^17.0.2", 14 | "react-dom": "^17.0.2" 15 | }, 16 | "meteor": { 17 | "mainModule": { 18 | "client": "client/main.jsx", 19 | "server": "server/main.js" 20 | }, 21 | "testModule": "tests/main.js" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/simple-todos/step02/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@babel/runtime": "^7.15.4", 12 | "meteor-node-stubs": "^1.1.0", 13 | "react": "^17.0.2", 14 | "react-dom": "^17.0.2" 15 | }, 16 | "meteor": { 17 | "mainModule": { 18 | "client": "client/main.jsx", 19 | "server": "server/main.js" 20 | }, 21 | "testModule": "tests/main.js" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/simple-todos/step03/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@babel/runtime": "^7.15.4", 12 | "meteor-node-stubs": "^1.1.0", 13 | "react": "^17.0.2", 14 | "react-dom": "^17.0.2" 15 | }, 16 | "meteor": { 17 | "mainModule": { 18 | "client": "client/main.jsx", 19 | "server": "server/main.js" 20 | }, 21 | "testModule": "tests/main.js" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/simple-todos/step04/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@babel/runtime": "^7.15.4", 12 | "meteor-node-stubs": "^1.1.0", 13 | "react": "^17.0.2", 14 | "react-dom": "^17.0.2" 15 | }, 16 | "meteor": { 17 | "mainModule": { 18 | "client": "client/main.jsx", 19 | "server": "server/main.js" 20 | }, 21 | "testModule": "tests/main.js" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/simple-todos/step05/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@babel/runtime": "^7.15.4", 12 | "meteor-node-stubs": "^1.1.0", 13 | "react": "^17.0.2", 14 | "react-dom": "^17.0.2" 15 | }, 16 | "meteor": { 17 | "mainModule": { 18 | "client": "client/main.jsx", 19 | "server": "server/main.js" 20 | }, 21 | "testModule": "tests/main.js" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/simple-todos/step06/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@babel/runtime": "^7.15.4", 12 | "meteor-node-stubs": "^1.1.0", 13 | "react": "^17.0.2", 14 | "react-dom": "^17.0.2" 15 | }, 16 | "meteor": { 17 | "mainModule": { 18 | "client": "client/main.jsx", 19 | "server": "server/main.js" 20 | }, 21 | "testModule": "tests/main.js" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/simple-todos/step09/imports/ui/TaskForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | 4 | export const TaskForm = () => { 5 | const [text, setText] = useState(''); 6 | 7 | const handleSubmit = e => { 8 | e.preventDefault(); 9 | 10 | if (!text) return; 11 | 12 | Meteor.call('tasks.insert', text); 13 | 14 | setText(''); 15 | }; 16 | 17 | return ( 18 |
    19 | setText(e.target.value)} 24 | /> 25 | 26 | 27 |
    28 | ); 29 | }; 30 | -------------------------------------------------------------------------------- /src/simple-todos/step10/imports/ui/TaskForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | 4 | export const TaskForm = () => { 5 | const [text, setText] = useState(''); 6 | 7 | const handleSubmit = e => { 8 | e.preventDefault(); 9 | 10 | if (!text) return; 11 | 12 | Meteor.call('tasks.insert', text); 13 | 14 | setText(''); 15 | }; 16 | 17 | return ( 18 |
    19 | setText(e.target.value)} 24 | /> 25 | 26 | 27 |
    28 | ); 29 | }; 30 | -------------------------------------------------------------------------------- /src/simple-todos/step11/imports/ui/TaskForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | 4 | export const TaskForm = () => { 5 | const [text, setText] = useState(''); 6 | 7 | const handleSubmit = e => { 8 | e.preventDefault(); 9 | 10 | if (!text) return; 11 | 12 | Meteor.call('tasks.insert', text); 13 | 14 | setText(''); 15 | }; 16 | 17 | return ( 18 |
    19 | setText(e.target.value)} 24 | /> 25 | 26 | 27 |
    28 | ); 29 | }; 30 | -------------------------------------------------------------------------------- /src/simple-todos/step12/imports/ui/TaskForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | 4 | export const TaskForm = () => { 5 | const [text, setText] = useState(''); 6 | 7 | const handleSubmit = e => { 8 | e.preventDefault(); 9 | 10 | if (!text) return; 11 | 12 | Meteor.call('tasks.insert', text); 13 | 14 | setText(''); 15 | }; 16 | 17 | return ( 18 |
    19 | setText(e.target.value)} 24 | /> 25 | 26 | 27 |
    28 | ); 29 | }; 30 | -------------------------------------------------------------------------------- /src/simple-todos/step13/imports/ui/TaskForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | 4 | export const TaskForm = () => { 5 | const [text, setText] = useState(''); 6 | 7 | const handleSubmit = e => { 8 | e.preventDefault(); 9 | 10 | if (!text) return; 11 | 12 | Meteor.call('tasks.insert', text); 13 | 14 | setText(''); 15 | }; 16 | 17 | return ( 18 |
    19 | setText(e.target.value)} 24 | /> 25 | 26 | 27 |
    28 | ); 29 | }; 30 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/imports/ui/TaskForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | 4 | export const TaskForm = () => { 5 | const [text, setText] = useState(''); 6 | 7 | const handleSubmit = e => { 8 | e.preventDefault(); 9 | 10 | if (!text) return; 11 | 12 | Meteor.call('tasks.insert', text); 13 | 14 | setText(''); 15 | }; 16 | 17 | return ( 18 |
    19 | setText(e.target.value)} 24 | /> 25 | 26 | 27 |
    28 | ); 29 | }; 30 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/imports/ui/TaskForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | 4 | export const TaskForm = () => { 5 | const [text, setText] = useState(''); 6 | 7 | const handleSubmit = e => { 8 | e.preventDefault(); 9 | 10 | if (!text) return; 11 | 12 | Meteor.call('tasks.insert', text); 13 | 14 | setText(''); 15 | }; 16 | 17 | return ( 18 |
    19 | setText(e.target.value)} 24 | /> 25 | 26 | 27 |
    28 | ); 29 | }; 30 | -------------------------------------------------------------------------------- /src/simple-todos/step07/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@babel/runtime": "^7.15.4", 12 | "bcrypt": "^5.0.1", 13 | "meteor-node-stubs": "^1.1.0", 14 | "react": "^17.0.2", 15 | "react-dom": "^17.0.2" 16 | }, 17 | "meteor": { 18 | "mainModule": { 19 | "client": "client/main.jsx", 20 | "server": "server/main.js" 21 | }, 22 | "testModule": "tests/main.js" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/simple-todos/step08/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@babel/runtime": "^7.15.4", 12 | "bcrypt": "^5.0.1", 13 | "meteor-node-stubs": "^1.1.0", 14 | "react": "^17.0.2", 15 | "react-dom": "^17.0.2" 16 | }, 17 | "meteor": { 18 | "mainModule": { 19 | "client": "client/main.jsx", 20 | "server": "server/main.js" 21 | }, 22 | "testModule": "tests/main.js" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/simple-todos/step09/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@babel/runtime": "^7.15.4", 12 | "bcrypt": "^5.0.1", 13 | "meteor-node-stubs": "^1.1.0", 14 | "react": "^17.0.2", 15 | "react-dom": "^17.0.2" 16 | }, 17 | "meteor": { 18 | "mainModule": { 19 | "client": "client/main.jsx", 20 | "server": "server/main.js" 21 | }, 22 | "testModule": "tests/main.js" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/simple-todos/step10/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@babel/runtime": "^7.15.4", 12 | "bcrypt": "^5.0.1", 13 | "meteor-node-stubs": "^1.1.0", 14 | "react": "^17.0.2", 15 | "react-dom": "^17.0.2" 16 | }, 17 | "meteor": { 18 | "mainModule": { 19 | "client": "client/main.jsx", 20 | "server": "server/main.js" 21 | }, 22 | "testModule": "tests/main.js" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/simple-todos/step11/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@babel/runtime": "^7.15.4", 12 | "bcrypt": "^5.0.1", 13 | "meteor-node-stubs": "^1.1.0", 14 | "react": "^17.0.2", 15 | "react-dom": "^17.0.2" 16 | }, 17 | "meteor": { 18 | "mainModule": { 19 | "client": "client/main.jsx", 20 | "server": "server/main.js" 21 | }, 22 | "testModule": "tests/main.js" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/imports/ui/TaskForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | 4 | export const TaskForm = ({ refetch }) => { 5 | const [text, setText] = useState(''); 6 | 7 | const handleSubmit = e => { 8 | e.preventDefault(); 9 | 10 | if (!text) return; 11 | 12 | Meteor.call('tasks.insert', text); 13 | 14 | setText(''); 15 | refetch(); 16 | }; 17 | 18 | return ( 19 |
    20 | setText(e.target.value)} 25 | /> 26 | 27 | 28 |
    29 | ); 30 | }; 31 | -------------------------------------------------------------------------------- /src/simple-todos/step03/imports/ui/TaskForm.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { TasksCollection } from '/imports/api/TasksCollection'; 3 | 4 | export const TaskForm = () => { 5 | const [text, setText] = useState(''); 6 | 7 | const handleSubmit = e => { 8 | e.preventDefault(); 9 | 10 | if (!text) return; 11 | 12 | TasksCollection.insert({ 13 | text: text.trim(), 14 | createdAt: new Date(), 15 | }); 16 | 17 | setText(''); 18 | }; 19 | 20 | return ( 21 |
    22 | setText(e.target.value)} 27 | /> 28 | 29 | 30 |
    31 | ); 32 | }; 33 | -------------------------------------------------------------------------------- /src/simple-todos/step04/imports/ui/TaskForm.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { TasksCollection } from '/imports/api/TasksCollection'; 3 | 4 | export const TaskForm = () => { 5 | const [text, setText] = useState(''); 6 | 7 | const handleSubmit = e => { 8 | e.preventDefault(); 9 | 10 | if (!text) return; 11 | 12 | TasksCollection.insert({ 13 | text: text.trim(), 14 | createdAt: new Date(), 15 | }); 16 | 17 | setText(''); 18 | }; 19 | 20 | return ( 21 |
    22 | setText(e.target.value)} 27 | /> 28 | 29 | 30 |
    31 | ); 32 | }; 33 | -------------------------------------------------------------------------------- /src/simple-todos/step05/imports/ui/TaskForm.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { TasksCollection } from '/imports/api/TasksCollection'; 3 | 4 | export const TaskForm = () => { 5 | const [text, setText] = useState(''); 6 | 7 | const handleSubmit = e => { 8 | e.preventDefault(); 9 | 10 | if (!text) return; 11 | 12 | TasksCollection.insert({ 13 | text: text.trim(), 14 | createdAt: new Date(), 15 | }); 16 | 17 | setText(''); 18 | }; 19 | 20 | return ( 21 |
    22 | setText(e.target.value)} 27 | /> 28 | 29 | 30 |
    31 | ); 32 | }; 33 | -------------------------------------------------------------------------------- /src/simple-todos/step06/imports/ui/TaskForm.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { TasksCollection } from '/imports/api/TasksCollection'; 3 | 4 | export const TaskForm = () => { 5 | const [text, setText] = useState(''); 6 | 7 | const handleSubmit = e => { 8 | e.preventDefault(); 9 | 10 | if (!text) return; 11 | 12 | TasksCollection.insert({ 13 | text: text.trim(), 14 | createdAt: new Date(), 15 | }); 16 | 17 | setText(''); 18 | }; 19 | 20 | return ( 21 |
    22 | setText(e.target.value)} 27 | /> 28 | 29 | 30 |
    31 | ); 32 | }; 33 | -------------------------------------------------------------------------------- /src/simple-todos/step12/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@babel/runtime": "^7.15.4", 12 | "bcrypt": "^5.0.1", 13 | "meteor-node-stubs": "^1.1.0", 14 | "react": "^17.0.2", 15 | "react-dom": "^17.0.2" 16 | }, 17 | "meteor": { 18 | "mainModule": { 19 | "client": "client/main.jsx", 20 | "server": "server/main.js" 21 | }, 22 | "testModule": "tests/main.js" 23 | }, 24 | "devDependencies": { 25 | "chai": "^4.3.6" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/simple-todos/step13/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@babel/runtime": "^7.15.4", 12 | "bcrypt": "^5.0.1", 13 | "meteor-node-stubs": "^1.1.0", 14 | "react": "^17.0.2", 15 | "react-dom": "^17.0.2" 16 | }, 17 | "meteor": { 18 | "mainModule": { 19 | "client": "client/main.jsx", 20 | "server": "server/main.js" 21 | }, 22 | "testModule": "tests/main.js" 23 | }, 24 | "devDependencies": { 25 | "chai": "^4.3.6" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/simple-todos/step07/imports/ui/TaskForm.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { TasksCollection } from '/imports/api/TasksCollection'; 3 | 4 | export const TaskForm = ({user}) => { 5 | const [text, setText] = useState(''); 6 | 7 | const handleSubmit = e => { 8 | e.preventDefault(); 9 | 10 | if (!text) return; 11 | 12 | TasksCollection.insert({ 13 | text: text.trim(), 14 | createdAt: new Date(), 15 | userId: user._id 16 | }); 17 | 18 | setText(''); 19 | }; 20 | 21 | return ( 22 |
    23 | setText(e.target.value)} 28 | /> 29 | 30 | 31 |
    32 | ); 33 | }; 34 | -------------------------------------------------------------------------------- /src/simple-todos/step08/imports/ui/TaskForm.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { TasksCollection } from '/imports/api/TasksCollection'; 3 | 4 | export const TaskForm = ({user}) => { 5 | const [text, setText] = useState(''); 6 | 7 | const handleSubmit = e => { 8 | e.preventDefault(); 9 | 10 | if (!text) return; 11 | 12 | TasksCollection.insert({ 13 | text: text.trim(), 14 | createdAt: new Date(), 15 | userId: user._id 16 | }); 17 | 18 | setText(''); 19 | }; 20 | 21 | return ( 22 |
    23 | setText(e.target.value)} 28 | /> 29 | 30 | 31 |
    32 | ); 33 | }; 34 | -------------------------------------------------------------------------------- /src/simple-todos/step01/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { LinksCollection } from '/imports/api/links'; 3 | 4 | function insertLink({ title, url }) { 5 | LinksCollection.insert({ title, url, createdAt: new Date() }); 6 | } 7 | 8 | Meteor.startup(() => { 9 | // If the Links collection is empty, add some data. 10 | if (LinksCollection.find().count() === 0) { 11 | insertLink({ 12 | title: 'Do the Tutorial', 13 | url: 'https://www.meteor.com/tutorials/react/creating-an-app', 14 | }); 15 | 16 | insertLink({ 17 | title: 'Follow the Guide', 18 | url: 'http://guide.meteor.com', 19 | }); 20 | 21 | insertLink({ 22 | title: 'Read the Docs', 23 | url: 'https://docs.meteor.com', 24 | }); 25 | 26 | insertLink({ 27 | title: 'Discussions', 28 | url: 'https://forums.meteor.com', 29 | }); 30 | } 31 | }); 32 | -------------------------------------------------------------------------------- /src/simple-todos/step07/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { Accounts } from 'meteor/accounts-base'; 3 | import { TasksCollection } from '/imports/api/TasksCollection'; 4 | 5 | const insertTask = (taskText, user) => 6 | TasksCollection.insert({ 7 | text: taskText, 8 | userId: user._id, 9 | createdAt: new Date(), 10 | }); 11 | 12 | const SEED_USERNAME = 'meteorite'; 13 | const SEED_PASSWORD = 'password'; 14 | 15 | Meteor.startup(() => { 16 | if (!Accounts.findUserByUsername(SEED_USERNAME)) { 17 | Accounts.createUser({ 18 | username: SEED_USERNAME, 19 | password: SEED_PASSWORD, 20 | }); 21 | } 22 | 23 | const user = Accounts.findUserByUsername(SEED_USERNAME); 24 | 25 | if (TasksCollection.find().count() === 0) { 26 | [ 27 | 'First Task', 28 | 'Second Task', 29 | 'Third Task', 30 | 'Fourth Task', 31 | 'Fifth Task', 32 | 'Sixth Task', 33 | 'Seventh Task', 34 | ].forEach(taskText => insertTask(taskText, user)); 35 | } 36 | }); 37 | -------------------------------------------------------------------------------- /src/simple-todos/step04/imports/ui/App.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { useTracker } from 'meteor/react-meteor-data'; 3 | import { TasksCollection } from '/imports/api/TasksCollection'; 4 | import { Task } from './Task'; 5 | import { TaskForm } from './TaskForm'; 6 | 7 | const toggleChecked = ({ _id, isChecked }) => { 8 | TasksCollection.update(_id, { 9 | $set: { 10 | isChecked: !isChecked, 11 | }, 12 | }); 13 | }; 14 | 15 | const deleteTask = ({ _id }) => TasksCollection.remove(_id); 16 | 17 | export const App = () => { 18 | const tasks = useTracker(() => 19 | TasksCollection.find({}, { sort: { createdAt: -1 } }).fetch() 20 | ); 21 | 22 | return ( 23 |
    24 |

    Welcome to Meteor!

    25 | 26 | 27 | 28 |
      29 | {tasks.map(task => ( 30 | 36 | ))} 37 |
    38 |
    39 | ); 40 | }; 41 | -------------------------------------------------------------------------------- /src/simple-todos/step09/imports/api/tasksMethods.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { check } from 'meteor/check'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | 5 | Meteor.methods({ 6 | 'tasks.insert'(text) { 7 | check(text, String); 8 | 9 | if (!this.userId) { 10 | throw new Meteor.Error('Not authorized.'); 11 | } 12 | 13 | TasksCollection.insert({ 14 | text, 15 | createdAt: new Date(), 16 | userId: this.userId, 17 | }); 18 | }, 19 | 20 | 'tasks.remove'(taskId) { 21 | check(taskId, String); 22 | 23 | if (!this.userId) { 24 | throw new Meteor.Error('Not authorized.'); 25 | } 26 | 27 | TasksCollection.remove(taskId); 28 | }, 29 | 30 | 'tasks.setIsChecked'(taskId, isChecked) { 31 | check(taskId, String); 32 | check(isChecked, Boolean); 33 | 34 | if (!this.userId) { 35 | throw new Meteor.Error('Not authorized.'); 36 | } 37 | 38 | TasksCollection.update(taskId, { 39 | $set: { 40 | isChecked, 41 | }, 42 | }); 43 | }, 44 | }); 45 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@apollo/react-hooks": "^4.0.0", 12 | "@babel/runtime": "^7.15.4", 13 | "apollo-cache-inmemory": "^1.6.6", 14 | "apollo-client": "^2.6.10", 15 | "apollo-link-ddp": "^3.0.0", 16 | "apollo-link-error": "^1.1.13", 17 | "bcrypt": "^5.0.1", 18 | "graphql": "^15.8.0", 19 | "graphql-load": "^0.1.1", 20 | "graphql-tools": "^7.0.5", 21 | "meteor-node-stubs": "^1.1.0", 22 | "react": "^17.0.2", 23 | "react-dom": "^17.0.2" 24 | }, 25 | "meteor": { 26 | "mainModule": { 27 | "client": "client/main.jsx", 28 | "server": "server/main.js" 29 | }, 30 | "testModule": "tests/main.js" 31 | }, 32 | "devDependencies": { 33 | "chai": "^4.3.6" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@apollo/react-hooks": "^4.0.0", 12 | "@babel/runtime": "^7.15.4", 13 | "apollo-cache-inmemory": "^1.6.6", 14 | "apollo-client": "^2.6.10", 15 | "apollo-link-ddp": "^3.0.0", 16 | "apollo-link-error": "^1.1.13", 17 | "bcrypt": "^5.0.1", 18 | "graphql": "^15.8.0", 19 | "graphql-load": "^0.1.1", 20 | "graphql-tools": "^7.0.5", 21 | "meteor-node-stubs": "^1.1.0", 22 | "react": "^17.0.2", 23 | "react-dom": "^17.0.2" 24 | }, 25 | "meteor": { 26 | "mainModule": { 27 | "client": "client/main.jsx", 28 | "server": "server/main.js" 29 | }, 30 | "testModule": "tests/main.js" 31 | }, 32 | "devDependencies": { 33 | "chai": "^4.3.6" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/imports/api/tasksMethods.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { check } from 'meteor/check'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | 5 | Meteor.methods({ 6 | 'tasks.remove'(taskId) { 7 | check(taskId, String); 8 | 9 | if (!this.userId) { 10 | throw new Meteor.Error('Not authorized.'); 11 | } 12 | 13 | const task = TasksCollection.findOne({ _id: taskId, userId: this.userId }); 14 | 15 | if (!task) { 16 | throw new Meteor.Error('Access denied.'); 17 | } 18 | 19 | TasksCollection.remove(taskId); 20 | }, 21 | 22 | 'tasks.setIsChecked'(taskId, isChecked) { 23 | check(taskId, String); 24 | check(isChecked, Boolean); 25 | 26 | if (!this.userId) { 27 | throw new Meteor.Error('Not authorized.'); 28 | } 29 | 30 | const task = TasksCollection.findOne({ _id: taskId, userId: this.userId }); 31 | 32 | if (!task) { 33 | throw new Meteor.Error('Access denied.'); 34 | } 35 | 36 | TasksCollection.update(taskId, { 37 | $set: { 38 | isChecked, 39 | }, 40 | }); 41 | }, 42 | }); 43 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { Accounts } from 'meteor/accounts-base'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | import '/imports/api/graphql'; 5 | import '/imports/api/tasksMethods'; 6 | import '/imports/api/tasksPublications'; 7 | 8 | const insertTask = (taskText, user) => 9 | TasksCollection.insert({ 10 | text: taskText, 11 | userId: user._id, 12 | createdAt: new Date(), 13 | }); 14 | 15 | const SEED_USERNAME = 'meteorite'; 16 | const SEED_PASSWORD = 'password'; 17 | 18 | Meteor.startup(() => { 19 | if (!Accounts.findUserByUsername(SEED_USERNAME)) { 20 | Accounts.createUser({ 21 | username: SEED_USERNAME, 22 | password: SEED_PASSWORD, 23 | }); 24 | } 25 | 26 | const user = Accounts.findUserByUsername(SEED_USERNAME); 27 | 28 | if (TasksCollection.find().count() === 0) { 29 | [ 30 | 'First Task', 31 | 'Second Task', 32 | 'Third Task', 33 | 'Fourth Task', 34 | 'Fifth Task', 35 | 'Sixth Task', 36 | 'Seventh Task', 37 | ].forEach(taskText => insertTask(taskText, user)); 38 | } 39 | }); 40 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { Accounts } from 'meteor/accounts-base'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | import '/imports/api/graphql'; 5 | import '/imports/api/tasksMethods'; 6 | import '/imports/api/tasksPublications'; 7 | 8 | const insertTask = (taskText, user) => 9 | TasksCollection.insert({ 10 | text: taskText, 11 | userId: user._id, 12 | createdAt: new Date(), 13 | }); 14 | 15 | const SEED_USERNAME = 'meteorite'; 16 | const SEED_PASSWORD = 'password'; 17 | 18 | Meteor.startup(() => { 19 | if (!Accounts.findUserByUsername(SEED_USERNAME)) { 20 | Accounts.createUser({ 21 | username: SEED_USERNAME, 22 | password: SEED_PASSWORD, 23 | }); 24 | } 25 | 26 | const user = Accounts.findUserByUsername(SEED_USERNAME); 27 | 28 | if (TasksCollection.find().count() === 0) { 29 | [ 30 | 'First Task', 31 | 'Second Task', 32 | 'Third Task', 33 | 'Fourth Task', 34 | 'Fifth Task', 35 | 'Sixth Task', 36 | 'Seventh Task', 37 | ].forEach(taskText => insertTask(taskText, user)); 38 | } 39 | }); 40 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { Accounts } from 'meteor/accounts-base'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | import '/imports/api/graphql'; 5 | import '/imports/api/tasksMethods'; 6 | import '/imports/api/tasksPublications'; 7 | 8 | const insertTask = (taskText, user) => 9 | TasksCollection.insert({ 10 | text: taskText, 11 | userId: user._id, 12 | createdAt: new Date(), 13 | }); 14 | 15 | const SEED_USERNAME = 'meteorite'; 16 | const SEED_PASSWORD = 'password'; 17 | 18 | Meteor.startup(() => { 19 | if (!Accounts.findUserByUsername(SEED_USERNAME)) { 20 | Accounts.createUser({ 21 | username: SEED_USERNAME, 22 | password: SEED_PASSWORD, 23 | }); 24 | } 25 | 26 | const user = Accounts.findUserByUsername(SEED_USERNAME); 27 | 28 | if (TasksCollection.find().count() === 0) { 29 | [ 30 | 'First Task', 31 | 'Second Task', 32 | 'Third Task', 33 | 'Fourth Task', 34 | 'Fifth Task', 35 | 'Sixth Task', 36 | 'Seventh Task', 37 | ].forEach(taskText => insertTask(taskText, user)); 38 | } 39 | }); 40 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { Accounts } from 'meteor/accounts-base'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | import '/imports/api/graphql'; 5 | import '/imports/api/tasksMethods'; 6 | import '/imports/api/tasksPublications'; 7 | 8 | const insertTask = (taskText, user) => 9 | TasksCollection.insert({ 10 | text: taskText, 11 | userId: user._id, 12 | createdAt: new Date(), 13 | }); 14 | 15 | const SEED_USERNAME = 'meteorite'; 16 | const SEED_PASSWORD = 'password'; 17 | 18 | Meteor.startup(() => { 19 | if (!Accounts.findUserByUsername(SEED_USERNAME)) { 20 | Accounts.createUser({ 21 | username: SEED_USERNAME, 22 | password: SEED_PASSWORD, 23 | }); 24 | } 25 | 26 | const user = Accounts.findUserByUsername(SEED_USERNAME); 27 | 28 | if (TasksCollection.find().count() === 0) { 29 | [ 30 | 'First Task', 31 | 'Second Task', 32 | 'Third Task', 33 | 'Fourth Task', 34 | 'Fifth Task', 35 | 'Sixth Task', 36 | 'Seventh Task', 37 | ].forEach(taskText => insertTask(taskText, user)); 38 | } 39 | }); 40 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@apollo/react-hooks": "^4.0.0", 12 | "@babel/runtime": "^7.15.4", 13 | "apollo-cache-inmemory": "^1.6.6", 14 | "apollo-client": "^2.6.10", 15 | "apollo-link-ddp": "^3.0.0", 16 | "apollo-link-error": "^1.1.13", 17 | "bcrypt": "^5.0.1", 18 | "graphql": "^15.8.0", 19 | "graphql-load": "^0.1.1", 20 | "graphql-tag": "^2.12.6", 21 | "graphql-tools": "^7.0.5", 22 | "meteor-node-stubs": "^1.1.0", 23 | "react": "^17.0.2", 24 | "react-dom": "^17.0.2" 25 | }, 26 | "meteor": { 27 | "mainModule": { 28 | "client": "client/main.jsx", 29 | "server": "server/main.js" 30 | }, 31 | "testModule": "tests/main.js" 32 | }, 33 | "devDependencies": { 34 | "chai": "^4.3.6" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-todos-react", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "meteor test --once --driver-package meteortesting:mocha", 7 | "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", 8 | "visualize": "meteor --production --extra-packages bundle-visualizer" 9 | }, 10 | "dependencies": { 11 | "@apollo/react-hooks": "^4.0.0", 12 | "@babel/runtime": "^7.15.4", 13 | "apollo-cache-inmemory": "^1.6.6", 14 | "apollo-client": "^2.6.10", 15 | "apollo-link-ddp": "^3.0.0", 16 | "apollo-link-error": "^1.1.13", 17 | "bcrypt": "^5.0.1", 18 | "graphql": "^15.8.0", 19 | "graphql-load": "^0.1.1", 20 | "graphql-tag": "^2.12.6", 21 | "graphql-tools": "^7.0.5", 22 | "meteor-node-stubs": "^1.1.0", 23 | "react": "^17.0.2", 24 | "react-dom": "^17.0.2" 25 | }, 26 | "meteor": { 27 | "mainModule": { 28 | "client": "client/main.jsx", 29 | "server": "server/main.js" 30 | }, 31 | "testModule": "tests/main.js" 32 | }, 33 | "devDependencies": { 34 | "chai": "^4.3.6" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/simple-todos/step07/imports/ui/LoginForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | 4 | export const LoginForm = () => { 5 | const [username, setUsername] = useState(''); 6 | const [password, setPassword] = useState(''); 7 | 8 | const submit = e => { 9 | e.preventDefault(); 10 | 11 | Meteor.loginWithPassword(username, password); 12 | }; 13 | 14 | return ( 15 |
    16 |
    17 | 18 | setUsername(e.target.value)} 24 | /> 25 |
    26 | 27 |
    28 | 29 | 30 | setPassword(e.target.value)} 36 | /> 37 |
    38 |
    39 | 40 |
    41 |
    42 | ); 43 | }; 44 | -------------------------------------------------------------------------------- /src/simple-todos/step11/imports/ui/LoginForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | 4 | export const LoginForm = () => { 5 | const [username, setUsername] = useState(''); 6 | const [password, setPassword] = useState(''); 7 | 8 | const submit = e => { 9 | e.preventDefault(); 10 | 11 | Meteor.loginWithPassword(username, password); 12 | }; 13 | 14 | return ( 15 |
    16 |
    17 | 18 | setUsername(e.target.value)} 24 | /> 25 |
    26 | 27 |
    28 | 29 | 30 | setPassword(e.target.value)} 36 | /> 37 |
    38 |
    39 | 40 |
    41 |
    42 | ); 43 | }; 44 | -------------------------------------------------------------------------------- /src/simple-todos/step12/imports/ui/LoginForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | 4 | export const LoginForm = () => { 5 | const [username, setUsername] = useState(''); 6 | const [password, setPassword] = useState(''); 7 | 8 | const submit = e => { 9 | e.preventDefault(); 10 | 11 | Meteor.loginWithPassword(username, password); 12 | }; 13 | 14 | return ( 15 |
    16 |
    17 | 18 | setUsername(e.target.value)} 24 | /> 25 |
    26 | 27 |
    28 | 29 | 30 | setPassword(e.target.value)} 36 | /> 37 |
    38 |
    39 | 40 |
    41 |
    42 | ); 43 | }; 44 | -------------------------------------------------------------------------------- /src/simple-todos/step13/imports/ui/LoginForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | 4 | export const LoginForm = () => { 5 | const [username, setUsername] = useState(''); 6 | const [password, setPassword] = useState(''); 7 | 8 | const submit = e => { 9 | e.preventDefault(); 10 | 11 | Meteor.loginWithPassword(username, password); 12 | }; 13 | 14 | return ( 15 |
    16 |
    17 | 18 | setUsername(e.target.value)} 24 | /> 25 |
    26 | 27 |
    28 | 29 | 30 | setPassword(e.target.value)} 36 | /> 37 |
    38 |
    39 | 40 |
    41 |
    42 | ); 43 | }; 44 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/imports/ui/LoginForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | 4 | export const LoginForm = () => { 5 | const [username, setUsername] = useState(''); 6 | const [password, setPassword] = useState(''); 7 | 8 | const submit = e => { 9 | e.preventDefault(); 10 | 11 | Meteor.loginWithPassword(username, password); 12 | }; 13 | 14 | return ( 15 |
    16 |
    17 | 18 | setUsername(e.target.value)} 24 | /> 25 |
    26 | 27 |
    28 | 29 | 30 | setPassword(e.target.value)} 36 | /> 37 |
    38 |
    39 | 40 |
    41 |
    42 | ); 43 | }; 44 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/imports/ui/LoginForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | 4 | export const LoginForm = () => { 5 | const [username, setUsername] = useState(''); 6 | const [password, setPassword] = useState(''); 7 | 8 | const submit = e => { 9 | e.preventDefault(); 10 | 11 | Meteor.loginWithPassword(username, password); 12 | }; 13 | 14 | return ( 15 |
    16 |
    17 | 18 | setUsername(e.target.value)} 24 | /> 25 |
    26 | 27 |
    28 | 29 | 30 | setPassword(e.target.value)} 36 | /> 37 |
    38 |
    39 | 40 |
    41 |
    42 | ); 43 | }; 44 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/imports/ui/LoginForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | 4 | export const LoginForm = () => { 5 | const [username, setUsername] = useState(''); 6 | const [password, setPassword] = useState(''); 7 | 8 | const submit = e => { 9 | e.preventDefault(); 10 | 11 | Meteor.loginWithPassword(username, password); 12 | }; 13 | 14 | return ( 15 |
    16 |
    17 | 18 | setUsername(e.target.value)} 24 | /> 25 |
    26 | 27 |
    28 | 29 | 30 | setPassword(e.target.value)} 36 | /> 37 |
    38 |
    39 | 40 |
    41 |
    42 | ); 43 | }; 44 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/imports/ui/LoginForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | 4 | export const LoginForm = () => { 5 | const [username, setUsername] = useState(''); 6 | const [password, setPassword] = useState(''); 7 | 8 | const submit = e => { 9 | e.preventDefault(); 10 | 11 | Meteor.loginWithPassword(username, password); 12 | }; 13 | 14 | return ( 15 |
    16 |
    17 | 18 | setUsername(e.target.value)} 24 | /> 25 |
    26 | 27 |
    28 | 29 | 30 | setPassword(e.target.value)} 36 | /> 37 |
    38 |
    39 | 40 |
    41 |
    42 | ); 43 | }; 44 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/imports/ui/TaskForm.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import gql from "graphql-tag"; 3 | import { useMutation } from "@apollo/react-hooks"; 4 | 5 | const taskMutation = gql` 6 | mutation AddTask($text: String!) { 7 | addTask(text: $text) { 8 | _id 9 | } 10 | } 11 | ` 12 | 13 | export const TaskForm = () => { 14 | const [addTaskMutation] = useMutation(taskMutation); 15 | const [text, setText] = useState(''); 16 | 17 | const handleSubmit = e => { 18 | e.preventDefault(); 19 | 20 | if (!text) return; 21 | 22 | addTaskMutation({ 23 | variables: { 24 | text, 25 | }, 26 | refetchQueries: () => ['Tasks'] 27 | }) 28 | .then(() => console.log('Task added with success')) 29 | .catch(e => console.error('Error trying to add task', e)); 30 | 31 | setText(''); 32 | }; 33 | 34 | return ( 35 |
    36 | setText(e.target.value)} 41 | /> 42 | 43 | 44 |
    45 | ); 46 | }; 47 | -------------------------------------------------------------------------------- /src/simple-todos/step08/imports/ui/LoginForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | import { LoginWithGithub } from './LoginWithGithub'; 4 | 5 | export const LoginForm = () => { 6 | const [username, setUsername] = useState(''); 7 | const [password, setPassword] = useState(''); 8 | 9 | const submit = e => { 10 | e.preventDefault(); 11 | 12 | Meteor.loginWithPassword(username, password); 13 | }; 14 | 15 | return ( 16 |
    17 | 18 |
    19 | 20 | setUsername(e.target.value)} 26 | /> 27 |
    28 | 29 |
    30 | 31 | 32 | setPassword(e.target.value)} 38 | /> 39 |
    40 |
    41 | 42 |
    43 | 44 | ); 45 | }; 46 | -------------------------------------------------------------------------------- /src/simple-todos/step09/imports/ui/LoginForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | import { LoginWithGithub } from './LoginWithGithub'; 4 | 5 | export const LoginForm = () => { 6 | const [username, setUsername] = useState(''); 7 | const [password, setPassword] = useState(''); 8 | 9 | const submit = e => { 10 | e.preventDefault(); 11 | 12 | Meteor.loginWithPassword(username, password); 13 | }; 14 | 15 | return ( 16 |
    17 | 18 |
    19 | 20 | setUsername(e.target.value)} 26 | /> 27 |
    28 | 29 |
    30 | 31 | 32 | setPassword(e.target.value)} 38 | /> 39 |
    40 |
    41 | 42 |
    43 | 44 | ); 45 | }; 46 | -------------------------------------------------------------------------------- /src/simple-todos/step10/imports/ui/LoginForm.jsx: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import React, { useState } from 'react'; 3 | import { LoginWithGithub } from './LoginWithGithub'; 4 | 5 | export const LoginForm = () => { 6 | const [username, setUsername] = useState(''); 7 | const [password, setPassword] = useState(''); 8 | 9 | const submit = e => { 10 | e.preventDefault(); 11 | 12 | Meteor.loginWithPassword(username, password); 13 | }; 14 | 15 | return ( 16 |
    17 | 18 |
    19 | 20 | setUsername(e.target.value)} 26 | /> 27 |
    28 | 29 |
    30 | 31 | 32 | setPassword(e.target.value)} 38 | /> 39 |
    40 |
    41 | 42 |
    43 | 44 | ); 45 | }; 46 | -------------------------------------------------------------------------------- /src/simple-todos/step05/imports/ui/App.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { useTracker } from 'meteor/react-meteor-data'; 3 | import { TasksCollection } from '/imports/api/TasksCollection'; 4 | import { Task } from './Task'; 5 | import { TaskForm } from './TaskForm'; 6 | 7 | const toggleChecked = ({ _id, isChecked }) => { 8 | TasksCollection.update(_id, { 9 | $set: { 10 | isChecked: !isChecked, 11 | }, 12 | }); 13 | }; 14 | 15 | const deleteTask = ({ _id }) => TasksCollection.remove(_id); 16 | 17 | export const App = () => { 18 | const tasks = useTracker(() => 19 | TasksCollection.find({}, { sort: { createdAt: -1 } }).fetch() 20 | ); 21 | 22 | return ( 23 |
    24 |
    25 |
    26 |
    27 |

    📝️ To Do List

    28 |
    29 |
    30 |
    31 | 32 |
    33 | 34 | 35 |
      36 | {tasks.map(task => ( 37 | 43 | ))} 44 |
    45 |
    46 |
    47 | ); 48 | }; 49 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | title: Meteor React Tutorial 2 | subtitle: React Tutorial 3 | versions: 4 | - '1' 5 | versioned-netlify-redirects: 6 | netlify_site_id: meteor-react-tutorial 7 | 8 | logo: 9 | title: 10 | subtitle: React Tutorial 11 | 12 | sidebar_categories: 13 | null: 14 | - index 15 | Simple Todos: 16 | - simple-todos/01-creating-app 17 | - simple-todos/02-collections 18 | - simple-todos/03-forms-and-events 19 | - simple-todos/04-update-and-remove 20 | - simple-todos/05-styles 21 | - simple-todos/06-filter-tasks 22 | - simple-todos/07-adding-user-accounts 23 | - simple-todos/08-adding-login-with-github 24 | - simple-todos/09-methods 25 | - simple-todos/10-publications 26 | - simple-todos/11-running-on-mobile 27 | - simple-todos/12-testing 28 | - simple-todos/13-deploying 29 | - simple-todos/14-next-steps 30 | Simple Todos with GraphQL: 31 | - simple-todos-graphql/index 32 | - simple-todos-graphql/01-graphql-setup 33 | - simple-todos-graphql/02-specific-data 34 | - simple-todos-graphql/03-first-query 35 | - simple-todos-graphql/04-first-mutation 36 | - simple-todos-graphql/05-next-steps 37 | github_repo: 'meteor/react-tutorial' 38 | 39 | url: http://react-tutorial.meteor.com/ 40 | root: / 41 | 42 | source_dir: tutorial 43 | content_root: tutorial 44 | 45 | highlight: 46 | enable: false 47 | -------------------------------------------------------------------------------- /src/simple-todos/step09/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { Accounts } from 'meteor/accounts-base'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | import { ServiceConfiguration } from 'meteor/service-configuration'; 5 | import '/imports/api/tasksMethods'; 6 | 7 | const insertTask = (taskText, user) => 8 | TasksCollection.insert({ 9 | text: taskText, 10 | userId: user._id, 11 | createdAt: new Date(), 12 | }); 13 | 14 | const SEED_USERNAME = 'meteorite'; 15 | const SEED_PASSWORD = 'password'; 16 | 17 | Meteor.startup(() => { 18 | if (!Accounts.findUserByUsername(SEED_USERNAME)) { 19 | Accounts.createUser({ 20 | username: SEED_USERNAME, 21 | password: SEED_PASSWORD, 22 | }); 23 | } 24 | 25 | const user = Accounts.findUserByUsername(SEED_USERNAME); 26 | 27 | if (TasksCollection.find().count() === 0) { 28 | [ 29 | 'First Task', 30 | 'Second Task', 31 | 'Third Task', 32 | 'Fourth Task', 33 | 'Fifth Task', 34 | 'Sixth Task', 35 | 'Seventh Task', 36 | ].forEach(taskText => insertTask(taskText, user)); 37 | } 38 | }); 39 | 40 | ServiceConfiguration.configurations.upsert( 41 | { service: 'github' }, 42 | { 43 | $set: { 44 | loginStyle: 'popup', 45 | clientId: '', // insert your clientId here 46 | secret: '', // insert your secret here 47 | }, 48 | } 49 | ); 50 | -------------------------------------------------------------------------------- /src/simple-todos/step10/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | static-html@1.3.2 # Define static page content in .html files 21 | react-meteor-data # React higher-order component for reactively tracking Meteor data 22 | accounts-password@2.3.1 23 | dev-error-overlay@0.1.1 24 | accounts-github 25 | service-configuration 26 | -------------------------------------------------------------------------------- /src/simple-todos/step11/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | static-html@1.3.2 # Define static page content in .html files 21 | react-meteor-data # React higher-order component for reactively tracking Meteor data 22 | accounts-password@2.3.1 23 | dev-error-overlay@0.1.1 24 | accounts-github 25 | service-configuration 26 | -------------------------------------------------------------------------------- /src/simple-todos/step08/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { Accounts } from 'meteor/accounts-base'; 3 | import { TasksCollection } from '/imports/api/TasksCollection'; 4 | import { ServiceConfiguration } from 'meteor/service-configuration'; 5 | 6 | const insertTask = (taskText, user) => 7 | TasksCollection.insert({ 8 | text: taskText, 9 | userId: user._id, 10 | createdAt: new Date(), 11 | }); 12 | 13 | const SEED_USERNAME = 'meteorite'; 14 | const SEED_PASSWORD = 'password'; 15 | 16 | Meteor.startup(() => { 17 | if (!Accounts.findUserByUsername(SEED_USERNAME)) { 18 | Accounts.createUser({ 19 | username: SEED_USERNAME, 20 | password: SEED_PASSWORD, 21 | }); 22 | } 23 | 24 | const user = Accounts.findUserByUsername(SEED_USERNAME); 25 | 26 | if (TasksCollection.find().count() === 0) { 27 | [ 28 | 'First Task', 29 | 'Second Task', 30 | 'Third Task', 31 | 'Fourth Task', 32 | 'Fifth Task', 33 | 'Sixth Task', 34 | 'Seventh Task', 35 | ].forEach(taskText => insertTask(taskText, user)); 36 | } 37 | }); 38 | 39 | ServiceConfiguration.configurations.upsert( 40 | { service: 'github' }, 41 | { 42 | $set: { 43 | loginStyle: 'popup', 44 | clientId: '4b9f9c09485b4bba83ba', // insert your clientId here 45 | secret: 'f9205f6f03b6c45547e70efe1171dbe0409440df', // insert your secret here 46 | }, 47 | } 48 | ); 49 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | static-html@1.3.2 # Define static page content in .html files 21 | react-meteor-data # React higher-order component for reactively tracking Meteor data 22 | accounts-password@2.3.1 23 | meteortesting:mocha 24 | quave:testing 25 | dev-error-overlay@0.1.1 26 | quave:graphql 27 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | static-html@1.3.2 # Define static page content in .html files 21 | react-meteor-data # React higher-order component for reactively tracking Meteor data 22 | accounts-password@2.3.1 23 | meteortesting:mocha 24 | quave:testing 25 | dev-error-overlay@0.1.1 26 | quave:graphql 27 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | static-html@1.3.2 # Define static page content in .html files 21 | react-meteor-data # React higher-order component for reactively tracking Meteor data 22 | accounts-password@2.3.1 23 | meteortesting:mocha 24 | quave:testing 25 | dev-error-overlay@0.1.1 26 | quave:graphql 27 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step04/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | static-html@1.3.2 # Define static page content in .html files 21 | react-meteor-data # React higher-order component for reactively tracking Meteor data 22 | accounts-password@2.3.1 23 | meteortesting:mocha 24 | quave:testing 25 | dev-error-overlay@0.1.1 26 | quave:graphql 27 | -------------------------------------------------------------------------------- /src/simple-todos/step10/imports/api/tasksMethods.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { check } from 'meteor/check'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | 5 | Meteor.methods({ 6 | 'tasks.insert'(text) { 7 | check(text, String); 8 | 9 | if (!this.userId) { 10 | throw new Meteor.Error('Not authorized.'); 11 | } 12 | 13 | TasksCollection.insert({ 14 | text, 15 | createdAt: new Date(), 16 | userId: this.userId, 17 | }); 18 | }, 19 | 20 | 'tasks.remove'(taskId) { 21 | check(taskId, String); 22 | 23 | if (!this.userId) { 24 | throw new Meteor.Error('Not authorized.'); 25 | } 26 | 27 | const task = TasksCollection.findOne({ _id: taskId, userId: this.userId }); 28 | 29 | if (!task) { 30 | throw new Meteor.Error('Access denied.'); 31 | } 32 | 33 | TasksCollection.remove(taskId); 34 | }, 35 | 36 | 'tasks.setIsChecked'(taskId, isChecked) { 37 | check(taskId, String); 38 | check(isChecked, Boolean); 39 | 40 | if (!this.userId) { 41 | throw new Meteor.Error('Not authorized.'); 42 | } 43 | 44 | const task = TasksCollection.findOne({ _id: taskId, userId: this.userId }); 45 | 46 | if (!task) { 47 | throw new Meteor.Error('Access denied.'); 48 | } 49 | 50 | TasksCollection.update(taskId, { 51 | $set: { 52 | isChecked, 53 | }, 54 | }); 55 | }, 56 | }); 57 | -------------------------------------------------------------------------------- /src/simple-todos/step11/imports/api/tasksMethods.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { check } from 'meteor/check'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | 5 | Meteor.methods({ 6 | 'tasks.insert'(text) { 7 | check(text, String); 8 | 9 | if (!this.userId) { 10 | throw new Meteor.Error('Not authorized.'); 11 | } 12 | 13 | TasksCollection.insert({ 14 | text, 15 | createdAt: new Date(), 16 | userId: this.userId, 17 | }); 18 | }, 19 | 20 | 'tasks.remove'(taskId) { 21 | check(taskId, String); 22 | 23 | if (!this.userId) { 24 | throw new Meteor.Error('Not authorized.'); 25 | } 26 | 27 | const task = TasksCollection.findOne({ _id: taskId, userId: this.userId }); 28 | 29 | if (!task) { 30 | throw new Meteor.Error('Access denied.'); 31 | } 32 | 33 | TasksCollection.remove(taskId); 34 | }, 35 | 36 | 'tasks.setIsChecked'(taskId, isChecked) { 37 | check(taskId, String); 38 | check(isChecked, Boolean); 39 | 40 | if (!this.userId) { 41 | throw new Meteor.Error('Not authorized.'); 42 | } 43 | 44 | const task = TasksCollection.findOne({ _id: taskId, userId: this.userId }); 45 | 46 | if (!task) { 47 | throw new Meteor.Error('Access denied.'); 48 | } 49 | 50 | TasksCollection.update(taskId, { 51 | $set: { 52 | isChecked, 53 | }, 54 | }); 55 | }, 56 | }); 57 | -------------------------------------------------------------------------------- /src/simple-todos/step12/imports/api/tasksMethods.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { check } from 'meteor/check'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | 5 | Meteor.methods({ 6 | 'tasks.insert'(text) { 7 | check(text, String); 8 | 9 | if (!this.userId) { 10 | throw new Meteor.Error('Not authorized.'); 11 | } 12 | 13 | TasksCollection.insert({ 14 | text, 15 | createdAt: new Date(), 16 | userId: this.userId, 17 | }); 18 | }, 19 | 20 | 'tasks.remove'(taskId) { 21 | check(taskId, String); 22 | 23 | if (!this.userId) { 24 | throw new Meteor.Error('Not authorized.'); 25 | } 26 | 27 | const task = TasksCollection.findOne({ _id: taskId, userId: this.userId }); 28 | 29 | if (!task) { 30 | throw new Meteor.Error('Access denied.'); 31 | } 32 | 33 | TasksCollection.remove(taskId); 34 | }, 35 | 36 | 'tasks.setIsChecked'(taskId, isChecked) { 37 | check(taskId, String); 38 | check(isChecked, Boolean); 39 | 40 | if (!this.userId) { 41 | throw new Meteor.Error('Not authorized.'); 42 | } 43 | 44 | const task = TasksCollection.findOne({ _id: taskId, userId: this.userId }); 45 | 46 | if (!task) { 47 | throw new Meteor.Error('Access denied.'); 48 | } 49 | 50 | TasksCollection.update(taskId, { 51 | $set: { 52 | isChecked, 53 | }, 54 | }); 55 | }, 56 | }); 57 | -------------------------------------------------------------------------------- /src/simple-todos/step13/imports/api/tasksMethods.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { check } from 'meteor/check'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | 5 | Meteor.methods({ 6 | 'tasks.insert'(text) { 7 | check(text, String); 8 | 9 | if (!this.userId) { 10 | throw new Meteor.Error('Not authorized.'); 11 | } 12 | 13 | TasksCollection.insert({ 14 | text, 15 | createdAt: new Date(), 16 | userId: this.userId, 17 | }); 18 | }, 19 | 20 | 'tasks.remove'(taskId) { 21 | check(taskId, String); 22 | 23 | if (!this.userId) { 24 | throw new Meteor.Error('Not authorized.'); 25 | } 26 | 27 | const task = TasksCollection.findOne({ _id: taskId, userId: this.userId }); 28 | 29 | if (!task) { 30 | throw new Meteor.Error('Access denied.'); 31 | } 32 | 33 | TasksCollection.remove(taskId); 34 | }, 35 | 36 | 'tasks.setIsChecked'(taskId, isChecked) { 37 | check(taskId, String); 38 | check(isChecked, Boolean); 39 | 40 | if (!this.userId) { 41 | throw new Meteor.Error('Not authorized.'); 42 | } 43 | 44 | const task = TasksCollection.findOne({ _id: taskId, userId: this.userId }); 45 | 46 | if (!task) { 47 | throw new Meteor.Error('Access denied.'); 48 | } 49 | 50 | TasksCollection.update(taskId, { 51 | $set: { 52 | isChecked, 53 | }, 54 | }); 55 | }, 56 | }); 57 | -------------------------------------------------------------------------------- /tutorial/simple-todos/14-next-steps.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "14: Next Steps" 3 | --- 4 | 5 | Congratulations on your newly built Meteor app and it is running on Galaxy! Wow! 6 | 7 | Your app currently supports adding private tasks for the authenticated user. 8 | 9 | Ideas for new features: 10 | - Style completed tasks to be more evident the state; 11 | - In the login form also add the option to create a new user; 12 | - Share a task with someone else. 13 | 14 | Things to do on Galaxy: 15 | - Check your logs on Galaxy, watch [here](https://www.youtube.com/watch?v=WPYyHeWM21Q) or read [here](https://cloud-guide.meteor.com/logs.html); 16 | - Set up your free SSL certificate so you can use `https`, read [here](https://cloud-guide.meteor.com/encryption.html) 17 | - Set up your notifications, read [here](https://cloud-guide.meteor.com/notifications.html) 18 | - Auto scale your app based on demand, watch [here](https://www.youtube.com/watch?v=rwLoviLzG6s) or read [here](https://cloud-guide.meteor.com/triggers.html); 19 | - Go Professional and watch your metrics on APM, read [here](https://cloud-guide.meteor.com/apm-getting-started.html). 20 | - Check all the Galaxy guide for [more](https://cloud-guide.meteor.com/). 21 | 22 | Here are some options for where you can go next: 23 | 24 | 1. Read the [Meteor Guide](https://guide.meteor.com/) to learn about best practices and useful community packages 25 | 2. Check out the [complete documentation](https://docs.meteor.com/) 26 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step01/imports/api/tasksMethods.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { check } from 'meteor/check'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | 5 | Meteor.methods({ 6 | 'tasks.insert'(text) { 7 | check(text, String); 8 | 9 | if (!this.userId) { 10 | throw new Meteor.Error('Not authorized.'); 11 | } 12 | 13 | TasksCollection.insert({ 14 | text, 15 | createdAt: new Date(), 16 | userId: this.userId, 17 | }); 18 | }, 19 | 20 | 'tasks.remove'(taskId) { 21 | check(taskId, String); 22 | 23 | if (!this.userId) { 24 | throw new Meteor.Error('Not authorized.'); 25 | } 26 | 27 | const task = TasksCollection.findOne({ _id: taskId, userId: this.userId }); 28 | 29 | if (!task) { 30 | throw new Meteor.Error('Access denied.'); 31 | } 32 | 33 | TasksCollection.remove(taskId); 34 | }, 35 | 36 | 'tasks.setIsChecked'(taskId, isChecked) { 37 | check(taskId, String); 38 | check(isChecked, Boolean); 39 | 40 | if (!this.userId) { 41 | throw new Meteor.Error('Not authorized.'); 42 | } 43 | 44 | const task = TasksCollection.findOne({ _id: taskId, userId: this.userId }); 45 | 46 | if (!task) { 47 | throw new Meteor.Error('Access denied.'); 48 | } 49 | 50 | TasksCollection.update(taskId, { 51 | $set: { 52 | isChecked, 53 | }, 54 | }); 55 | }, 56 | }); 57 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step02/imports/api/tasksMethods.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { check } from 'meteor/check'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | 5 | Meteor.methods({ 6 | 'tasks.insert'(text) { 7 | check(text, String); 8 | 9 | if (!this.userId) { 10 | throw new Meteor.Error('Not authorized.'); 11 | } 12 | 13 | TasksCollection.insert({ 14 | text, 15 | createdAt: new Date(), 16 | userId: this.userId, 17 | }); 18 | }, 19 | 20 | 'tasks.remove'(taskId) { 21 | check(taskId, String); 22 | 23 | if (!this.userId) { 24 | throw new Meteor.Error('Not authorized.'); 25 | } 26 | 27 | const task = TasksCollection.findOne({ _id: taskId, userId: this.userId }); 28 | 29 | if (!task) { 30 | throw new Meteor.Error('Access denied.'); 31 | } 32 | 33 | TasksCollection.remove(taskId); 34 | }, 35 | 36 | 'tasks.setIsChecked'(taskId, isChecked) { 37 | check(taskId, String); 38 | check(isChecked, Boolean); 39 | 40 | if (!this.userId) { 41 | throw new Meteor.Error('Not authorized.'); 42 | } 43 | 44 | const task = TasksCollection.findOne({ _id: taskId, userId: this.userId }); 45 | 46 | if (!task) { 47 | throw new Meteor.Error('Access denied.'); 48 | } 49 | 50 | TasksCollection.update(taskId, { 51 | $set: { 52 | isChecked, 53 | }, 54 | }); 55 | }, 56 | }); 57 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/imports/api/tasksMethods.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { check } from 'meteor/check'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | 5 | Meteor.methods({ 6 | 'tasks.insert'(text) { 7 | check(text, String); 8 | 9 | if (!this.userId) { 10 | throw new Meteor.Error('Not authorized.'); 11 | } 12 | 13 | TasksCollection.insert({ 14 | text, 15 | createdAt: new Date(), 16 | userId: this.userId, 17 | }); 18 | }, 19 | 20 | 'tasks.remove'(taskId) { 21 | check(taskId, String); 22 | 23 | if (!this.userId) { 24 | throw new Meteor.Error('Not authorized.'); 25 | } 26 | 27 | const task = TasksCollection.findOne({ _id: taskId, userId: this.userId }); 28 | 29 | if (!task) { 30 | throw new Meteor.Error('Access denied.'); 31 | } 32 | 33 | TasksCollection.remove(taskId); 34 | }, 35 | 36 | 'tasks.setIsChecked'(taskId, isChecked) { 37 | check(taskId, String); 38 | check(isChecked, Boolean); 39 | 40 | if (!this.userId) { 41 | throw new Meteor.Error('Not authorized.'); 42 | } 43 | 44 | const task = TasksCollection.findOne({ _id: taskId, userId: this.userId }); 45 | 46 | if (!task) { 47 | throw new Meteor.Error('Access denied.'); 48 | } 49 | 50 | TasksCollection.update(taskId, { 51 | $set: { 52 | isChecked, 53 | }, 54 | }); 55 | }, 56 | }); 57 | -------------------------------------------------------------------------------- /src/simple-todos-graphql/step03/imports/api/graphql.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { startGraphQLServer } from 'meteor/quave:graphql/server'; 3 | import { TasksCollection } from '../db/TasksCollection'; 4 | 5 | const log = error => console.error('GraphQL server error', error); 6 | 7 | const UserSchema = ` 8 | type Query { 9 | loggedUser: User 10 | } 11 | 12 | type User { 13 | _id: ID! 14 | username: String 15 | } 16 | `; 17 | 18 | const UserResolvers = { 19 | Query: { 20 | async loggedUser(root, args, { userId }) { 21 | if (!userId) { 22 | return null; 23 | } 24 | return Meteor.users.findOne(userId); 25 | }, 26 | }, 27 | }; 28 | 29 | const TaskSchema = ` 30 | type Query { 31 | tasks: [Task] 32 | } 33 | 34 | type Task { 35 | _id: ID! 36 | text: String 37 | createdAt: String 38 | isChecked: Boolean 39 | user: User 40 | } 41 | `; 42 | 43 | const TaskResolvers = { 44 | Query: { 45 | async tasks(root, args, { userId }) { 46 | if (!userId) { 47 | return null; 48 | } 49 | return TasksCollection.find({ userId }, { sort: { createdAt: -1 } }); 50 | }, 51 | }, 52 | Task: { 53 | user({ userId }) { 54 | return Meteor.users.findOne(userId); 55 | }, 56 | }, 57 | }; 58 | 59 | startGraphQLServer({ 60 | typeDefs: [UserSchema, TaskSchema], 61 | resolvers: [UserResolvers, TaskResolvers], 62 | log, 63 | }); 64 | -------------------------------------------------------------------------------- /src/simple-todos/step08/imports/ui/LoginWithGithub.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | 4 | export const LoginWithGithub = () => { 5 | const handleGithubLogin = () => { 6 | Meteor.loginWithGithub({ 7 | requestPermissions: ['user'], 8 | loginStyle: 'popup', 9 | }); 10 | }; 11 | 12 | return ( 13 | 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /src/simple-todos/step09/imports/ui/LoginWithGithub.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | 4 | export const LoginWithGithub = () => { 5 | const handleGithubLogin = () => { 6 | Meteor.loginWithGithub({ 7 | requestPermissions: ['user'], 8 | loginStyle: 'popup', 9 | }); 10 | }; 11 | 12 | return ( 13 | 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /src/simple-todos/step10/imports/ui/LoginWithGithub.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | 4 | export const LoginWithGithub = () => { 5 | const handleGithubLogin = () => { 6 | Meteor.loginWithGithub({ 7 | requestPermissions: ['user'], 8 | loginStyle: 'popup', 9 | }); 10 | }; 11 | 12 | return ( 13 | 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /src/simple-todos/step10/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { Accounts } from 'meteor/accounts-base'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | import { ServiceConfiguration } from 'meteor/service-configuration'; 5 | import '/imports/api/tasksMethods'; 6 | import '/imports/api/tasksPublications'; 7 | 8 | const insertTask = (taskText, user) => 9 | TasksCollection.insert({ 10 | text: taskText, 11 | userId: user._id, 12 | createdAt: new Date(), 13 | }); 14 | 15 | const SEED_USERNAME = 'meteorite'; 16 | const SEED_PASSWORD = 'password'; 17 | 18 | Meteor.startup(() => { 19 | if (!Accounts.findUserByUsername(SEED_USERNAME)) { 20 | Accounts.createUser({ 21 | username: SEED_USERNAME, 22 | password: SEED_PASSWORD, 23 | }); 24 | } 25 | 26 | const user = Accounts.findUserByUsername(SEED_USERNAME); 27 | 28 | if (TasksCollection.find().count() === 0) { 29 | [ 30 | 'First Task', 31 | 'Second Task', 32 | 'Third Task', 33 | 'Fourth Task', 34 | 'Fifth Task', 35 | 'Sixth Task', 36 | 'Seventh Task', 37 | ].forEach(taskText => insertTask(taskText, user)); 38 | } 39 | }); 40 | 41 | ServiceConfiguration.configurations.upsert( 42 | { service: 'github' }, 43 | { 44 | $set: { 45 | loginStyle: 'popup', 46 | clientId: '', // insert your clientId here 47 | secret: '', // insert your secret here 48 | }, 49 | } 50 | ); 51 | -------------------------------------------------------------------------------- /src/simple-todos/step11/imports/ui/LoginWithGithub.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | 4 | export const LoginWithGithub = () => { 5 | const handleGithubLogin = () => { 6 | Meteor.loginWithGithub({ 7 | requestPermissions: ['user'], 8 | loginStyle: 'popup', 9 | }); 10 | }; 11 | 12 | return ( 13 | 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /src/simple-todos/step11/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { Accounts } from 'meteor/accounts-base'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | import { ServiceConfiguration } from 'meteor/service-configuration'; 5 | import '/imports/api/tasksMethods'; 6 | import '/imports/api/tasksPublications'; 7 | 8 | const insertTask = (taskText, user) => 9 | TasksCollection.insert({ 10 | text: taskText, 11 | userId: user._id, 12 | createdAt: new Date(), 13 | }); 14 | 15 | const SEED_USERNAME = 'meteorite'; 16 | const SEED_PASSWORD = 'password'; 17 | 18 | Meteor.startup(() => { 19 | if (!Accounts.findUserByUsername(SEED_USERNAME)) { 20 | Accounts.createUser({ 21 | username: SEED_USERNAME, 22 | password: SEED_PASSWORD, 23 | }); 24 | } 25 | 26 | const user = Accounts.findUserByUsername(SEED_USERNAME); 27 | 28 | if (TasksCollection.find().count() === 0) { 29 | [ 30 | 'First Task', 31 | 'Second Task', 32 | 'Third Task', 33 | 'Fourth Task', 34 | 'Fifth Task', 35 | 'Sixth Task', 36 | 'Seventh Task', 37 | ].forEach(taskText => insertTask(taskText, user)); 38 | } 39 | }); 40 | 41 | ServiceConfiguration.configurations.upsert( 42 | { service: 'github' }, 43 | { 44 | $set: { 45 | loginStyle: 'popup', 46 | clientId: '', // insert your clientId here 47 | secret: '', // insert your secret here 48 | }, 49 | } 50 | ); 51 | -------------------------------------------------------------------------------- /src/simple-todos/step12/imports/ui/LoginWithGithub.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | 4 | export const LoginWithGithub = () => { 5 | const handleGithubLogin = () => { 6 | Meteor.loginWithGithub({ 7 | requestPermissions: ['user'], 8 | loginStyle: 'popup', 9 | }); 10 | }; 11 | 12 | return ( 13 | 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /src/simple-todos/step12/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { Accounts } from 'meteor/accounts-base'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | import { ServiceConfiguration } from 'meteor/service-configuration'; 5 | import '/imports/api/tasksMethods'; 6 | import '/imports/api/tasksPublications'; 7 | 8 | const insertTask = (taskText, user) => 9 | TasksCollection.insert({ 10 | text: taskText, 11 | userId: user._id, 12 | createdAt: new Date(), 13 | }); 14 | 15 | const SEED_USERNAME = 'meteorite'; 16 | const SEED_PASSWORD = 'password'; 17 | 18 | Meteor.startup(() => { 19 | if (!Accounts.findUserByUsername(SEED_USERNAME)) { 20 | Accounts.createUser({ 21 | username: SEED_USERNAME, 22 | password: SEED_PASSWORD, 23 | }); 24 | } 25 | 26 | const user = Accounts.findUserByUsername(SEED_USERNAME); 27 | 28 | if (TasksCollection.find().count() === 0) { 29 | [ 30 | 'First Task', 31 | 'Second Task', 32 | 'Third Task', 33 | 'Fourth Task', 34 | 'Fifth Task', 35 | 'Sixth Task', 36 | 'Seventh Task', 37 | ].forEach(taskText => insertTask(taskText, user)); 38 | } 39 | }); 40 | 41 | ServiceConfiguration.configurations.upsert( 42 | { service: 'github' }, 43 | { 44 | $set: { 45 | loginStyle: 'popup', 46 | clientId: '', // insert your clientId here 47 | secret: '', // insert your secret here 48 | }, 49 | } 50 | ); 51 | -------------------------------------------------------------------------------- /src/simple-todos/step13/imports/ui/LoginWithGithub.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | 4 | export const LoginWithGithub = () => { 5 | const handleGithubLogin = () => { 6 | Meteor.loginWithGithub({ 7 | requestPermissions: ['user'], 8 | loginStyle: 'popup', 9 | }); 10 | }; 11 | 12 | return ( 13 | 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /src/simple-todos/step13/server/main.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { Accounts } from 'meteor/accounts-base'; 3 | import { TasksCollection } from '/imports/db/TasksCollection'; 4 | import { ServiceConfiguration } from 'meteor/service-configuration'; 5 | import '/imports/api/tasksMethods'; 6 | import '/imports/api/tasksPublications'; 7 | 8 | const insertTask = (taskText, user) => 9 | TasksCollection.insert({ 10 | text: taskText, 11 | userId: user._id, 12 | createdAt: new Date(), 13 | }); 14 | 15 | const SEED_USERNAME = 'meteorite'; 16 | const SEED_PASSWORD = 'password'; 17 | 18 | Meteor.startup(() => { 19 | if (!Accounts.findUserByUsername(SEED_USERNAME)) { 20 | Accounts.createUser({ 21 | username: SEED_USERNAME, 22 | password: SEED_PASSWORD, 23 | }); 24 | } 25 | 26 | const user = Accounts.findUserByUsername(SEED_USERNAME); 27 | 28 | if (TasksCollection.find().count() === 0) { 29 | [ 30 | 'First Task', 31 | 'Second Task', 32 | 'Third Task', 33 | 'Fourth Task', 34 | 'Fifth Task', 35 | 'Sixth Task', 36 | 'Seventh Task', 37 | ].forEach(taskText => insertTask(taskText, user)); 38 | } 39 | }); 40 | 41 | ServiceConfiguration.configurations.upsert( 42 | { service: 'github' }, 43 | { 44 | $set: { 45 | loginStyle: 'popup', 46 | clientId: '', // insert your clientId here 47 | secret: '', // insert your secret here 48 | }, 49 | } 50 | ); 51 | -------------------------------------------------------------------------------- /src/simple-todos/step12/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | static-html@1.3.2 # Define static page content in .html files 21 | react-meteor-data # React higher-order component for reactively tracking Meteor data 22 | accounts-password@2.3.1 23 | meteortesting:mocha 24 | quave:testing 25 | dev-error-overlay@0.1.1 26 | accounts-github 27 | service-configuration 28 | -------------------------------------------------------------------------------- /src/simple-todos/step13/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | static-html@1.3.2 # Define static page content in .html files 21 | react-meteor-data # React higher-order component for reactively tracking Meteor data 22 | accounts-password@2.3.1 23 | meteortesting:mocha 24 | quave:testing 25 | dev-error-overlay@0.1.1 26 | accounts-github 27 | service-configuration 28 | -------------------------------------------------------------------------------- /src/simple-todos/step09/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | autopublish@1.0.7 # Publish all data to the clients (for prototyping) 21 | static-html@1.3.2 # Define static page content in .html files 22 | react-meteor-data # React higher-order component for reactively tracking Meteor data 23 | accounts-password@2.3.1 24 | dev-error-overlay@0.1.1 25 | accounts-github 26 | service-configuration 27 | -------------------------------------------------------------------------------- /src/simple-todos/step01/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | autopublish@1.0.7 # Publish all data to the clients (for prototyping) 21 | insecure@1.0.7 # Allow all DB writes from clients (for prototyping) 22 | static-html@1.3.2 # Define static page content in .html files 23 | react-meteor-data # React higher-order component for reactively tracking Meteor data 24 | dev-error-overlay@0.1.1 25 | -------------------------------------------------------------------------------- /src/simple-todos/step02/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | autopublish@1.0.7 # Publish all data to the clients (for prototyping) 21 | insecure@1.0.7 # Allow all DB writes from clients (for prototyping) 22 | static-html@1.3.2 # Define static page content in .html files 23 | react-meteor-data # React higher-order component for reactively tracking Meteor data 24 | dev-error-overlay@0.1.1 25 | -------------------------------------------------------------------------------- /src/simple-todos/step03/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | autopublish@1.0.7 # Publish all data to the clients (for prototyping) 21 | insecure@1.0.7 # Allow all DB writes from clients (for prototyping) 22 | static-html@1.3.2 # Define static page content in .html files 23 | react-meteor-data # React higher-order component for reactively tracking Meteor data 24 | dev-error-overlay@0.1.1 25 | -------------------------------------------------------------------------------- /src/simple-todos/step04/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | autopublish@1.0.7 # Publish all data to the clients (for prototyping) 21 | insecure@1.0.7 # Allow all DB writes from clients (for prototyping) 22 | static-html@1.3.2 # Define static page content in .html files 23 | react-meteor-data # React higher-order component for reactively tracking Meteor data 24 | dev-error-overlay@0.1.1 25 | -------------------------------------------------------------------------------- /src/simple-todos/step05/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | autopublish@1.0.7 # Publish all data to the clients (for prototyping) 21 | insecure@1.0.7 # Allow all DB writes from clients (for prototyping) 22 | static-html@1.3.2 # Define static page content in .html files 23 | react-meteor-data # React higher-order component for reactively tracking Meteor data 24 | dev-error-overlay@0.1.1 25 | -------------------------------------------------------------------------------- /src/simple-todos/step06/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | autopublish@1.0.7 # Publish all data to the clients (for prototyping) 21 | insecure@1.0.7 # Allow all DB writes from clients (for prototyping) 22 | static-html@1.3.2 # Define static page content in .html files 23 | react-meteor-data # React higher-order component for reactively tracking Meteor data 24 | dev-error-overlay@0.1.1 25 | -------------------------------------------------------------------------------- /src/simple-todos/step07/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | autopublish@1.0.7 # Publish all data to the clients (for prototyping) 21 | insecure@1.0.7 # Allow all DB writes from clients (for prototyping) 22 | static-html@1.3.2 # Define static page content in .html files 23 | react-meteor-data # React higher-order component for reactively tracking Meteor data 24 | accounts-password@2.3.1 25 | dev-error-overlay@0.1.1 26 | -------------------------------------------------------------------------------- /src/simple-todos/step08/.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.5.1 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.14.6 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | 12 | standard-minifier-css@1.8.1 # CSS minifier run for production mode 13 | standard-minifier-js@2.8.0 # JS minifier run for production mode 14 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 15 | ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code 16 | typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | hot-module-replacement@0.5.1 # Update client in development without reloading the page 19 | 20 | autopublish@1.0.7 # Publish all data to the clients (for prototyping) 21 | insecure@1.0.7 # Allow all DB writes from clients (for prototyping) 22 | static-html@1.3.2 # Define static page content in .html files 23 | react-meteor-data # React higher-order component for reactively tracking Meteor data 24 | accounts-password@2.3.1 25 | dev-error-overlay@0.1.1 26 | accounts-github 27 | service-configuration 28 | --------------------------------------------------------------------------------