├── .meteor ├── .gitignore ├── release ├── platforms ├── .id ├── .finished-upgraders ├── packages └── versions ├── tests ├── main.js └── helpers.js ├── README-Assets ├── sign_in_dark.png ├── task_example.png ├── sign_in_light.png └── project_structure.png ├── .meteorignore ├── api ├── tasks │ ├── tasks.js │ ├── tasks.publications.js │ ├── tasks.publications.tests.js │ ├── tasks.methods.js │ └── tasks.methods.tests.js ├── main.js ├── lib │ └── auth.js └── db │ └── migrations.js ├── ui ├── pages │ ├── not-found │ │ └── not-found-page.jsx │ ├── tasks │ │ ├── hooks │ │ │ ├── use-task-item.jsx │ │ │ ├── use-tasks.jsx │ │ │ └── use-task-form.jsx │ │ ├── components │ │ │ ├── task-form.jsx │ │ │ └── task-item.jsx │ │ └── tasks-page.jsx │ └── auth │ │ ├── hooks │ │ └── use-login.jsx │ │ └── sign-in-page.jsx ├── common │ └── components │ │ ├── logout.jsx │ │ ├── layout.jsx │ │ ├── loading.jsx │ │ ├── ui-provider.jsx │ │ ├── navbar.jsx │ │ └── footer.jsx ├── main.jsx ├── main.html └── routes.jsx ├── rspack.config.js ├── private └── settings.json ├── e2e ├── home.spec.js └── auth.spec.js ├── LICENSE ├── .gitignore ├── package.json ├── playwright.config.js ├── biome.json ├── README.md └── tests-examples └── demo-todo-app.spec.js /.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@3.4-beta.12 2 | -------------------------------------------------------------------------------- /.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /tests/main.js: -------------------------------------------------------------------------------- 1 | import '/api/tasks/tasks.methods.tests.js'; 2 | import '/api/tasks/tasks.publications.tests'; 3 | -------------------------------------------------------------------------------- /README-Assets/sign_in_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredmaiaarantes/simpletasks/HEAD/README-Assets/sign_in_dark.png -------------------------------------------------------------------------------- /README-Assets/task_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredmaiaarantes/simpletasks/HEAD/README-Assets/task_example.png -------------------------------------------------------------------------------- /README-Assets/sign_in_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredmaiaarantes/simpletasks/HEAD/README-Assets/sign_in_light.png -------------------------------------------------------------------------------- /README-Assets/project_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredmaiaarantes/simpletasks/HEAD/README-Assets/project_structure.png -------------------------------------------------------------------------------- /.meteorignore: -------------------------------------------------------------------------------- 1 | # Playwright files and directories 2 | playwright-report/ 3 | test-results/ 4 | e2e/ 5 | node_modules/@playwright/ 6 | node_modules/playwright/ -------------------------------------------------------------------------------- /tests/helpers.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | 3 | export function mockLoggedUserId(userId) { 4 | Meteor.userId = () => userId; 5 | } 6 | 7 | export function getMeteorPublication(name) { 8 | return Meteor.server.publish_handlers[name].apply({}); 9 | } 10 | -------------------------------------------------------------------------------- /api/tasks/tasks.js: -------------------------------------------------------------------------------- 1 | import { Mongo } from 'meteor/mongo'; 2 | 3 | export const Tasks = new Mongo.Collection('tasks'); 4 | 5 | const schema = { 6 | _id: String, 7 | description: String, 8 | done: Boolean, 9 | createdAt: Date, 10 | userId: String, 11 | }; 12 | 13 | Tasks.attachSchema(schema); 14 | -------------------------------------------------------------------------------- /.meteor/.id: -------------------------------------------------------------------------------- 1 | # This file contains a token that is unique to your project. 2 | # Check it into your repository along with the rest of this directory. 3 | # It can be used for purposes such as: 4 | # - ensuring you don't accidentally deploy one app on top of another 5 | # - providing package authors with aggregated statistics 6 | 7 | j3mxcj0j3jfj.pzmhdxgvur2 8 | -------------------------------------------------------------------------------- /api/main.js: -------------------------------------------------------------------------------- 1 | import { Migrations } from 'meteor/quave:migrations'; 2 | import { Meteor } from 'meteor/meteor'; 3 | 4 | import './db/migrations'; 5 | import './tasks/tasks.publications'; 6 | import './tasks/tasks.methods'; 7 | 8 | /** 9 | * This is the server-side entry point 10 | */ 11 | Meteor.startup(() => { 12 | Migrations.migrateTo('latest').catch((e) => 13 | console.error('Error running migrations', e) 14 | ); 15 | }); 16 | -------------------------------------------------------------------------------- /api/tasks/tasks.publications.js: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { Tasks } from './tasks'; 3 | 4 | /** 5 | Finds tasks belonging to the logged-in user. 6 | @function findTasksByLoggedUser 7 | @returns {Mongo.Cursor} - The cursor containing the tasks found. 8 | */ 9 | function findTasksByLoggedUser() { 10 | return Tasks.find({ userId: Meteor.userId() }); 11 | } 12 | 13 | Meteor.publish('tasksByLoggedUser', findTasksByLoggedUser); 14 | -------------------------------------------------------------------------------- /ui/pages/not-found/not-found-page.jsx: -------------------------------------------------------------------------------- 1 | import { Flex, Heading, Stack } from '@chakra-ui/react'; 2 | import React from 'react'; 3 | 4 | export default function NotFoundPage() { 5 | return ( 6 | 7 | 8 | 9 | There's nothing here! 10 | 11 | 12 | 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /rspack.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from '@meteorjs/rspack'; 2 | 3 | /** 4 | * Rspack configuration for Meteor projects. 5 | * 6 | * Provides typed flags on the `Meteor` object, such as: 7 | * - `Meteor.isClient` / `Meteor.isServer` 8 | * - `Meteor.isDevelopment` / `Meteor.isProduction` 9 | * - …and other flags available 10 | * 11 | * Use these flags to adjust your build settings based on environment. 12 | */ 13 | export default defineConfig(Meteor => { 14 | return {}; 15 | }); 16 | -------------------------------------------------------------------------------- /private/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "public": { 3 | "appInfo": { 4 | "name": "Charm - Chakra-UI, React, Meteor" 5 | } 6 | }, 7 | "packages": { 8 | "service-configuration": { 9 | "github": { 10 | "loginStyle": "popup", 11 | "clientId": "REPLACE_WITH_YOUR_CLIENT_ID", 12 | "secret": "REPLACE_WITH_YOUR_SECRET" 13 | } 14 | } 15 | }, 16 | "galaxy.meteor.com": { 17 | "env": { 18 | "ROOT_URL": "REPLACE_WITH_YOUR_DOMAIN", 19 | "MONGO_URL": "REPLACE_WITH_YOUR_MONGO_URL" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /ui/common/components/logout.jsx: -------------------------------------------------------------------------------- 1 | import { Button } from '@chakra-ui/react'; 2 | import { Meteor } from 'meteor/meteor'; 3 | import { useUserId } from 'meteor/react-meteor-accounts'; 4 | import React from 'react'; 5 | import { useNavigate } from 'react-router-dom'; 6 | 7 | export function Logout() { 8 | const userId = useUserId(); 9 | const navigate = useNavigate(); 10 | 11 | const logout = () => { 12 | Meteor.logout(() => { 13 | navigate('/'); 14 | }); 15 | }; 16 | 17 | return ( 18 | <> 19 | {userId && ( 20 | 23 | )} 24 | 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /ui/common/components/layout.jsx: -------------------------------------------------------------------------------- 1 | import { Box } from '@chakra-ui/react'; 2 | import { useUserId } from 'meteor/react-meteor-accounts'; 3 | import React from 'react'; 4 | import { Navigate } from 'react-router-dom'; 5 | import { routes } from '../../routes'; 6 | import { Footer } from './footer'; 7 | import { Navbar } from './navbar'; 8 | 9 | export function Layout({ loggedOnly = true, children }) { 10 | const userId = useUserId(); 11 | if (loggedOnly && !userId) { 12 | return ; 13 | } 14 | 15 | return ( 16 | <> 17 | 18 | 19 | {children} 20 | 21 |