visit
The year 2020 marked the start of digital transformation in business, offering technological solutions for managing assets that might otherwise have become unprofitable.
Parking is the scourge of all world capitals. And with the rise of online delivery, the already congested streets are now also home to countless couriers. Transport for London (TfL) has developed a public transport accessibility level (PTAL) tool to calculate the accessibility of locations throughout Greater London. PTAL is used in planning neighborhood developments and helps to understand public transport accessibility and allows developers to reduce the number of private vehicles in accessible locations.
Flexible rental. The market, radically reshaped by Airbnb and Booking, has become a driver of the revival of entire neighborhoods in many cities around the world, changing their face. In the past 15 years, in addition to rentals for a few days, demands for student housing and co-living have emerged. Companies like Lavanda provide a platform (PMS) for landlords or property management, booking companies to list, manage, and book accommodations in a variety of options: for tourists, students, multiple families simultaneously.
Le Corbusier, who called the house a "machine for living," proposed constructing "Unité d'Habitation"; Lavanda, however, can turn any suitable property into such a "machine.”
Working in the Zoom style has brought time management to the forefront and made Google Calendar one of the main work tools. Services like zonifero or iOFFICE allow modeling workspace experience, and moreover, developing their products as SAAS solutions, they scale and customize perfectly for specific conditions.
Integration services - for example, Zapier or Postman - have ready-made solutions for hundreds of popular platforms; a user needs to have accounts and generate API keys for a specific integration.
//API key for the integrated application (in our case - a Notion database) and the ID of the used properties
NOTION_DATABASE_ID = 2pp844ca6cf97f91aca1a808fb7fc876
APP_API_KEY = secret_LGe25Yt9OaCQbZqLs4c50ZNUISBUacjJ8u7mn4
NOTION_CUSTOM = GWYK
NOTION_TASK = title
NOTION_TAGS = oyLf
//integration metadata for the npm dispatcher, helping it identify the connection and work with its dependencies
{
"dependencies": {
"@notionhq/client": "^2.2.9",
"dotenv": "^16.3.1",
"ejs": "^3.1.9",
"express": "^4.18.2"
},
"scripts": {
"start": "node server.js",
"devStart": "nodemon server.js"
},
"name": "js",
"version": "1.0.0",
"main": "server.js",
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"devDependencies": {
"nodemon": "^3.0.1"
}
}
//example of a request to an integrated application to retrieve the content of its cards
const { Client } =require('@notionhq/client')
const notion = new Client({auth: process.env.APP_API_KEY})
async function getTags(){
const database = await notion.databases.retrieve({database_id: process.env.NOTION_DATABASE_ID})
return notionPropertiesById(database.properties)[process.env.NOTION_TAGS].multi_select.options.map(options=>{
return{id: options.id,name:options.name}
})
}
function notionPropertiesById(properties){
return Object.values(properties).reduce((obj,property)=>
{
const {id, ...rest}=property
return{...obj,[id]: rest}
},{})
}
function createSuggestion({title, custom, tags}){
notion.pages.create({
parent: {
database_id: process.env.NOTION_DATABASE_ID
},
properties:{
[process.env.NOTION_TASK]:{
title: [
{
type: 'text',
text:{
content: title
}
}
]
},
[process.env.NOTION_CUSTOM]:{
checkbox: custom
},
[process.env.NOTION_TAGS]:{
multi_select: tags.map(tag=>{
return{id:tag.id}
})
}
}
})
}
module.exports = {
createSuggestion,
getTags,
}
//example of a server processing requests
require("dotenv").config()
const express = require("express")
const {getTags, createSuggestion} = require('./notion')
let tags = []
getTags().then(data=>{
tags = data
})
setInterval(async () => {
tags = await getTags()
}, 1000*60*60);
const app=express()
app.set('views','./views')
app.set('view engine', 'ejs')
app.use(express.urlencoded({extended: true}))
app.get('/',(req,res)=>{
res.render('index', { tags })
})
app.post('/create-suggestion', async (req,res)=>{
const {title, custom, tagIds=[]} = req.body
await createSuggestion({
title,
custom: custom != null,
tags: (Array.isArray(tagIds) ? tagIds : [tagIds]).map(tagId =>{
return{id: tagId}
})
})
res.redirect("/")
})
app.listen(process.env.PORT)