${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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
14 | Login with Github
15 |
20 |
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 |
14 | Login with Github
15 |
20 |
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 |
14 | Login with Github
15 |
20 |
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 |
14 | Login with Github
15 |
20 |
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 |
14 | Login with Github
15 |
20 |
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 |
14 | Login with Github
15 |
20 |
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 |
--------------------------------------------------------------------------------