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
25 commits
Select commit Hold shift + click to select a range
de229ff
se agrego toda la maquetacion del registro y de iniciar sesion tambie…
Sheiki1 Apr 15, 2020
627ac60
se agregaron estilos con bulma y ya se puede cambiar de registro a in…
Sheiki1 Apr 16, 2020
7ec833b
se agrego la opcion de conectarse por medio de facebook y de igual ma…
Sheiki1 Apr 17, 2020
12e91bd
add post page, MVC, login and sign up with email and password
fabi-pharoxysme Apr 30, 2020
25a9612
bajando cambios
Sheiki1 Apr 30, 2020
faa827e
add login with fb and google
fabi-pharoxysme Apr 30, 2020
6f74b07
g
Sheiki1 May 1, 2020
75cc426
Merge branch 'master' of https://github.com/Sheiki1/CDMX009-Social-Ne…
Sheiki1 May 1, 2020
ff8c923
Se agregan imagenes
astridgutz May 4, 2020
6bbcc69
add post function
fabi-pharoxysme May 5, 2020
6cd37ec
change everything
Sheiki1 May 7, 2020
5e2d17a
change everything
Sheiki1 May 7, 2020
0c6ffd5
Add new post, delete post and profile functions
fabi-pharoxysme May 7, 2020
77ac6ff
Bake Recipes Book
astridgutz May 7, 2020
13f301f
Se agregan imagenes
astridgutz May 7, 2020
730d57e
Cambios en Readme
astridgutz May 7, 2020
53711bb
ad objetivos de aprendizaje
fabi-pharoxysme May 7, 2020
ff63dd9
agregue mis objetivos de aprendizaje
Sheiki1 May 7, 2020
8d20375
last change
Sheiki1 May 7, 2020
26aa2cc
ultimo cambio se objetivos de aprendizaje
Sheiki1 May 7, 2020
778689f
Cambios al readme
astridgutz May 7, 2020
dcb5130
Cambios al Readme
astridgutz May 7, 2020
6fa57d4
Cambios al Readme
astridgutz May 7, 2020
a41f824
add button delete function in profile
fabi-pharoxysme May 8, 2020
0073f65
Merge pull request #1 from Sheiki1/fabi-branch
fabi-pharoxysme May 8, 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
283 changes: 115 additions & 168 deletions Readme.md

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@
"serve": "^11.0.2",
"stylelint": "^10.1.0",
"stylelint-config-recommended": "^2.2.0"
},
"dependencies": {
"bulma": "^0.8.2"
}
}
}
72 changes: 72 additions & 0 deletions src/controller/firebase-controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { postPage } from '../views/postpageProfile.js';

export const db = firebase.firestore();
// Authentication
const usersRef = db.collection('users');
const auth = firebase.auth();
Comment on lines +3 to +6

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Me agrada que tengan la buena practica de nombran const a las variables que no cambian ;)


export function saveUser(user) {
const { displayName, uid, photoURL, email } = user;
const u = {
displayName,
uid,
photoURL,
email,
};
usersRef.doc(user.uid).set(u);
}
export const login = (email, password) => {
Comment on lines +17 to +18

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
}
export const login = (email, password) => {
}
export const login = (email, password) => {

Sugerencia

auth.signInWithEmailAndPassword(email, password)
.then((snap => {
console.log(snap);
postPage();
return snap.user;
}))
.catch((error => {
let errorCode = error.code;
let errorMessage = error.message;
console.log(`Lo sentimos : ${errorCode} ${errorMessage} `);
return error;
}));
};
export const signup = (email, password) => {
auth.createUserWithEmailAndPassword(email, password)
.then((snap => {
console.log(snap);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

En una versión de construcción esta bien tener los console.log( ) pero en una versión de producción (y más para revisión) se deben de quitar.

Suggested change
console.log(snap);

saveUser(snap.user);
let mail = snap.user.email;
alert(`${mail} registro exitoso!`);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No se recomienda el uso de alerts porque suele ser confuso para el usuario.

postPage();
return snap.user;
}))
.catch((error => {
let errorCode = error.code;
let errorMessage = error.message;
alert(`lo sentimos: ${errorCode} ${errorMessage}`)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

otro alert

Suggested change
alert(`lo sentimos: ${errorCode} ${errorMessage}`)

return error;
}));
};
// Login with google
export function loginGoogle() {
let provider = new firebase.auth.GoogleAuthProvider();
return firebase.auth().signInWithPopup(provider)
.then(snap => {
saveUser(snap.user);
postPage();
return snap.user;
});
}
// Login with Facebook

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Me agrada la forma breve que documentan su código con estos pequeños comentarios, eso esta genial.

Suggested change
// Login with Facebook
// Login with Facebook

export function loginFace() {
var provider = new firebase.auth.FacebookAuthProvider();
return firebase.auth().signInWithPopup(provider)
.then((result => {
saveUser(result.user);
postPage();
console.log(result.user);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
console.log(result.user);

return result.user;
}));
}
// Add Post

export const postsRef = db.collection('posts');
Binary file added src/images/Imagen1.png
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 src/images/bienvenidoapp.png
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 src/images/complete_recipe.png
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 src/images/faceImage.png
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 src/images/gmailImage.png
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 src/images/logo.png
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 src/images/logo1.png
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 src/images/logob.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 src/images/pantalla1.png
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 src/images/pantalla2.png
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 src/images/pantalla3.png
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 src/images/pantalla4.png
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 src/images/pantallapost.png
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 src/images/postingrecipes.png
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 src/images/profileposts.png
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 src/images/prot1v2.png
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 src/images/prot2v2.png
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 src/images/prot3v2.png
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 src/images/prot4v2.png
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 src/images/registrate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 27 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,35 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.8.2/css/bulma.min.css">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

bootstrap esta instalado abajo

<link rel="stylesheet" href="style.css">
<title>social-network-recipes</title>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Regularmente una sola palabra puede describir mejor el titulo

Suggested change
<title>social-network-recipes</title>
<title>recipes</title>

</head>
<body>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<script src="https://www.gstatic.com/firebasejs/7.14.2/firebase.js"></script>
<script>
var firebaseConfig = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

no se recomienda el uso de var

Suggested change
var firebaseConfig = {
const firebaseConfig = {

apiKey: "AIzaSyBucI_PfC9w2g4RpcojM47YE9aEcJrdUrA",
authDomain: "social-network-recipes.firebaseapp.com",
databaseURL: "https://social-network-recipes.firebaseio.com",
projectId: "social-network-recipes",
storageBucket: "social-network-recipes.appspot.com",
messagingSenderId: "265483566973",
appId: "1:265483566973:web:4eacc08547367e47ed1614",
measurementId: "G-XTZT14HD22"
};
firebase.initializeApp(firebaseConfig);
firebase.analytics();
</script>
<script type="module" src="index.js"></script>
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
Comment on lines +31 to +34

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Dos Frameworks de estilos causara conflictos, no es nada recomendable, decidan desde un inicio que utilizar ¿bulma o bootstrap? en caso de que cambien por uno o por otro se recomienda que desinstalen el otro(borrando todas las dependencias)

Suggested change
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
//bulma esta instalado arriba, en la linea 7 esta su enlace cdn

<div id="root" class="root"></div>
<div id = "footer"></div>
</body>
</html>
Loading