├── src ├── public │ ├── bell.mp3 │ ├── click.mp3 │ ├── img │ │ ├── icono.png │ │ └── logo.png │ └── css │ │ └── main.css ├── routes │ ├── index.routes.js │ ├── users.routes.js │ └── notes.routes.js ├── index.js ├── views │ ├── partials │ │ ├── notificacion.hbs │ │ ├── errorsuser.hbs │ │ └── navigation.hbs │ ├── error.hbs │ ├── notes │ │ ├── new-note.hbs │ │ ├── edit-note.hbs │ │ └── all-notes.hbs │ ├── layouts │ │ └── main.hbs │ ├── users │ │ ├── login.hbs │ │ └── register.hbs │ ├── index.hbs │ └── estudiar.hbs ├── controllers │ ├── index.controller.js │ ├── users.controller.js │ └── notes.controller.js ├── database.js ├── utils.js └── server.js ├── package.json ├── LICENSE ├── .gitignore ├── db ├── db-users.js └── db-notes.js └── README.md /src/public/bell.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cabrerafrancisco/OrganizerIT/HEAD/src/public/bell.mp3 -------------------------------------------------------------------------------- /src/public/click.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cabrerafrancisco/OrganizerIT/HEAD/src/public/click.mp3 -------------------------------------------------------------------------------- /src/public/img/icono.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cabrerafrancisco/OrganizerIT/HEAD/src/public/img/icono.png -------------------------------------------------------------------------------- /src/public/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cabrerafrancisco/OrganizerIT/HEAD/src/public/img/logo.png -------------------------------------------------------------------------------- /src/routes/index.routes.js: -------------------------------------------------------------------------------- 1 | const { Router } = require('express') 2 | 3 | const router = Router(); 4 | const { renderIndex , renderEstudiar} = require('../controllers/index.controller') 5 | 6 | router.get('/', renderIndex ) 7 | 8 | router.get('/estudiar', renderEstudiar ) 9 | module.exports = router; -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | require('dotenv').config(); // hace que si un archivo esta en .env declarado como variable lo traiga process.env.VARIABLE 2 | 3 | const app = require('./server'); 4 | require('./database'); 5 | 6 | app.listen(app.get('PORT'), () => { 7 | console.log('server en el puerto:' , app.get('PORT')) 8 | }) -------------------------------------------------------------------------------- /src/views/partials/notificacion.hbs: -------------------------------------------------------------------------------- 1 | {{#if notificacion}} 2 |
3 |
Notificacion: {{notificacion}}
4 | 7 |
8 | {{/if}} -------------------------------------------------------------------------------- /src/controllers/index.controller.js: -------------------------------------------------------------------------------- 1 | const indexCtrl = {}; 2 | 3 | indexCtrl.renderIndex = (req, res) =>{ 4 | res.render('index' , { 5 | userName: req.session.name, 6 | }) 7 | }; 8 | indexCtrl.renderEstudiar = (req, res) =>{ 9 | 10 | res.render('estudiar' , { 11 | userName: req.session.name, 12 | }) // pomodoro timer 13 | }; 14 | 15 | module.exports = indexCtrl; -------------------------------------------------------------------------------- /src/views/error.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Hubo un error:

4 |
5 |
6 |
7 | {{error}} 8 |
9 |
10 | 13 |
14 |
-------------------------------------------------------------------------------- /src/database.js: -------------------------------------------------------------------------------- 1 | const mongoClient = require("mongodb").MongoClient; 2 | const dbURL = process.env.DBURL; 3 | 4 | mongoClient.connect(dbURL , {useUnifiedTopology:true} , (err , client) => { 5 | if (err) { 6 | console.log("Hubo un error:" , err); 7 | return; 8 | } 9 | console.log("No hubo error"); 10 | }); 11 | 12 | module.exports = { 13 | url : dbURL, 14 | db: "organizarIT", 15 | coleccion: "notas", 16 | colecciondos : "users" 17 | }; -------------------------------------------------------------------------------- /src/routes/users.routes.js: -------------------------------------------------------------------------------- 1 | const { Router } = require("express"); 2 | const router = Router(); 3 | 4 | const { 5 | renderRegister, 6 | register, 7 | renderLogin, 8 | login, 9 | logout 10 | } = require('../controllers/users.controller') 11 | // REGISTRO 12 | router.get('/users/register' , renderRegister ); // envia al formulario para registrar user 13 | router.post('/users/register' , register); // manda los datos cargados en el form de register 14 | // INICIO DE SESION 15 | router.get('/users/login' , renderLogin); // envia formulario para iniciar sesion 16 | router.post('/users/login' , login); // manda los datos cargados en el form de login 17 | // CERRAR SESION 18 | router.get('/users/logout' , logout); // para cerrar la sesion 19 | 20 | module.exports = router; -------------------------------------------------------------------------------- /src/views/notes/new-note.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

Nueva Nota

5 |
6 |
7 |
8 |
9 | 10 |
11 |
12 | 13 |
14 |
15 | 16 |
17 |
18 |
19 |
20 |
-------------------------------------------------------------------------------- /src/utils.js: -------------------------------------------------------------------------------- 1 | 2 | function verError(err) { 3 | console.log("------- ERRROOOOOOOOOOOOORRRRRR -------"); 4 | console.log(err); 5 | } 6 | 7 | function formatNotesForView(dbNotes) { 8 | return { 9 | id: dbNotes._id.toString(), 10 | title: dbNotes.title, 11 | description: dbNotes.description, 12 | }; 13 | } 14 | function formatNotesListForView(dbNotesList) { 15 | const formattedList = dbNotesList.map((dbNotes) => { 16 | return formatNotesForView(dbNotes); 17 | }); 18 | return formattedList; 19 | } 20 | function isValidNoteData(data) { 21 | if (!data.title) return false; 22 | if (!data.description) return false; 23 | // No errors 24 | return true; 25 | } 26 | 27 | module.exports = { 28 | error: verError, 29 | formatNotesForView, 30 | formatNotesListForView, 31 | isValidNoteData, 32 | }; 33 | -------------------------------------------------------------------------------- /src/views/partials/errorsuser.hbs: -------------------------------------------------------------------------------- 1 | {{#each errors}} 2 |
3 |
ERROR: {{text}}
4 | 7 |
8 | {{/each}} 9 | 10 | {{#each empty}} 11 | 17 | {{/each}} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "organizerit", 3 | "version": "1.0.0", 4 | "description": "Organizador para estudiar y llevar anotaciones", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node src/index.js", 8 | "dev": "nodemon src/index.js" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/cabrerafrancisco/Proyecto-ComiT.git" 13 | }, 14 | "author": "Cabrera Francisco", 15 | "license": "ISC", 16 | "bugs": { 17 | "url": "https://github.com/cabrerafrancisco/Proyecto-ComiT/issues" 18 | }, 19 | "homepage": "https://github.com/cabrerafrancisco/Proyecto-ComiT#readme", 20 | "dependencies": { 21 | "bcryptjs": "^2.4.3", 22 | "connect-flash": "^0.1.1", 23 | "dotenv": "^10.0.0", 24 | "express": "^4.17.1", 25 | "express-handlebars": "^5.3.2", 26 | "express-session": "^1.17.2", 27 | "mongodb": "^3.6.9" 28 | }, 29 | "devDependencies": { 30 | "nodemon": "^2.0.7", 31 | "npm-check-updates": "^11.6.0" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/routes/notes.routes.js: -------------------------------------------------------------------------------- 1 | const { Router } = require("express"); 2 | const router = Router(); 3 | 4 | const { 5 | renderNoteForm, 6 | renderCreateNote, 7 | renderNotes, 8 | renderEditForm, 9 | renderUpdateNote, 10 | renderDeleteNote 11 | } = require("../controllers/notes.controller"); 12 | 13 | // Crear notas 14 | router.get("/notes/add", renderNoteForm); // envio el formulario del servidor para crear nota 15 | router.post("/notes/new-note", renderCreateNote); // recibo los datos que el usuario envio 16 | 17 | // Obtener notas 18 | router.get("/notes", renderNotes); // muestra una lista de notas creada en la base de datos 19 | router.get("/notes/all-notes"); 20 | // Actualizar notas 21 | router.get("/notes/edit", renderEditForm); // envio un formulario para editar datos 22 | router.post("/notes/edit", renderUpdateNote); // recibo los datos del formulario 23 | 24 | // Borrar notas 25 | router.get("/notes/delete", renderDeleteNote); // recibo el id del post de la nota que quiero eliminar 26 | 27 | module.exports = router; 28 | -------------------------------------------------------------------------------- /src/views/notes/edit-note.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

Edit Note

5 |
6 |
7 |
8 |
9 | 10 | 11 |
12 |
13 | 14 |
15 |
16 | 19 |
20 |
21 |
22 |
23 |
-------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Francisco (https://github.com/cabrerafrancisco) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /src/views/layouts/main.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | OrganizerIT 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | {{>navigation}} 19 | 20 |
21 | {{>notificacion}} 22 | {{>errorsuser}} 23 | {{{body}}} 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/views/users/login.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
Account Login
6 |
7 | 8 |
9 |
10 |
11 | 12 |
13 |
14 | 15 |
16 |
17 | 20 |
21 |
22 |

¿Eres nuevo aquí? Únete ahora

23 |
24 |
25 |
26 |
27 |
28 |
29 | -------------------------------------------------------------------------------- /src/server.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const exphbs = require('express-handlebars'); 3 | const path = require("path"); 4 | const flash = require('connect-flash'); 5 | const session = require('express-session'); 6 | 7 | // Initializations 8 | const app = express(); 9 | 10 | // Setting 11 | app.set('PORT' , process.env.PORT || 3000); //le digo que use el puerto que entrega el sistema sino el puerto 3k 12 | app.set('views' , path.join(__dirname, 'views')); 13 | app.engine('.hbs' , exphbs({ 14 | defaultLayout: 'main', 15 | layoutsDir : path.join(app.get('views') , 'layouts'), 16 | partialsDir: path.join(app.get('views') , 'partials'), 17 | extname:'.hbs' // Se agrega para no estar poniendo '.hbs' todo el tiempo 18 | })); 19 | app.set("view engine", ".hbs"); 20 | 21 | // Middlewares 22 | app.use(express.urlencoded({ extended: false })); //sea capas de entender los datos del form de un HTML 23 | app.use(session({ 24 | secret: "2C44-4D44-WppQ38S", // palabra secreta 25 | resave: true, 26 | saveUninitialized: true 27 | }));// modulo que nos va a ayudar los mensajes en el servidor 28 | app.use(flash());// este modulo nos ayuda a mostrar los mensajes desp de una accion 29 | 30 | // Global variables 31 | app.use((req, res, next) => { 32 | res.locals.notificacion = req.flash('notificacion'); 33 | next(); 34 | }) 35 | // Routes 36 | 37 | app.use(require('./routes/index.routes')); 38 | app.use(require('./routes/notes.routes')); 39 | app.use(require('./routes/users.routes')); 40 | 41 | // Public files 42 | app.use(express.static(path.join(__dirname, 'public'))); // basicamente le indica a node 'aqui esta la carpeta publica' 43 | 44 | module.exports = app; -------------------------------------------------------------------------------- /src/views/users/register.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
Account Register
6 |
7 |
8 |
9 |
10 | 11 |
12 |
13 | 14 |
15 |
16 | 17 |
18 |
19 | 20 |
21 |
22 | 25 |
26 |
27 |

¿Ya eres usuario? Iniciar sesión

28 |
29 |
30 |
31 |
32 |
33 |
34 | -------------------------------------------------------------------------------- /src/views/notes/all-notes.hbs: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 | {{#each notes}} 6 |
7 |
8 |
9 |

10 | {{this.title}} 11 |

12 |

{{this.description}}

13 | 14 | 15 | 16 |
17 |
18 |
19 | {{/each}} 20 |
21 | 22 |
23 |
24 |

¿Eliminar esta nota?

25 |

26 | 27 | 28 |
29 |
30 | 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /db/db-users.js: -------------------------------------------------------------------------------- 1 | const mongodb = require("mongodb"); 2 | const connOptions = { useUnifiedTopology: true }; 3 | const database = require("../src/database"); 4 | 5 | // --- Buscar email de usuario --- //// 6 | const userExist = (email, cbError, cbResultado) => { 7 | mongodb.MongoClient.connect(database.url, connOptions, (err, client) => { 8 | if (err) { 9 | console.log("Hubo un error conectando con el servidor:", err); 10 | cbError(err); 11 | return; 12 | } 13 | 14 | const colUser = client.db(database.db).collection(database.colecciondos); 15 | 16 | colUser.findOne({ email: { $eq: email } }, (err, respuesta) => { 17 | if (err) { 18 | console.log("Hubo un error al consultar:", err); 19 | cbError(err); 20 | return; 21 | } 22 | client.close(); 23 | cbResultado(respuesta); 24 | }); 25 | }); 26 | }; 27 | 28 | // --- Guardar new user --- //// 29 | const userNew = (newUser, cbError, cbResultado) => { 30 | mongodb.MongoClient.connect(database.url, connOptions, (err, client) => { 31 | if (err) { 32 | console.log("Hubo un error conectando con el servidor:", err); 33 | cbError(err); 34 | return; 35 | } 36 | 37 | const colUser = client.db(database.db).collection(database.colecciondos); 38 | 39 | colUser.insertOne(newUser, (err, resultado) => { 40 | if (err) { 41 | console.log("Hubo un error al consultar:", err); 42 | cbError(err); 43 | return; 44 | } 45 | client.close(); 46 | cbResultado(); 47 | }); 48 | }); 49 | }; 50 | 51 | // --- Validacion de login --- //// 52 | 53 | const userLogin = (email,pass, cbError, cbResultado) => { 54 | mongodb.MongoClient.connect(database.url , connOptions , (err, client) => { 55 | if (err) { 56 | console.log('Hubo un error al conectar al servidor:' , err); 57 | cbError(err); 58 | return; 59 | } 60 | const colUser = client.db(database.db).collection(database.colecciondos); 61 | 62 | colUser.findOne({ $and: [{ email },{ pass }]}, (err, respuesta) => { 63 | if (err) { 64 | console.log('Hubo un error al consultar:' , err); 65 | cbError(err); 66 | return; 67 | } 68 | client.close(); 69 | cbResultado(respuesta); 70 | }); 71 | }); 72 | }; 73 | 74 | module.exports = { 75 | userExist, 76 | userNew, 77 | userLogin, 78 | }; 79 | -------------------------------------------------------------------------------- /src/controllers/users.controller.js: -------------------------------------------------------------------------------- 1 | const usersCtrl = {}; 2 | const dbUsers = require("../../db/db-users"); 3 | const { db } = require("../database"); 4 | 5 | // get del register 6 | usersCtrl.renderRegister = (req, res) => { 7 | res.render("users/register"); 8 | }; 9 | // analiza el mail ingresado y acepta o no al nuevo user 10 | // post del register 11 | usersCtrl.register = (req, res) => { 12 | const errors = []; // array que almacenara los msj de error 13 | const { name, email, pass, passrepeat } = req.body; 14 | 15 | if (pass != passrepeat) { 16 | errors.push({ text: "Passwords no coinciden" }); 17 | } 18 | if (pass == name) { 19 | errors.push({ text: "Password coincide con el nombre" }); 20 | } 21 | if (errors.length > 0) { 22 | res.render("users/register", { 23 | errors, 24 | name, 25 | email, 26 | }); 27 | return; 28 | } 29 | dbUsers.userExist( 30 | email, 31 | (err) => { 32 | res.render("error", { 33 | error: err, 34 | }); 35 | return; 36 | }, 37 | (resp) => { 38 | if (resp != null) { 39 | errors.push({ text: "Usuario ya registrado, intente nuevamente" }); 40 | res.render("users/register", { 41 | errors, 42 | name, 43 | email, 44 | }); 45 | return; 46 | } else { 47 | const newUser = { 48 | name: req.body.name, 49 | email: req.body.email, 50 | pass: req.body.pass, 51 | }; 52 | dbUsers.userNew( 53 | newUser, 54 | (err) => { 55 | res.render("error", { 56 | error: err, 57 | }); 58 | return; 59 | }, 60 | () => { 61 | req.flash('notificacion' , ' --> Usuario creado con Exito ') 62 | res.redirect("/users/login"); 63 | } 64 | ); 65 | } 66 | } 67 | ); 68 | }; 69 | // get del login 70 | usersCtrl.renderLogin = (req, res) => { 71 | res.render("users/login"); 72 | }; 73 | // post del login 74 | usersCtrl.login = (req, res) => { 75 | const errors = []; 76 | const { email, pass } = req.body; 77 | dbUsers.userLogin( 78 | email, 79 | pass, 80 | (err)=> { 81 | res.render('error' , { 82 | error:err, 83 | }); 84 | return; 85 | }, 86 | (result) => { 87 | if(result == null){ 88 | errors.push({ text: "Usuario inexistente o campos mal ingresados"}); 89 | res.render('users/login', { 90 | errors, 91 | email, 92 | }); 93 | return; 94 | }else{ 95 | req.session.name = result.name; 96 | req.session.email = result.email; 97 | res.redirect("/"); 98 | } 99 | } 100 | ); 101 | }; 102 | 103 | usersCtrl.logout = (req, res) => { 104 | req.session.destroy(); 105 | res.redirect("/"); 106 | }; 107 | 108 | module.exports = usersCtrl; 109 | -------------------------------------------------------------------------------- /src/views/index.hbs: -------------------------------------------------------------------------------- 1 |
2 |

OrganizerIT

3 |

¡Bienvenido! Te presento una aplicación sencilla que podrás utilizar para poder hacer un seguimiento de tu día de estudio, en el cual puedes utilizar las distintas opciones que ofrece. OrganizerIT es una app aun en desarrollo, cualquier tipo de reseña y consejo siempre es bien recibido. Abajo dejaré los medios por los cuales podrás contactarme. ¡Disfruta de la App!

4 |
5 |

Hola, mi nombre es francisco, actualmente soy developer junior. Este proyecto fue desarrolla con ayuda de ComIT (visita la página, no te vas a arrepentir). También te invito a que des un vistazo en GitHub, donde podrás encontrar el código de esta app y muchos otros proyectos que desarrolle o están en desarrollo. ¡Un Saludo!

6 | GitHub 7 |
8 | 9 |
10 |

DESCRIPCIÓN

11 |
12 |

13 |

Que encontraremos en OrganizerIT?

14 | 15 |

OrganizerIT es una App web en desarrollo, el fin es que distintos estudiantes la puedan utilizar para una mejor organización a la hora de dedicar un tiempo a un predeterminado temario. La aplicación tiene una sección en la cual podremos utilizar la famosa técnica pomodoro, unas de las más eficientes técnicas de estudio actualmente. También contamos con un login-register para poder disfrutar de otro beneficio que es para usuarios registrados, este beneficio es una CRUD (Create, Read, Update, Delete) de notas, todo esto se almacena en una base de datos y tiene todas las restricciones correspondientes.

16 | 17 |

Que tecnologías se implementaron?

18 | 27 | 28 |

Proximas actualizaciones

29 | 30 |

La aplicación actualmente esta en su primera version, pero funciona en todos los dispositivos ya que es una app responsive. Lo siguiente a agregar sera una mayor variedad de utilidades para las notas (distintos colores, tipos de notas, recordatorios al ingresar fechas). Mas adelante tambien se agregara una to-do list para implementarla en la seccion de pomodoro para un mejor seguimiento de las actividades realizadas y por realizar.

31 | 32 |

33 |
-------------------------------------------------------------------------------- /src/public/css/main.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background-color: #2c387bbd; 3 | } 4 | .logo{ 5 | width: 40%; 6 | } 7 | .tarjeta , 8 | .notNotes { 9 | box-shadow: rgba(14, 30, 37, 0.12) 0px 2px 4px 0px, 10 | rgba(14, 30, 37, 0.32) 0px 2px 16px 0px; 11 | } 12 | .tarjeta:hover{ 13 | transform: scale(1.1); 14 | border: 1px solid #7fddcd; 15 | box-shadow: 0px 0px 30px #666; 16 | transition: all .4s ease; 17 | } 18 | 19 | .fondo-util{ 20 | background-color: #f3eceac7; 21 | } 22 | 23 | .fondo-util:hover{ 24 | background-color: #f3eceaf5; 25 | color: rgb(70, 67, 67); 26 | } 27 | 28 | /* POMODOROO */ 29 | 30 | .fa-play, .fa-redo-alt{ 31 | color: rgb(226, 226, 226); 32 | border: 2px solid transparent; 33 | margin-right: 30px; 34 | padding: 1rem; 35 | border-radius: 20px; 36 | } 37 | .fa-play:hover, .fa-redo-alt:hover{ 38 | color: rgb(39, 23, 39); 39 | border: 2px solid cornflowerblue; 40 | transition: 0.3s ease; 41 | } 42 | #divdone{ 43 | border-radius: 20px; 44 | transition: 0.5s ease; 45 | } 46 | .titulo{ 47 | color: aliceblue; 48 | font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; 49 | } 50 | @media (max-width: 768px) { 51 | .titulo{ 52 | color: aliceblue; 53 | font-size: 3.5rem; 54 | } 55 | } 56 | .boton-set{ 57 | margin-right: 20px; 58 | } 59 | @media (max-width: 768px) { 60 | .boton-set{ 61 | display: inline-block; 62 | justify-content: center; 63 | margin: 10px; 64 | } 65 | } 66 | .fondo{ 67 | box-shadow: rgba(14, 30, 37, 0.12) 0px 2px 4px 0px, 68 | rgba(14, 30, 37, 0.32) 0px 2px 16px 0px; 69 | } 70 | .fondo-dark{ 71 | transition: all .4s ease; 72 | color: aliceblue; 73 | background-color: #343a40; 74 | padding: 2rem 1rem; 75 | margin-bottom: 2rem; 76 | border-radius: 0.6rem; 77 | } 78 | .fondo-danger{ 79 | transition: all .4s ease; 80 | color: aliceblue; 81 | background-color: #ff7851; 82 | padding: 2rem 1rem; 83 | margin-bottom: 2rem; 84 | border-radius: 0.6rem; 85 | } 86 | .fondo-primary{ 87 | transition: all .4s ease; 88 | color: aliceblue; 89 | background-color: #78C2AD; 90 | padding: 2rem 1rem; 91 | margin-bottom: 2rem; 92 | border-radius: 0.6rem; 93 | } 94 | .timer{ 95 | margin-top: 15px; 96 | margin-bottom: 10px; 97 | font-size: 12rem; 98 | align-items: center; 99 | font-family: arial, sans-serif; 100 | } 101 | 102 | 103 | @media (max-width: 768px) { 104 | .timer { 105 | font-size: 6rem; 106 | } 107 | } 108 | 109 | /* Texto post pomodoro */ 110 | 111 | .subrayar::after{ 112 | content: ''; 113 | display: block; 114 | /* margin: 0 auto; */ 115 | width: 24px; 116 | padding-top: 8px; 117 | border-bottom: 4px solid #f05b56; 118 | opacity: 0.6; 119 | } 120 | 121 | /* Ventana para confirmar DELETE */ 122 | 123 | #confirmation-modal { 124 | visibility: hidden; 125 | position: fixed; 126 | background-color: rgba(0,0,0,0.5); 127 | top: 0; 128 | left: 0; 129 | width: 100%; 130 | height: 100%; 131 | overflow: auto; 132 | z-index: 1; 133 | text-align: center; 134 | } 135 | 136 | #confirmation-modal-content { 137 | color: black; 138 | padding: 40px; 139 | margin-top: 20%; 140 | background-color: rgba(194, 183, 181, 0.815); 141 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Welcome to organizerit 👋

2 |

3 | Version 4 | 5 | Documentation 6 | 7 | 8 | Maintenance 9 | 10 | 11 | License: ISC 12 | 13 | 14 | Twitter: franciicasm 15 | 16 |

17 | 18 | ### Hi 👋! I present a simple application that you can use to keep track of your study day, in which you can use the different options it offers. OrganizerIT is an app in which you have tools to use as a guest, but if you register, you can use an additional option in which you will find a CRUD to store, read, save or delete notes. It is still in development, any type of idea or suggestion contact me on my networks .. Enjoy the App! 19 | 20 | ## 🏠 [Homepage](https://organizerit.herokuapp.com/) (click here to see the app) 21 | > this user is to test the app: 22 | * User: [admin@admin.com] 23 | * Pass: [admin] 24 | 25 | ### :framed_picture: Screen 26 | 27 | 28 | ### Home :wedding: 29 | ![home1](https://user-images.githubusercontent.com/45265068/127486524-968ccd08-fccc-4755-8f06-0b3ca88a3ab0.png) 30 | 31 |
32 | 33 | ### Login :busts_in_silhouette: 34 | ![login](https://user-images.githubusercontent.com/45265068/123005502-9f835a80-d38c-11eb-8eb3-843d13cfc467.png) 35 | 36 |
37 | 38 | ### My notes :closed_book: :green_book: 39 | ![notas](https://user-images.githubusercontent.com/45265068/123005661-d8233400-d38c-11eb-9cb8-cae75d3f1d89.png) 40 | 41 |
42 | 43 | ### Pomodoro :hourglass: :books: 44 | ![pomodoro](https://user-images.githubusercontent.com/45265068/123005683-deb1ab80-d38c-11eb-8ab5-fe0cc33e2070.png) 45 | 46 |
47 | 48 | ## Install :arrow_down: 49 | 50 | ```sh 51 | npm install 52 | ``` 53 | 54 | ## Use the app :jigsaw: 55 | 56 | ```sh 57 | npm start 58 | ``` 59 |
60 | 61 | 62 | ## Author 63 | 64 | 👤 **Cabrera Francisco** 65 | 66 | * Website: [Portfolio](https://portfoliocabrerafrancisco.netlify.app) 67 | * Twitter: [@franciicasm](https://twitter.com/franciicasm) 68 | * Github: [@cabrerafrancisco](https://github.com/cabrerafrancisco) 69 | * LinkedIn: [@francabrera97](https://linkedin.com/in/francabrera97) 70 | 71 | ## 🤝 Contributing 72 | 73 | This project is a final project for a course taught by [ComIT] (https://www.comunidadit.org/). I invite you to visit their page :) 74 | 75 | Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/cabrerafrancisco/Proyecto-ComiT/issues). You can also take a look at the [contributing guide](https://github.com/cabrerafrancisco/Proyecto-ComiT/blob/master/CONTRIBUTING.md). 76 | 77 | ## Show your support 78 | 79 | ¡Give it a ⭐️ if you liked this project! 80 | 81 | ## 📝 License 82 | 83 | Copyright © 2021 [Cabrera Francisco](https://github.com/cabrerafrancisco).
84 | This project is [ISC](https://github.com/cabrerafrancisco/Proyecto-ComiT/blob/master/LICENSE) licensed. 85 | -------------------------------------------------------------------------------- /src/views/partials/navigation.hbs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /db/db-notes.js: -------------------------------------------------------------------------------- 1 | const mongodb = require("mongodb"); 2 | const connOptions = { useUnifiedTopology: true }; 3 | const database = require("../src/database"); 4 | 5 | // --- MOSTRAR TODAS LAS NOTAS --- //// 6 | const getAllNotes = (sortBy, emailSession ,cbError, cbDatos) => { 7 | mongodb.MongoClient.connect(database.url,connOptions ,(err, client) => { 8 | if (err) { 9 | console.log("Hubo un error conectando con el servidor:", err); 10 | cbError(err); 11 | return; 12 | } 13 | 14 | const colNotas = client.db(database.db).collection(database.coleccion); 15 | 16 | 17 | colNotas.find({ email: { $eq: emailSession } }).sort({ lastUpdate: -1}).toArray(function (err, notas) { 18 | if (err) { 19 | console.log("Hubo un error convirtiendo la consulta a Array:", err); 20 | cbError(err); 21 | return; 22 | } 23 | client.close(); 24 | cbDatos(notas); 25 | } 26 | ); 27 | 28 | }); 29 | }; 30 | // --- MOSTRAR UNA NOTA --- //// 31 | const getNote = (id, cbError, cbResultado) => { 32 | mongodb.MongoClient.connect(database.url,connOptions,(err, client) => { 33 | if (err) { 34 | console.log("Hubo un error conectando con el servidor:", err); 35 | cbError(err); 36 | return; 37 | } 38 | const colNotas = client.db(database.db).collection(database.coleccion); 39 | colNotas.findOne({ _id: mongodb.ObjectId(id) }, (err, nota) => { 40 | if (err) { 41 | console.log("Hubo un error al consultar:", err); 42 | cbError(err); 43 | return; 44 | } 45 | client.close(); 46 | cbResultado(nota); 47 | }); 48 | }); 49 | }; 50 | // --- ACTUALIZA NOTA --- //// 51 | const updateNote = (id, newData, cbError, cbResultado) => { 52 | mongodb.MongoClient.connect(database.url,connOptions , (err, client) => { 53 | if (err) { 54 | cbError(err); 55 | return; 56 | } 57 | const colNotas = client.db(database.db).collection(database.coleccion); 58 | colNotas.updateOne( 59 | { _id: mongodb.ObjectId(id) }, 60 | { 61 | $set: { 62 | title: newData.title, 63 | description: newData.description, 64 | lastUpdate: new Date() 65 | }, 66 | }, 67 | (err, resultado) => { 68 | if (err) { 69 | cbError(err); 70 | return; 71 | } 72 | client.close; 73 | cbResultado(); 74 | } 75 | ); 76 | }); 77 | }; 78 | 79 | // --- CREAR NOTAS --- //// 80 | const createNote = (nota, cbError, cbResultado) => { 81 | mongodb.MongoClient.connect(database.url, connOptions, (err, client) => { 82 | if (err) { 83 | console.log("Hubo un error conectando con el servidor:", err); 84 | cbError(err); 85 | return; 86 | } 87 | 88 | const colNotas = client.db(database.db).collection(database.coleccion); 89 | 90 | colNotas.insertOne(nota, (err, resultado) => { 91 | if (err) { 92 | console.log("Hubo un error al consultar:", err); 93 | cbError(err); 94 | return; 95 | } 96 | client.close(); 97 | cbResultado(); 98 | }); 99 | }); 100 | }; 101 | 102 | // --- BORRAR NOTAS --- //// 103 | const deteleNote = (id, cbError, cbResultado) => { 104 | mongodb.MongoClient.connect(database.url,connOptions , (err, client) => { 105 | if (err) { 106 | console.log("Hubo un error conectando con el servidor:", err); 107 | cbError(err); 108 | return; 109 | } 110 | 111 | const colNotas = client.db(database.db).collection(database.coleccion); 112 | 113 | colNotas.deleteOne({ _id: mongodb.ObjectId(id) }, (err, result) => { 114 | if (err) { 115 | console.log("Hubo un error buscando el id:", err); 116 | cbError(err); 117 | return; 118 | } 119 | client.close(); 120 | cbResultado(); 121 | }); 122 | }); 123 | }; 124 | 125 | module.exports = { 126 | getAllNotes, 127 | createNote, 128 | deteleNote, 129 | getNote, 130 | updateNote, 131 | }; 132 | -------------------------------------------------------------------------------- /src/controllers/notes.controller.js: -------------------------------------------------------------------------------- 1 | const notesCtrl = {}; 2 | 3 | const dbNotas = require("../../db/db-notes"); 4 | const utils = require("../utils"); 5 | 6 | // Crear nota 7 | //GET : 8 | notesCtrl.renderNoteForm = (req, res) => { 9 | if (!req.session.email) { 10 | req.flash('notificacion' , ' --> Por favor iniciar sesion ') 11 | res.redirect("/users/login"); 12 | return; 13 | } 14 | res.render("notes/new-note" , { 15 | userName: req.session.name, 16 | }); 17 | }; 18 | //POST : 19 | notesCtrl.renderCreateNote = (req, res) => { 20 | if (!req.session.email) { 21 | req.flash('notificacion' , ' --> Por favor iniciar sesion ') 22 | res.redirect("/users/login"); 23 | return; 24 | } 25 | const newNote = { 26 | title: req.body.title, 27 | description: req.body.description, 28 | email: req.session.email, 29 | lastUpdate: new Date() 30 | }; 31 | dbNotas.createNote(newNote, utils.error, (resultado) => { 32 | req.flash('notificacion' , ' --> Nota creada '); 33 | res.redirect("/notes"); 34 | }); // agrega a la db 35 | }; 36 | 37 | notesCtrl.renderNotes = (req, res) => { 38 | if (!req.session.email) { 39 | req.flash('notificacion' , ' --> Por favor iniciar sesion ') 40 | res.redirect("/users/login"); 41 | return; 42 | } 43 | dbNotas.getAllNotes( 44 | req.query.sortBy, 45 | req.session.email, 46 | (err) => { 47 | res.render("error", { 48 | error: err, 49 | }); 50 | }, 51 | (notes) => { 52 | const empty = []; 53 | empty.push({text : `${req.session.name}` }) 54 | if (notes!= '') { 55 | res.render("notes/all-notes", { 56 | notes: utils.formatNotesListForView(notes), 57 | userName: req.session.name, 58 | }); 59 | } 60 | else{ 61 | res.render("notes/all-notes", { 62 | notes: utils.formatNotesListForView(notes), 63 | userName: req.session.name, 64 | empty 65 | }); 66 | } 67 | } 68 | ); 69 | }; 70 | 71 | notesCtrl.renderEditForm = (req, res) => { 72 | if (!req.session.email) { 73 | req.flash('notificacion' , ' --> Por favor iniciar sesion ') 74 | res.redirect("/users/login"); 75 | return; 76 | } 77 | if (!req.query.id) { 78 | res.render("error", { 79 | error: "Información no válida", 80 | }); 81 | return; 82 | } 83 | const myId = req.query.id; 84 | 85 | dbNotas.getNote( 86 | myId, 87 | (err) => { 88 | res.render("error", { 89 | error: err, 90 | }); 91 | }, 92 | (note) => { 93 | if (note.email != req.session.email) { 94 | const errors = []; 95 | req.session.destroy(); 96 | res.redirect("/users/login"); 97 | return; 98 | } else { 99 | res.render("notes/edit-note", { 100 | note: utils.formatNotesForView(note), 101 | userName: req.session.name, 102 | }); 103 | } 104 | } 105 | ); 106 | }; 107 | 108 | notesCtrl.renderUpdateNote = (req, res) => { 109 | if (!req.session.email) { 110 | req.flash('notificacion' , ' --> Por favor iniciar sesion ') 111 | res.redirect("/users/login"); 112 | return; 113 | } 114 | 115 | let notEdit = req.body; 116 | if (!req.body.id || !utils.isValidNoteData(notEdit)) { 117 | res.render("error", { 118 | error: 119 | "Alguno de los datos están vacíos o no son válidos para la edición", 120 | }); 121 | return; 122 | } 123 | 124 | dbNotas.updateNote( 125 | notEdit.id, 126 | notEdit, 127 | (err) => { 128 | res.render("error", { 129 | error: err, 130 | }); 131 | }, 132 | () => { 133 | req.flash('notificacion' , ' --> Nota actualizada') 134 | res.redirect("/notes"); 135 | } 136 | ); 137 | }; 138 | 139 | notesCtrl.renderDeleteNote = (req, res) => { 140 | if (!req.session.email) { 141 | req.flash('notificacion' , ' --> Por favor iniciar sesion ') 142 | res.redirect("/users/login"); 143 | return; 144 | } 145 | console.log('AQUI VA EL ID DEL DELETE' , req.query.id); 146 | 147 | if (!req.query.id) { 148 | res.render("error", { 149 | error: "Información no válida", 150 | }); 151 | return; 152 | } 153 | 154 | dbNotas.deteleNote( 155 | req.query.id, 156 | (err) => { 157 | res.render("error", { 158 | error: err, 159 | }); 160 | }, 161 | () => { 162 | req.flash('notificacion' , ' --> Nota eliminada') 163 | res.redirect("/notes"); 164 | } 165 | ); // borra a la db 166 | }; 167 | 168 | module.exports = notesCtrl; 169 | -------------------------------------------------------------------------------- /src/views/estudiar.hbs: -------------------------------------------------------------------------------- 1 | 2 |
3 | {{!-- Heading --}} 4 |

Pomodoro App

5 | {{!-- Main Timer --}} 6 | {{!-- Selection Button --}} 7 | 8 |
9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | {{!-- Clock --}} 17 |
18 |
19 | 20 |
21 |
22 | : 23 |
24 |
25 | 26 |
27 |
28 | 29 | {{!-- Finish Message --}} 30 |
31 |

32 |
33 | {{!-- Start and reset buttons --}} 34 |
35 | 36 | 37 |
38 |
39 | 40 |
41 |

INFORMACION

42 |
43 |

44 |

Que es la tecnica Pomodoro?

45 | 46 |

La Técnica Pomodoro es un método para mejorar la administración del tiempo dedicado a una actividad. Fue creado por Francesco Cirillo a fines de la década de 1980. Se basa en usar un temporizador para dividir el tiempo en intervalos fijos, llamados pomodoros, de 25 minutos de actividad, seguidos de 5 minutos de descanso, con pausas más largas cada cuatro pomodoros. - wikipedia

47 | 48 |

Como se realizan los pomodoros?

49 | 57 | 58 |

Usos y beneficios

59 | 60 |

El método se basa en la idea de que las pausas regulares pueden mejorar la agilidad mental,​ y nos motiva a ofrecer una respuesta eficiente frente al tiempo, en lugar del estado de ansiedad que suele provocar el "devenir" del tiempo del que se habla en los escritos de Henri Bergson y Eugene Minkowski. 61 | Además, al prevenir la multitarea, ayuda a alcanzar un estado de foco más elevado, que se hace sostenible gracias a las pausas regulares. 62 | 63 | Esta técnica se relaciona con conceptos como timeboxing y desarrollo iterativo e incremental, usados en el desarrollo de software, en contextos de desarrollo ágil, principalmente. El método también ha sido adoptado en el contexto de pair programming (programación en pareja).

64 | 65 |

66 |
67 | 68 | 156 | --------------------------------------------------------------------------------