Sara Harkousse
@Sara_harkousse
Maydée
@Maydeeapp
@Sara_harkousse
Tech Lead, front-end Web developer at Dassault Systèmes
Full-stack developer & co-founder of Maydée
"Duchess France" Leader & 3DS advocate at "Elles Bougent"
What's this exactly?
First French Hackathon organised by the Ministry for Families, Children and Women's Right award.
Objective : Find efficient solutions to achieve progress on gender equality.
March 2017
Maydée arose from a personal experience. The difficulties I had to balance my career and family life after the birth of my child and from the observation that women still do a majority of housework and childcare.
Julie co-founder
Julie co-founder
This tool will allow couples to measure how (un)equal their division of housework is and help them to better share the load.
The Minister's award
Julie Hebting - Co-founder Head of development
Sara Harkousse -Co-founder CTO Maydée App
Linda Cusatis
Web project manager
Sébastien Le Bote
CTO back office system
Stéphanie Herr
Community Manager
https://www.maydee.fr
@Maydeeapp @Sara_harkousse
HTML
CSS
JavaScript
Polymer
Node
MongoDB
Express
Client
Server
Maydée is a Progressive Web App ( ) developed "from scratch".
Why build a ?
@Maydeeapp @Sara_harkousse
Source: we are social
@Maydeeapp @Sara_harkousse
Source: comScore Mobile Metrix, Juin 2015
Mobile Web
Native Apps
@Maydeeapp @Sara_harkousse
Source: comScore Mobile Metrix, Juin 2015
@Maydeeapp @Sara_harkousse
Capability
Reach
Just websites that took all the right vitamins
Alex Russell
Frances Berriman
Alex Russell
@Maydeeapp @Sara_harkousse
@Maydeeapp @Sara_harkousse
whatwebcando.today
@Maydeeapp @Sara_harkousse
What is a ?
@Maydeeapp @Sara_harkousse
Responsive
Connectivity-independent
App-like
Fresh
Safe
Discoverable
Re-engageable
Installable
@Maydeeapp @Sara_harkousse
Responsive: Adapt to the browser size (desktop, mobile, tablet)
Split layout into a app shell and dynamic content (Single page app)
@Maydeeapp @Sara_harkousse
Load instantly, regardless of the network state.
Service Worker
Client-side proxy that let you control how network requests from your page are handled.
Uses Fetch and Cache API.
@Maydeeapp @Sara_harkousse
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js').then(function(registration) {
console.log('SW registration successful : ', registration.scope);
}, function(err) {
console.log('SW registration failed: ', err);
});
});
}
Register the service worker in the main JavaScript code.
If the service worker is new, the service worker is installed.
var CACHE_NAME = 'md-app-cache-v1';
var urlsToCache = ['/', '/styles/styles.css', '/script/app.js'];
self.addEventListener('install', function(event) {
event.waitUntil(
caches.open(CACHE_NAME)
.then(function(cache) {
console.log('Opened cache');
return cache.addAll(urlsToCache);
})
);
});
In the service worker, listen for the install event triggered.
Cache every essential resource required by the application.
@Maydeeapp @Sara_harkousse
Fetch API used for server requests.
self.addEventListener('fetch', function(event) {
event.respondWith(
caches.match(event.request)
.then(function(response) {
// Cache hit - return response
if (response) {
return response;
}
return fetch(event.request);
}
)
);
});
App Shell & data always up to date.
self.addEventListener('activate', function(event) {
var cacheWhitelist = ['md-app-cache-v1', 'data-cache-v1'];
event.waitUntil(
caches.keys().then(function(cacheNames) {
return Promise.all(
cacheNames.map(function(cacheName) {
if (cacheWhitelist.indexOf(cacheName) === -1) {
return caches.delete(cacheName);
}
})
);
})
);
});
Delete all obsolete caches on service worker activation.
@Maydeeapp @Sara_harkousse
Service workers only run over localhost or HTTPS.
@Maydeeapp @Sara_harkousse
The application is indexed by search engines.
@Maydeeapp @Sara_harkousse
The application is installed like a native one.
Web App Manifest
Name
Icon
Splash screen
Start url
{
"name": "Maydée",
"short_name": "Maydée",
"theme_color":"#ffffff",
"background_color":"#ffffff",
"start_url": "index.html?launcher=true",
"icons": [
{
"src": "launcher-icon-1x.png",
"type": "image/png",
"sizes": "48x48"
},
...
]
}
<link rel="manifest" href="/manifest.json">
@Maydeeapp @Sara_harkousse
Push notifications
Client:
1- Ask the user for permission
2- Get a PushSubscription from the browser
3- Send the PushSubscription to the server to be stored
Asking permission on Desktop
Asking permission on Mobile
Notification API
Push API
@Maydeeapp @Sara_harkousse
Server:
Send the push message to the subscription endpoint
Service Worker:
Listen to push events
Show notification
@Maydeeapp @Sara_harkousse
self.addEventListener('push', function(event) {
const promiseChain = self.registration.showNotification('Hello, World.');
event.waitUntil(promiseChain);
});
How to build a efficiently ?
@Maydeeapp @Sara_harkousse
An opinionated library that sugars Web Components APIs, to make it easy to build encapsulated, reusable custom elements.
@Maydeeapp @Sara_harkousse
https://www.polymer-project.org/
https://www.webcomponents.org
@Maydeeapp @Sara_harkousse
npm install -g polymer-cli
cd my-polymer-app
polymer init
> polymer-2-starter-kit
polymer build
polymer serve --open
@Maydeeapp @Sara_harkousse
@Maydeeapp @Sara_harkousse
@Maydeeapp @Sara_harkousse
How to evaluate a ?
@Maydeeapp @Sara_harkousse
@Maydeeapp @Sara_harkousse
Send us an email :
contact@maydee.org
@Sara_harkousse