Skip to content
This repository was archived by the owner on Jul 11, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
80df8e6
subiendo mis estilos
andreatoledo Apr 22, 2020
5c7904b
Changes in CSS, please check
9JazzCodeLBM Apr 23, 2020
3300015
subiendo funcionalidad de likes
andreatoledo Apr 24, 2020
40c9941
Merge branch 'master' of https://github.com/Zeltzin1996/CDMX009-Socia…
andreatoledo Apr 24, 2020
4b557f0
Inicio de Sesión con facebook y google
Yaki-Zeltzin Apr 24, 2020
92a7bdb
uploading likes functionality
andreatoledo Apr 24, 2020
f42db11
uploading likes functionality
andreatoledo Apr 24, 2020
75b77f2
Starting with testing
9JazzCodeLBM Apr 27, 2020
287b9e5
login validation testing
Yaki-Zeltzin Apr 27, 2020
681565d
Working with testing
9JazzCodeLBM Apr 28, 2020
dc774a0
Trying to download changes
9JazzCodeLBM Apr 28, 2020
9850ec8
Update Readme.md
9JazzCodeLBM Apr 29, 2020
ce2e8eb
Update Readme.md
9JazzCodeLBM Apr 29, 2020
c7784f4
testing create account
andreatoledo Apr 30, 2020
6eb688b
changes readme
andreatoledo Apr 30, 2020
3bd5a1d
Add files via upload
9JazzCodeLBM Apr 30, 2020
a625487
Adding images in ReadMe
9JazzCodeLBM Apr 30, 2020
0de4c4d
Update Readme.md
9JazzCodeLBM Apr 30, 2020
8512a3d
Adding images in ReadMe
9JazzCodeLBM Apr 30, 2020
4a32626
Cleanning files
9JazzCodeLBM Apr 30, 2020
2609348
Checking readme
9JazzCodeLBM Apr 30, 2020
2801454
ReadMe
9JazzCodeLBM Apr 30, 2020
6ea1915
Again readme
9JazzCodeLBM Apr 30, 2020
614d636
Again readme with images
9JazzCodeLBM Apr 30, 2020
6b70448
Update Readme.md
9JazzCodeLBM Apr 30, 2020
353ae06
Update Readme.md
9JazzCodeLBM Apr 30, 2020
f482e25
adding commits
Yaki-Zeltzin Apr 30, 2020
5bd21e9
adding commits
Yaki-Zeltzin Apr 30, 2020
6499c98
modifying post and user profile
andreatoledo May 5, 2020
d708dde
modifying post and user profile
andreatoledo May 5, 2020
df789df
Update Readme.md
andreatoledo May 6, 2020
851442e
Update Readme.md
andreatoledo May 6, 2020
4b4f0f0
Update Readme.md
9JazzCodeLBM May 7, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 60 additions & 20 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
# SOCIAL NETWORK
## PROYECTO: EDU-LINE
## RESUMEN:
Red Social sobre temas de educación

## INVESTIGACIÓN UX:
Aplicación dirigida a usuarios especialistas en el tema y padres de familia que se podrán comunicar a través de esta red social; compartir tips, técnicas y demás información que ayude mejorar la educación de sus hijos o dar pautas para que los profesionales mejoren su forma de enseñar.

## Historias de Usuario:

* Como usuario nuevo debo poder crear una cuenta con email y password válidos para poder iniciar sesion e ingresar a la red social.

* Como usuario nuevo debo poder tener la opción de iniciar sesión con mi cuenta de Google o Facebook para ingresar a la red social sin necesidad de crear una cuenta de email válido.

* Como usuario loggeado debo poder crear, guardar, modificar en el mismo lugar (in place) y eliminar una publicación (post) privada o pública, que puede ser una frase o una imagen.

* Como usuario loggeado debo poder ver todos los posts públicos y privados que he creado hasta ese momento, desde el más reciente hasta el más antiguo, así como la opción de poder cambiar la configuración de privacidad de mis post.

* Yo como usuario loggeado, puedo dar like y llevar un conteo de likes en mi publicación así como poder escribir, guardar, editar o eliminar un comentario en mi publicación.

* Al final debo poder ingresar a la red social y poder visualizar los datos de mi perfil creado o editarlos.

## FEEDBACK: SI

## PROTOTIPO BAJA FIDELIDAD:

![alt text](https://raw.githubusercontent.com/Zeltzin1996/CDMX009-Social-Network/master/SocialNet1.jpg)
![alt text](https://raw.githubusercontent.com/Zeltzin1996/CDMX009-Social-Network/master/SocialNet2.jpg)
![alt text](https://raw.githubusercontent.com/Zeltzin1996/CDMX009-Social-Network/master/SocialNet3.jpg)
![alt text](https://raw.githubusercontent.com/Zeltzin1996/CDMX009-Social-Network/master/SocialNet4.jpg)
![alt text](https://raw.githubusercontent.com/Zeltzin1996/CDMX009-Social-Network/master/SocialNet5.jpg)

## PROTOTIPO ALTA FIDELIDAD (FIGMA):

![alt text](https://raw.githubusercontent.com/Zeltzin1996/CDMX009-Social-Network/master/SocialNetFigma.jpg)

## PROTOTIPO FINAL:



# Creando una Red Social

Bienvenida a tu primer proyecto del track de Frontend en Laboratoria.
Expand Down Expand Up @@ -147,43 +187,43 @@ anterior en la siguiente sección.

### HTML y CSS

* [ ] [HTML semántico](https://developer.mozilla.org/en-US/docs/Glossary/Semantics#Semantics_in_HTML)
* [ ] [CSS `flexbox`](https://css-tricks.com/snippets/css/a-guide-to-flexbox/)
* [ ] Construir tu aplicación respetando el diseño realizado (maquetación).
* [] [HTML semántico](https://developer.mozilla.org/en-US/docs/Glossary/Semantics#Semantics_in_HTML)
* [🤔] [CSS `flexbox`](https://css-tricks.com/snippets/css/a-guide-to-flexbox/)
* [] Construir tu aplicación respetando el diseño realizado (maquetación).

### DOM y Web APIs

* [ ] [Manipulación dinámica del DOM](https://developer.mozilla.org/es/docs/Referencia_DOM_de_Gecko/Introducci%C3%B3n)
* [ ] [History API](https://developer.mozilla.org/es/docs/DOM/Manipulando_el_historial_del_navegador)
* [ ] [`localStorage`]
* [] [Manipulación dinámica del DOM](https://developer.mozilla.org/es/docs/Referencia_DOM_de_Gecko/Introducci%C3%B3n)
* [] [History API](https://developer.mozilla.org/es/docs/DOM/Manipulando_el_historial_del_navegador)
* [] [`localStorage`]

### Javascript

* [ ] [Uso de callbacks](https://developer.mozilla.org/es/docs/Glossary/Callback_function)
* [ ] [Consumo de Promesas](https://scotch.io/tutorials/javascript-promises-for-dummies#toc-consuming-promises)
* [ ] Uso ES modules
([`import`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)
| [`export`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export))
* [🤔] [Uso de callbacks](https://developer.mozilla.org/es/docs/Glossary/Callback_function)
* [🤔] [Consumo de Promesas](https://scotch.io/tutorials/javascript-promises-for-dummies#toc-consuming-promises)
* [🤔] Uso ES modules
* [✔] ([`import`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)
* [✔] `export`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export))

### Firebase

* [ ] [Firestore](https://firebase.google.com/docs/firestore)
* [ ] [Firebase Auth](https://firebase.google.com/docs/auth/web/start)
* [ ] [Firebase security rules](https://firebase.google.com/docs/rules)
* [ ] [Uso de onSnapshot](https://firebase.google.com/docs/firestore/query-data/listen)
* [✔] ] [Firebase Auth](https://firebase.google.com/docs/auth/web/start)
* [🤔] [Firebase security rules](https://firebase.google.com/docs/rules)
* [🤔] [Uso de onSnapshot](https://firebase.google.com/docs/firestore/query-data/listen)
| [onAuthStateChanged](https://firebase.google.com/docs/auth/web/start#set_an_authentication_state_observer_and_get_user_data)

### Testing

* [ ] [Testeo de tus funciones](https://jestjs.io/docs/es-ES/getting-started)
* [🤔] [Testeo de tus funciones](https://jestjs.io/docs/es-ES/getting-started)
* [ ] [Testeo asíncrono](https://jestjs.io/docs/es-ES/asynchronous)
* [ ] [Mocking](https://jestjs.io/docs/es-ES/manual-mocks)

### Colaboración en Github

* [ ] Branches
* [ ] Pull Requests
* [ ] Tags
* [] Branches
* [] Pull Requests
* [] Tags

### Organización en Github

Expand All @@ -194,8 +234,8 @@ anterior en la siguiente sección.

### Buenas prácticas de desarrollo

* [ ] Modularización
* [ ] Nomenclatura / Semántica
* [] Modularización
* [🤔 ] Nomenclatura / Semántica
* [ ] Linting

***
Expand Down
Binary file added SocialNet1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SocialNet2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SocialNet3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SocialNet4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SocialNet5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SocialNetFigma.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions npm-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'config',
1 verbose cli 'set',
1 verbose cli 'prefix',
1 verbose cli '/npm',
1 verbose cli '-g' ]
2 info using npm@3.5.2
3 info using node@v8.10.0
4 info config set "prefix" "/npm"
5 verbose stack Error: EACCES: permission denied, open '/etc/npmrc'
6 verbose cwd /home/laboratoria112-am/Documentos/laboratoria/CDMX009-Social-Network
7 error Linux 4.15.0-72-generic
8 error argv "/usr/bin/node" "/usr/bin/npm" "config" "set" "prefix" "/npm" "-g"
9 error node v8.10.0
10 error npm v3.5.2
11 error path /etc/npmrc
12 error code EACCES
13 error errno -13
14 error syscall open
15 error Error: EACCES: permission denied, open '/etc/npmrc'
15 error { Error: EACCES: permission denied, open '/etc/npmrc'
15 error errno: -13,
15 error code: 'EACCES',
15 error syscall: 'open',
15 error path: '/etc/npmrc' }
16 error Please try running this command again as root/Administrator.
17 verbose exit [ -13, true ]
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"htmlhint": "htmlhint dist/*.html ",
"eslint": "eslint --ext .js src/ test/",
"stylelint": "stylelint --aei src/**/*.css",
"pretest": "npm run htmlhint && npm run eslint && npm run stylelint",
"test": "jest --coverage",
"start": "serve src/"
},
Expand All @@ -26,11 +25,16 @@
"eslint-config-airbnb-base": "^13.2.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jest": "^22.1.2",
"firebase-functions-test": "^0.2.1",
"htmlhint": "^0.11.0",
"jest": "^24.8.0",
"jest": "^24.9.0",
"regenerator-runtime": "^0.13.1",
"serve": "^11.0.2",
"stylelint": "^10.1.0",
"stylelint-config-recommended": "^2.2.0"
},
"dependencies": {
"firebase-admin": "^8.11.0",
"firebase-functions": "^3.6.1"
}
}
}
3 changes: 3 additions & 0 deletions src/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
62 changes: 62 additions & 0 deletions src/auth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@


// LOGIN CON EMAIL Y PWD

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eliminar este comentario


function emailLogin(email, password) {
//(!email || !password) return 'No existe email o password'
//if (password.length < 6) return 'No cumple con 6 caracteres'

firebase.auth()
.signInWithEmailAndPassword(email, password)
.catch(function(error) {
// Handle Errors here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Estos comentarios deben eliminarse

const errorCode = error.code;
const errorMessage = error.message;
if (errorCode === "auth/invalid-email"){
alert("Email inválido")
} if (errorCode === "auth/user-disabled"){
alert("Usuario deshabilitado")
} if (errorCode === "auth/user-not-found"){
alert("Usuario no encontrado")
} if (errorCode === "auth/wrong-password"){
alert("Contraseña incorrecta")
}
console.log(`${errorCode} ${errorMessage}`)
// ...
});
}


function logout() {
firebase.auth().signOut().then(function() {
// Sign-out successful.
//return true
}).catch(function(error) {
// An error happened.
//return false
console.log(error)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todos estos comentarios deben eliminarse

});
}

// CREAR CUENTA MAIL Y PWD
function createAccount(mail, pwd) {
firebase.auth().createUserWithEmailAndPassword(mail, pwd)
.then(function(){
window.socialNetwork.verification();
})
.catch(function(error) {
// Handle Errors here.
const errorCode = error.code;
const errorMessage = error.message;
if (errorCode === "auth/email-already-in-use"){
alert("Correo en uso")
//return "Correo en uso"
} if (errorCode === "auth/invalid-email"){
alert("Email inválido")
//return "Email inválido"
} if (errorCode === "auth/weak-password"){
alert("Contraseña tiene que tener más de 6 caracteres")
}
console.log(`${errorCode} ${errorMessage}`)
});
}
74 changes: 74 additions & 0 deletions src/auth.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*import * as auth from "./auth.js"

/global.firebase = {
auth: jest.fn(() => ({
signInWithEmailAndPassword: jest.fn(() => new Promise((resolve, reject) => {
resolve(true)
}))
}))
}

test('Validaciones de emailLogin', () => {
let email = "antropologia@gmail.com"
let password = "123D"

expect(auth.emailLogin(email, password)).toBe('No cumple con 6 caracteres');
expect(auth.emailLogin('', password)).toBe('No existe email o password');
});

test('emailLogin se ejecuta correctamente', () => {
let email = "antropologia@gmail.com"
let password = "123DKL"

auth.emailLogin(email, password).then(valor => {
expect(valor).toBe(true)
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Que pro se ven estas pruebas! muy bien!

});



global.firebase = {
auth: jest.fn(() => ({
createUserWithEmailAndPassword: jest.fn(() => new Promise((resolve, reject) => {
resolve(true)
}))
}))
}

function falsaCreateAccount(email, pass){
if(!email.includes("@")){
return "Email inválido"
}
}

test('Validacion incorrecta', () => {
let email = "suregmail.com"
let password = "123D"

expect(falseCreateAccount(email, password)).toBe('Email inválido');
expect(auth.createAccount(password)).toBe('No cumple con los 6 caracteres');
});


test('Validacion correcta', () => {
let email = "sure@gmail.com"
let password = "123DOP"

auth.createAccount(email, password).then(valor => {
expect(valor).toBe(true)
});
});*/

/*function falsesignInWithEmailAndPassword(email, password){
if(!email.includes("@")){
return "email invalido"
}
}

test('Validacion incorrecta', () => {
let email = "suregmail.com"
let password = "123D"

expect(falsesignInWithEmailAndPassword(email, password)).toBe('Email inválido');
expect(auth.emailLogin(password)).toBe('No cumple con los 6 caracteres');
});*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo este archivo está comentado, si no se utiliza debe eliminarse.

Loading