From 42dad5d0370b957c5754baeb62887d1387730c66 Mon Sep 17 00:00:00 2001 From: uo276188 Date: Sun, 9 Apr 2023 23:10:34 +0200 Subject: [PATCH 1/4] first commit --- restapi/build/builders/locationBuilder.js | 35 ++++++ restapi/build/locationType.js | 11 ++ .../build/podsAccess/authenticationService.js | 105 ++++++++++++++++++ restapi/build/podsAccess/locationsService.js | 90 +++++++++++++++ restapi/build/repo/db.js | 47 ++++++++ restapi/build/repo/repository.js | 105 ++++++++++++++++++ restapi/build/routes/authenticationRouter.js | 14 +++ restapi/build/routes/locationsRouter.js | 12 ++ restapi/build/server.js | 31 ++++++ restapi/build/validators/locationValidator.js | 25 +++++ 10 files changed, 475 insertions(+) create mode 100644 restapi/build/builders/locationBuilder.js create mode 100644 restapi/build/locationType.js create mode 100644 restapi/build/podsAccess/authenticationService.js create mode 100644 restapi/build/podsAccess/locationsService.js create mode 100644 restapi/build/repo/db.js create mode 100644 restapi/build/repo/repository.js create mode 100644 restapi/build/routes/authenticationRouter.js create mode 100644 restapi/build/routes/locationsRouter.js create mode 100644 restapi/build/server.js create mode 100644 restapi/build/validators/locationValidator.js diff --git a/restapi/build/builders/locationBuilder.js b/restapi/build/builders/locationBuilder.js new file mode 100644 index 0000000..fdede9a --- /dev/null +++ b/restapi/build/builders/locationBuilder.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.buildTestLocationThing = exports.locationToThing = exports.thingToLocation = void 0; +const solid_client_1 = require("@inrupt/solid-client"); +const vocab_common_rdf_1 = require("@inrupt/vocab-common-rdf"); +function thingToLocation(locationThing) { + return { + id: locationThing.url, + name: (0, solid_client_1.getStringNoLocale)(locationThing, vocab_common_rdf_1.SCHEMA_INRUPT.name), + locationType: (0, solid_client_1.getStringNoLocale)(locationThing, vocab_common_rdf_1.SCHEMA_INRUPT.description), + latitude: (0, solid_client_1.getDecimal)(locationThing, vocab_common_rdf_1.SCHEMA_INRUPT.latitude), + longitude: (0, solid_client_1.getDecimal)(locationThing, vocab_common_rdf_1.SCHEMA_INRUPT.longitude) + }; +} +exports.thingToLocation = thingToLocation; +function locationToThing(location) { + return (0, solid_client_1.buildThing)((0, solid_client_1.createThing)({ name: location.name })) + .addStringNoLocale(vocab_common_rdf_1.SCHEMA_INRUPT.name, location.name) + .addStringNoLocale(vocab_common_rdf_1.SCHEMA_INRUPT.description, location.locationType) + .addDecimal(vocab_common_rdf_1.SCHEMA_INRUPT.latitude, location.latitude) + .addDecimal(vocab_common_rdf_1.SCHEMA_INRUPT.longitude, location.longitude) + .addUrl(vocab_common_rdf_1.RDF.type, "https://schema.org/Place") + .build(); +} +exports.locationToThing = locationToThing; +function buildTestLocationThing() { + return (0, solid_client_1.buildThing)((0, solid_client_1.createThing)({ name: "Location2" })) + .addStringNoLocale(vocab_common_rdf_1.SCHEMA_INRUPT.name, 'nuevaLocalizacion2') + .addStringNoLocale(vocab_common_rdf_1.SCHEMA_INRUPT.description, "bar") + .addDecimal(vocab_common_rdf_1.SCHEMA_INRUPT.latitude, 1) + .addDecimal(vocab_common_rdf_1.SCHEMA_INRUPT.longitude, 2) + .addUrl(vocab_common_rdf_1.RDF.type, "https://schema.org/Place") + .build(); +} +exports.buildTestLocationThing = buildTestLocationThing; diff --git a/restapi/build/locationType.js b/restapi/build/locationType.js new file mode 100644 index 0000000..a86f3a5 --- /dev/null +++ b/restapi/build/locationType.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LocationType = void 0; +var LocationType; +(function (LocationType) { + LocationType["shop"] = "shop"; + LocationType["bar"] = "bar"; + LocationType["restaurant"] = "restaurant"; + LocationType["sight"] = "sight"; + LocationType["monument"] = "monument"; +})(LocationType = exports.LocationType || (exports.LocationType = {})); diff --git a/restapi/build/podsAccess/authenticationService.js b/restapi/build/podsAccess/authenticationService.js new file mode 100644 index 0000000..3c45436 --- /dev/null +++ b/restapi/build/podsAccess/authenticationService.js @@ -0,0 +1,105 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const solid_client_authn_node_1 = require("@inrupt/solid-client-authn-node"); +exports.default = { + initLogin: function (req, res) { + return __awaiter(this, void 0, void 0, function* () { + // create a new Session + const session = new solid_client_authn_node_1.Session(); + req.session.solidSessionId = session.info.sessionId; + console.log(req.query.providerURL); + console.log(req.session.solidSessionId); + //Redirect user to POD provider login + const redirectToSolidIdentityProvider = (providerURL) => { + res.redirect(providerURL); + }; + // redirect handler will handle sending the user to their POD Provider. + yield session.login({ + // If login successfully, redirect here + redirectUrl: 'http://localhost:8082/auth/loginconfirm', + // Set user SOLID identity provider + oidcIssuer: req.query.providerURL, + //oidcIssuer: "https://login.inrupt.com", + // Application name to show when requesting data + clientName: "LoMap", + //handler to redirect to the provider login + handleRedirect: redirectToSolidIdentityProvider + }); + }); + }, + confirmLogin: function (req, res) { + return __awaiter(this, void 0, void 0, function* () { + // If we get here, the user has logged in successfully + // Recover session information + const session = yield (0, solid_client_authn_node_1.getSessionFromStorage)(req.session.solidSessionId); + // Complete login process using the data appended by the Solid Identity Provider + try { + yield session.handleIncomingRedirect(`http://localhost:8082/auth${req.url}`); + } + catch (e) { + console.log(e); + return res.sendStatus(500); + } + // Session now contains an authenticated Session instance. + if (session.info.isLoggedIn) { + return res.redirect("http://localhost:3000/login/confirm"); + } + return res.sendStatus(401); + }); + }, + logout: function (req, res) { + return __awaiter(this, void 0, void 0, function* () { + const session = yield (0, solid_client_authn_node_1.getSessionFromStorage)(req.session.solidSessionId); + yield session.logout(); + res.redirect("http://localhost:3000"); + }); + }, + initTestLogin: function (req, res) { + return __awaiter(this, void 0, void 0, function* () { + // create a new Session + const session = new solid_client_authn_node_1.Session(); + req.session.solidSessionId = session.info.sessionId; + console.log(req.session.solidSessionId); + //Redirect user to POD provider login + const redirectToSolidIdentityProvider = (providerURL) => { + res.redirect(providerURL); + }; + // redirect handler will handle sending the user to their POD Provider. + yield session.login({ + // If login successfully, redirect here + redirectUrl: 'http://localhost:8082/auth/testloginconfirm', + // Set user SOLID identity provider + oidcIssuer: "https://login.inrupt.com", + // Application name to show when requesting data + clientName: "LoMap", + //handler to redirect to the provider login + handleRedirect: redirectToSolidIdentityProvider + }); + }); + }, + confirmTestLogin: function (req, res) { + return __awaiter(this, void 0, void 0, function* () { + // If we get here, the user has logged in successfully + // Recover session information + console.log(req.session.solidSessionId); + const session = yield (0, solid_client_authn_node_1.getSessionFromStorage)(req.session.solidSessionId); + // Complete login process using the data appended by the Solid Identity Provider + yield session.handleIncomingRedirect(`http://localhost:8082/auth${req.url}`); + console.log(session === null || session === void 0 ? void 0 : session.info.webId); + // Session now contains an authenticated Session instance. + if (session.info.isLoggedIn) { + return res.redirect("http://localhost:3000"); + } + return res.send("Not able to log in"); + }); + }, +}; diff --git a/restapi/build/podsAccess/locationsService.js b/restapi/build/podsAccess/locationsService.js new file mode 100644 index 0000000..9160b75 --- /dev/null +++ b/restapi/build/podsAccess/locationsService.js @@ -0,0 +1,90 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const solid_client_1 = require("@inrupt/solid-client"); +const solid_client_authn_node_1 = require("@inrupt/solid-client-authn-node"); +const locationBuilder_1 = require("../builders/locationBuilder"); +const locationValidator_1 = require("../validators/locationValidator"); +exports.default = { + saveLocation: function (req, res) { + return __awaiter(this, void 0, void 0, function* () { + console.log("saving location"); + console.log(req.session.solidSessionId); + const session = yield (0, solid_client_authn_node_1.getSessionFromStorage)(req.session.solidSessionId); + if (session == undefined) { + console.log("not valid session"); + return res.send('error'); + } + let locationsURL = yield getLocationsURL(session.info.webId); + if (locationsURL == undefined) { + console.log("error accessing the pod"); + return res.send("error"); + } + let location = req.body.location; + console.log(req.body); + if (!(0, locationValidator_1.validateLocation)(location)) { + console.log("not valid location"); + console.log(location); + res.send('error'); + } + let locationsSolidDataset = yield (0, solid_client_1.getSolidDataset)(locationsURL, { fetch: session.fetch } // fetch from authenticated session + ); + const locationThing = (0, locationBuilder_1.locationToThing)(location); + locationsSolidDataset = (0, solid_client_1.setThing)(locationsSolidDataset, locationThing); + let newDataset = yield (0, solid_client_1.saveSolidDatasetAt)(locationsURL, locationsSolidDataset, { fetch: session.fetch } // fetch from authenticated Session + ); + console.log("location saved"); + return res.send((0, solid_client_1.getThingAll)(newDataset).map(locationThing => (0, locationBuilder_1.thingToLocation)(locationThing))); + }); + }, + getOwnLocations: function (req, res) { + return __awaiter(this, void 0, void 0, function* () { + const session = yield (0, solid_client_authn_node_1.getSessionFromStorage)(req.session.solidSessionId); + if (session == undefined) + return res.send('error'); + let locationsURL = yield getLocationsURL(session.info.webId); + if (locationsURL == undefined) + return res.send("error"); + let locationsDataset = yield (0, solid_client_1.getSolidDataset)(locationsURL, { fetch: session.fetch } // fetch from authenticated session + ); + return res.send((0, solid_client_1.getThingAll)(locationsDataset) + .filter(locationThing => (0, locationValidator_1.validateLocationThing)(locationThing)) + .map(locationThing => (0, locationBuilder_1.thingToLocation)(locationThing))); + }); + }, + saveTestLocation: function (req, res) { + return __awaiter(this, void 0, void 0, function* () { + const session = yield (0, solid_client_authn_node_1.getSessionFromStorage)(req.session.solidSessionId); + if (session == undefined) + return res.send('error'); + let locationsURL = yield getLocationsURL(session.info.webId); + if (locationsURL == undefined) + return res.send("error"); + const locationThing = (0, locationBuilder_1.buildTestLocationThing)(); + let locationsSolidDataset = yield (0, solid_client_1.getSolidDataset)(locationsURL, { fetch: session.fetch } // fetch from authenticated session + ); + locationsSolidDataset = (0, solid_client_1.setThing)(locationsSolidDataset, locationThing); + let newDataset = yield (0, solid_client_1.saveSolidDatasetAt)(locationsURL, locationsSolidDataset, { fetch: session.fetch } // fetch from authenticated Session + ); + return res.send((0, solid_client_1.getThingAll)(newDataset).map(locationThing => (0, locationBuilder_1.thingToLocation)(locationThing))); + }); + } +}; +function getLocationsURL(webId) { + return __awaiter(this, void 0, void 0, function* () { + if (webId == undefined) + return undefined; + let webID = decodeURIComponent(webId); + const podURL = yield (0, solid_client_1.getPodUrlAll)(webID); + console.log(podURL); + return podURL + "private/"; + }); +} diff --git a/restapi/build/repo/db.js b/restapi/build/repo/db.js new file mode 100644 index 0000000..2ec836c --- /dev/null +++ b/restapi/build/repo/db.js @@ -0,0 +1,47 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.connectToDatabase = void 0; +const mongoDB = __importStar(require("mongodb")); +let client; +function connectToDatabase(connectionURL) { + return __awaiter(this, void 0, void 0, function* () { + if (client) + return client.db('lomap'); + client = new mongoDB.MongoClient(connectionURL); + client = yield client.connect(); + return client.db('lomap'); + }); +} +exports.connectToDatabase = connectToDatabase; diff --git a/restapi/build/repo/repository.js b/restapi/build/repo/repository.js new file mode 100644 index 0000000..3dbb56a --- /dev/null +++ b/restapi/build/repo/repository.js @@ -0,0 +1,105 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +class Repository { + constructor(collectionName, db) { + this.collectionName = collectionName; + this.db = db; + } + /** + * + * @param filter + * @returns {Promise<*>} + */ + find(filter) { + return __awaiter(this, void 0, void 0, function* () { + try { + const collection = this.db.collection(this.collectionName); + return yield collection.find(filter).toArray(); + } + catch (error) { + throw (error); + } + }); + } + /** + * + * @param filter + * @param page + * @returns {Promise<{total: *, friendships: *}>} + */ + findPg(filter, page) { + return __awaiter(this, void 0, void 0, function* () { + try { + const limit = 4; + const collection = this.db.collection(this.collectionName); + const collectionCount = yield collection.count(); + const cursor = collection.find(filter).skip((page - 1) * limit).limit(limit); + const result = yield cursor.toArray(); + return { result: result, total: collectionCount }; + } + catch (error) { + throw (error); + } + }); + } + /** + * + * @returns {Promise} + * @param newDocument + */ + add(newDocument) { + return __awaiter(this, void 0, void 0, function* () { + try { + const collection = this.db.collection(this.collectionName); + const result = yield collection.insertOne(newDocument); + return result.insertedId; + } + catch (error) { + throw (error); + } + }); + } + /** + * + * @param filter + * @returns {Promise<*>} + */ + delete(filter) { + return __awaiter(this, void 0, void 0, function* () { + try { + const collection = this.db.collection(this.collectionName); + return yield collection.deleteOne(filter); + } + catch (error) { + throw (error); + } + }); + } + /** + * + * @param newDocument + * @param filter + * @returns {Promise<*>} + */ + update(newDocument, filter) { + return __awaiter(this, void 0, void 0, function* () { + try { + const collection = this.db.collection(this.collectionName); + return yield collection.updateOne(filter, { $set: newDocument }); + } + catch (error) { + throw (error); + } + }); + } +} +exports.default = Repository; diff --git a/restapi/build/routes/authenticationRouter.js b/restapi/build/routes/authenticationRouter.js new file mode 100644 index 0000000..ebb3f37 --- /dev/null +++ b/restapi/build/routes/authenticationRouter.js @@ -0,0 +1,14 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const express_1 = __importDefault(require("express")); +const authenticationService_1 = __importDefault(require("../podsAccess/authenticationService")); +const authenticationRouter = express_1.default.Router(); +authenticationRouter.get("/login", authenticationService_1.default.initLogin); +authenticationRouter.get("/loginconfirm", authenticationService_1.default.confirmLogin); +authenticationRouter.get("/logout", authenticationService_1.default.logout); +authenticationRouter.get("/testlogin", authenticationService_1.default.initTestLogin); +authenticationRouter.get("/testloginconfirm", authenticationService_1.default.confirmTestLogin); +exports.default = authenticationRouter; diff --git a/restapi/build/routes/locationsRouter.js b/restapi/build/routes/locationsRouter.js new file mode 100644 index 0000000..e2f4d45 --- /dev/null +++ b/restapi/build/routes/locationsRouter.js @@ -0,0 +1,12 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const express_1 = __importDefault(require("express")); +const locationsService_1 = __importDefault(require("../podsAccess/locationsService")); +const locationsRouter = express_1.default.Router(); +locationsRouter.get("/", locationsService_1.default.getOwnLocations); +locationsRouter.post("/", locationsService_1.default.saveLocation); +locationsRouter.get("/addlocationtest", locationsService_1.default.saveTestLocation); +exports.default = locationsRouter; diff --git a/restapi/build/server.js b/restapi/build/server.js new file mode 100644 index 0000000..649240e --- /dev/null +++ b/restapi/build/server.js @@ -0,0 +1,31 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const express_1 = __importDefault(require("express")); +const locationsRouter_1 = __importDefault(require("./routes/locationsRouter")); +const authenticationRouter_1 = __importDefault(require("./routes/authenticationRouter")); +const cors_1 = __importDefault(require("cors")); +const express_session_1 = __importDefault(require("express-session")); +//dotenv.config() +const PORT = 8082; +const app = (0, express_1.default)() + .use((0, express_session_1.default)({ + secret: "ASDFG", + saveUninitialized: true, + resave: true +})) + .use((0, cors_1.default)({ origin: "http://localhost:3000", credentials: true })) + .use(express_1.default.json()) + .use('/auth', authenticationRouter_1.default) + .use('/location', locationsRouter_1.default); +app.listen(PORT, () => { + console.log('Server running on port ' + PORT); +}); +//connectToDatabase(process.env.CONNECTION_STRING as string).then( db =>{ +//Repositories +// let repoLocations = new Repository("locations", db); +//Rutas +// initLocationsRouter(app, repoLocations) +//} ); diff --git a/restapi/build/validators/locationValidator.js b/restapi/build/validators/locationValidator.js new file mode 100644 index 0000000..396c9bd --- /dev/null +++ b/restapi/build/validators/locationValidator.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateLocation = exports.validateLocationThing = void 0; +const solid_client_1 = require("@inrupt/solid-client"); +//import {LocationType} from "../locationType"; +const vocab_common_rdf_1 = require("@inrupt/vocab-common-rdf"); +function validateLocationThing(locationThing) { + return (0, solid_client_1.getStringNoLocale)(locationThing, vocab_common_rdf_1.SCHEMA_INRUPT.name) !== undefined + && (0, solid_client_1.getStringNoLocale)(locationThing, vocab_common_rdf_1.SCHEMA_INRUPT.name) !== null + // && getStringNoLocale(locationThing, SCHEMA_INRUPT.description) !== undefined + // && isLocationEnumType(getStringNoLocale(locationThing, SCHEMA_INRUPT.description)!) + && (0, solid_client_1.getDecimal)(locationThing, vocab_common_rdf_1.SCHEMA_INRUPT.latitude) !== undefined + && (0, solid_client_1.getDecimal)(locationThing, vocab_common_rdf_1.SCHEMA_INRUPT.latitude) !== null + && (0, solid_client_1.getDecimal)(locationThing, vocab_common_rdf_1.SCHEMA_INRUPT.longitude) !== undefined + && (0, solid_client_1.getDecimal)(locationThing, vocab_common_rdf_1.SCHEMA_INRUPT.longitude) !== null; +} +exports.validateLocationThing = validateLocationThing; +//function isLocationEnumType(locationType:string):boolean { +// const values = Object.values(LocationType); +// return (values.includes(locationType as unknown as LocationType)); +//} +function validateLocation(location) { + return location !== undefined; +} +exports.validateLocation = validateLocation; From 29f6bf0aa2ed3d9030fe1aaa00f529eb32c0ed74 Mon Sep 17 00:00:00 2001 From: uo276188 Date: Sun, 9 Apr 2023 23:20:45 +0200 Subject: [PATCH 2/4] Documentation part 6 updated --- docs/06_runtime_view.adoc | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/docs/06_runtime_view.adoc b/docs/06_runtime_view.adoc index fa28ceb..2fbc1b1 100644 --- a/docs/06_runtime_view.adoc +++ b/docs/06_runtime_view.adoc @@ -30,41 +30,37 @@ There are many notations for describing scenarios, e.g. **** -=== User registration -* The user enters the system for the first time and registers their personal data to create an account and start ussing the webapp. -** The user will be able to fill a form with their data that is saved on their private POD. - === User Login -* The user already registered on the system and wants to log in with their user and password to acess the webapp. -** The user will be able to fill a form with their user and password that will be sent to the server to be authenticated and allow or deny access. +* The user wants to log in with their POD to acess the webapp. +** The user will be able to fill a form that will redirect him to its POD's provider in order to give the application access to its POD's information or deny it. === Adding a Location * The user wants to add the location restaurant to the webapp and see it on the map. -** The user will be able to select a location category and the coordinates for the location to be placed and seen on their map and it will be saved on their POD. +** The user will click on a place on the map and a form will be displayed where the user will be able to select a location category and the name for the location to be placed and seen on their map and it will be saved on their POD. -=== Reviewing information about a place +=== Reviewing information about a place (Not implemented yet) * The user wants to select a friend's added location and see the pictures they added to it. ** Locations made public or shared with the user will be able to be accesed by the user to review aditional information that the creator added to the place. -=== Changing privacy settings +=== Changing privacy settings (Not implemented yet) * The user doesn't want their friends seeing the locations she added to the map so they acess the settings of the webapp to disable sharing them. ** The different settings about what information on the places and the user is accesible by their friends will be able to be changed, giving different options for each parameter. === Adding a new friend * A user navigating the app wants to search and add a concrete friend to their friend list. -** The user will be able to write the user of a friend that, if in the database, will be added to their personal friend list and the connection stored on the database. +** The user will be able to write the WebId of a friend's POD and also a NickName just to be similar to an agenda. -=== Deleting a friend +=== Deleting a friend (Not implemented yet) * A user wants to remove a friend from their friend list. -** The user will be given the option to remove a frient from their list, if they do the system wont consider them a friend and all places shared with them will no longer be shared. +** The user will be given the option to remove a friend from their list, if they do the system wont consider them a friend and all places shared with them will no longer be shared. -=== Creating a friend group +=== Creating a friend group (Not implemented yet) * The user wants to create a group of friends and manage privacy on the group. ** The group of friends will be treated as a single friend, after creation it will be stored on the database and the information that is shared or not will affect the whole group. From 94418574f0183811be0d1e9d45743aefeedc95fa Mon Sep 17 00:00:00 2001 From: uo276188 Date: Sun, 9 Apr 2023 23:24:34 +0200 Subject: [PATCH 3/4] Part 4 - Added Chakra UI --- docs/04_solution_strategy.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/04_solution_strategy.adoc b/docs/04_solution_strategy.adoc index 0dfcf56..4ffce38 100644 --- a/docs/04_solution_strategy.adoc +++ b/docs/04_solution_strategy.adoc @@ -26,12 +26,13 @@ Refer to details in the following sections. === Technology decisions This are the technologies that we have decided to use, some of them may vary in future iterations of the poyect: -* SOLID Pods for security +* SOLID PODs for security * TypeScript as programming language * MongoDb as our DMBS * Redux using React as UI * Axios * Postman +* Chakra UI (for the implementation of the views) === Design decisions: From 0b0389e8d2cef3b69fb2444edf275a267eed1447 Mon Sep 17 00:00:00 2001 From: uo276188 Date: Sun, 9 Apr 2023 23:30:08 +0200 Subject: [PATCH 4/4] Errata --- docs/02_architecture_constraints.adoc | 2 +- docs/04_solution_strategy.adoc | 2 +- docs/10_quality_scenarios.adoc | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/02_architecture_constraints.adoc b/docs/02_architecture_constraints.adoc index 4d7e083..2347b38 100644 --- a/docs/02_architecture_constraints.adoc +++ b/docs/02_architecture_constraints.adoc @@ -1,7 +1,7 @@ [[section-architecture-constraints]] == Architecture Constraints === Technical constraints -Use of SOLID pods:: The user’s information must be secured and stored in personal SOLID pods. +Use of SOLID PODs:: The user’s information must be secured and stored in personal SOLID pods. Use of Git:: The version control of the project must be done using Git. === Organizational constraints diff --git a/docs/04_solution_strategy.adoc b/docs/04_solution_strategy.adoc index 4ffce38..b12d131 100644 --- a/docs/04_solution_strategy.adoc +++ b/docs/04_solution_strategy.adoc @@ -38,7 +38,7 @@ This are the technologies that we have decided to use, some of them may vary in === Design decisions: The general design of our project has two main parts, connected using a facade: - * Webapp (frontend): with views and connections to the SOLID pods and to the RestAPI facade + * Webapp (frontend): with views and connections to the SOLID PODs and to the RestAPI facade * RestAPI (backend): controls the acess to the database and works as a microservice diff --git a/docs/10_quality_scenarios.adoc b/docs/10_quality_scenarios.adoc index daf469e..a4e65e4 100644 --- a/docs/10_quality_scenarios.adoc +++ b/docs/10_quality_scenarios.adoc @@ -21,7 +21,7 @@ image:10-QualityRequirements/Quality-tree.png["Quality tree diagram"] | Privacy | We need to protect the user's data. The application will only take essential data from users and it will be done in a decentralized way. -| User's data will be retrieved from the user's pod. +| User's data will be retrieved from the user's POD. | High @@ -39,6 +39,6 @@ image:10-QualityRequirements/Quality-tree.png["Quality tree diagram"] | Decentralization | Decentralization of the log in process (serverless). -| It is achieved by means of calling the Pod provider and delegating the process to it. +| It is achieved by means of calling the POD provider and delegating the process to it. | High |=== \ No newline at end of file