Skip to content

Commit

Permalink
Merge pull request #63 from Arquisoft/develop
Browse files Browse the repository at this point in the history
Version0.1
  • Loading branch information
UO284262 authored Mar 13, 2023
2 parents 2af3a0c + a620e69 commit 981ad2a
Show file tree
Hide file tree
Showing 64 changed files with 35,151 additions and 33,045 deletions.
2 changes: 1 addition & 1 deletion docs/04_solution_strategy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Refer to details in the following sections.

Como lenguaje de programación y fundamento de la aplicación hemos decidido utilizar TypeScript en contra parte de JavaScript, ya que el tipado estático de TypeScript nos facilitará entender el código creado por el resto del equipo. Además usaremos las siguientes tecnologías:

* MongoDB: Base de datos NoSQL sencilla de gestionar. Y con la capacidad de desplegar en la nube gracias a MongoDB Atlas.
* MongoDB: Base de datos NoSQL sencilla de gestionar. Y con la capacidad de desplegar en la nube gracias a MongoDB Atlas. Usaremos la librería mongoose para facilitar el manejo de la base de datos desde TypeScipt.
* React: Biblioteca de JavaScript utilizada para crear la interfaz de la aplicación.
* NodeJS: Permite la ejecución de JavaScript del lado del servidor, además de hacer la web fácilmente escalable.

Expand Down
35 changes: 20 additions & 15 deletions docs/06_runtime_view.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,49 +30,54 @@ There are many notations for describing scenarios, e.g.

Por el momento el contenido de este apartado no es muy extenso debido a la pronta etapa rn la que se encuentra em proyecto, a medida que se vaya avanzando este documento se irá actualizando y enriqueciendo.

=== User Sign Up
=== First level of detail

==== User Sign Up
Proceso de crear un nuevo usuario
[plantuml,"Register sequence diagram",png]
----
header Runtime View
title User Registration
Actor User
Participant LoMap
Participant POD as "User's POD"
Database DataBase as "DataBase"
User -> LoMap: Sing up as a new user
User -> LoMap: Sing up as a new user filling the form
User <-- LoMap: Ask user for his WebID
User --> LoMap: Bring his WebID
LoMap --> LoMap: Verify WebID
...LoMap wait till get POD permissions......
User -> LoMap: Provide his WebID
LoMap -> POD: Verify WebID
LoMap <-- POD: Gives LoMap permissions
LoMap -> DataBase: Add user credentials
LoMap <-- DataBase: Confirm credentials addition
User <- LoMap: Show confirm dialog to User
User <-- LoMap: Show confirm dialog to User
----

=== Login and Logout
==== Login and Logout
El proceso de login y logout:
[plantuml,"Log in - log out sequence diagram",png]
----
header Runtime View
title Log in - Log out
Actor User
Participant LoMap
Participant POD as "User's POD"
Database DataBase as "DataBase"
User -> LoMap: Log in with his credentials
LoMap -> DataBase: Check user credentials
LoMap <-- DataBase: Confirm credentials
LoMap -> POD: Check POD availability
POD --> LoMap: Confirm POD availability
...User interacts with the apllication......
User -> LoMap: Log out from apllication
LoMap --> User: Show exit dialog and closes user session
----

=== Edit web ID
==== Edit web ID
Un usuario quiere cambiar su Web ID:

[plantuml,"Sequence diagram",png]
Expand All @@ -81,26 +86,26 @@ header Runtime View
title WebID change
Actor User
Participant LoMap
Participant POD as "User's POD"
Database DataBase as "DataBase"
...User log in as shown......
User -> LoMap: Asks for WebID change
User <-- LoMap: Show edit menu to User
User -> LoMap: Provide the new WebID
LoMap --> LoMap: Verify WebID
...LoMap wait till get POD permissions......
LoMap -> POD: Verify WebID
LoMap <-- POD: Gives LoMap permissions
LoMap -> DataBase: Update user credentials
LoMap <-- DataBase: Confirm credentials
LoMap -> User: Show confirm dialog
LoMap --> User: Show confirm dialog
...User log out as shown......
----

=== Place adding
==== Place adding
Proceso de añadir un lugar al mapa:
[plantuml,"Add favorite place sequence diagram",png]
----
Expand All @@ -119,7 +124,7 @@ User -> LoMap: Provide the info
LoMap -> DataBase: Add new user data
LoMap <-- DataBase: Confirm data addition
LoMap -> User: Show confirm dialog
LoMap --> User: Show confirm dialog
...User log out as shown......
Expand Down
5 changes: 1 addition & 4 deletions docs/07_deployment_view.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,4 @@ Nuestra infraestructura estará formada por los siguientes elementos:
* Servidor: Contenedor de nuestra aplicación para despliegue. Todavía sin concretar.
* WebApp: Front-end de nuestra aplicación.
* RestApi: Back-end de nuestra aplicación.
* MongoDB: En este punto, base de datos elegida para la aplicación. Con el uso de MongoDB Atlas para su despliegue.



* MongoDB: En este punto, base de datos elegida para la aplicación. Con el uso de MongoDB Atlas para su despliegue y mongoose para su implementación.
79 changes: 79 additions & 0 deletions docs/appendix_1.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
[[section-appendix-1]]
== Appendix

=== Interface prototypes



[role="arc42help"]
****
.Contents
Some interface prototypes for the final application
.Motivation
Give a first view of what the application was ment to look like at the begginning of the development
.Form
Images with a identifier title
****

.Sing up
image:appendix_1_sing_up.png["Sing up window"]

.Log in
image:appendix_1_log_in.png["Log in window"]

.My places
image:appendix_1_my_places.png["My places window"]

.Place filter
image:appendix_1_place_filter.png["Place filter window"]

.Friend menu
image:appendix_1_friend_menu.png["Friend menu window"]

.Friend's places
image:appendix_1_friends_places.png["Friend's places window"]

.Friend's place filter
image:appendix_1_friends_place_filter.png["Friend's place filter window"]

.Edit profile
image:appendix_1_edit_profile.png["Edit profile window"]

=== Used libraries

[role="arc42help"]
****
.Contents
Used libraries for the final application.
.Motivation
The purpose of this section is to give an overview of application dependencies.
.Form
A table with columns <Library> and <Definition>.
****

.Libraries used for front-end development

[options="header",cols="1,2"]
|===
|Librería|Explicación
| Mui | Facilita la creación de componentes altamente personalizables
| react-router-dom | Librería usada para definir las rutas de navegación de la aplicación
| react-hook-form | Simplifica la creación de formularios al hacer que la validación de los campos de estos sea sencilla.
| sweetalert2 | Librería utilizada para mostrar ventanas emergentes, facilitando al usuario la comprensión de las acciones realizadas
|===


.Libraries used for back-end development
[options="header",cols="1,2"]
|===
|Librería|Explicación
| moongose | Librería que facilita la integración de una base de datos MongoDB y Node.js
|===
Binary file modified docs/images/03_Context_Diagram.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 modified docs/images/05_Level_3.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 modified docs/images/05_Scope_Context.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 docs/images/appendix_1_edit_profile.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 docs/images/appendix_1_friend_menu.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 docs/images/appendix_1_friends_place_filter.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 docs/images/appendix_1_friends_places.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 docs/images/appendix_1_log_in.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 docs/images/appendix_1_my_places.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 docs/images/appendix_1_place_filter.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 docs/images/appendix_1_sing_up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ include::11_technical_risks.adoc[]
// 12. Glossary
include::12_glossary.adoc[]

<<<<
// Appendix 1. Interface prototypes
include::appendix_1.adoc[]

<<<<
// About
include::about-arc42.adoc[]
23 changes: 22 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"uuid": "^9.0.0"
}
}
42 changes: 31 additions & 11 deletions restapi/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import express, { Request, Response, Router } from 'express';
import {check} from 'express-validator';
import { check } from 'express-validator';
import * as fac from './src/facade';

const api:Router = express.Router()
const api: Router = express.Router()

interface User {
name: string;
Expand All @@ -20,17 +21,36 @@ api.get(
);

api.post(
"/users/add",[
"/users/add", [
check('name').isLength({ min: 1 }).trim().escape(),
check('email').isEmail().normalizeEmail(),
],
async (req: Request, res: Response): Promise<Response> => {
let name = req.body.name;
let email = req.body.email;
let user: User = {name:name,email:email}
users.push(user);
return res.sendStatus(200);
}
],
async (req: Request, res: Response): Promise<Response> => {
let name = req.body.name;
let email = req.body.email;
let user: User = { name: name, email: email }
users.push(user);
return res.sendStatus(200);
}
);

api.get("/sesionmanager/user", async (req: Request, res: Response): Promise<Response> => {
console.log("hi")
let user = fac.FactoryLoMap.getSesionManager().usuarioEnSesion();
console.log(user.username)
return res.status(200).send(user);
})

api.post("/sesionmanager/signup", async (req: Request, res: Response): Promise<Response> => {
let user = req.body.user;
console.log(user.username)
return res.status(200).send(fac.FactoryLoMap.getSesionManager().registrarse(user));
})

api.post("/sesionmanager/login", async (req: Request, res: Response): Promise<Response> => {
let user = req.body.user;
console.log(user.username)
return res.status(200).send(fac.FactoryLoMap.getSesionManager().iniciarSesion(user));
})

export default api;
Loading

0 comments on commit 981ad2a

Please sign in to comment.