Project:SvelteKit Frontend: Difference between revisions

From Open Food Facts wiki
No edit summary
No edit summary
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:JavaScript]]
=== Introduction ===
=== Introduction ===
I (VaiTon) started the project to try to build a prototype of frontend, completely decoupled from the backend.  
I (VaiTon) started the project to try to build a prototype of frontend, completely decoupled from the backend.  
Line 9: Line 10:
* GitHub Repository: https://github.com/VaiTon/openfoodfacts-explorer
* GitHub Repository: https://github.com/VaiTon/openfoodfacts-explorer
* Deployment: https://openfoodfacts-explorer.vercel.app/
* Deployment: https://openfoodfacts-explorer.vercel.app/
=== Logging in ===
==== Security concerns ====
As we still don't have an OpenID compatible way of logging in, at the moment the web app stores the user credential in the <code>localStorage</code>, which is UNSAFE as it is exposed to XSS attacks. Another way would be serving the project from a subdomain, but we're not there yet.
==== How to ====
To ''log in'' (there is not really a log in, more like sending credentials with every request), go to https://openfoodfacts-explorer.vercel.app/settings and enter your credentials.
=== Editing products ===
'''You need to be logged in to edit products! See the [[SvelteKit Frontend#Logging in|''Logging in'' section]] for more information.'''
* Open the product page you'd like to edit
* Click on the "edit" button

Latest revision as of 11:19, 23 November 2023

Introduction

I (VaiTon) started the project to try to build a prototype of frontend, completely decoupled from the backend.

This way, we could (one day hopefully) iterate much more quicker on the frontend side of things and use the latest javascript technology available (TypeScript, Vite, ESM, etc...).

For the prototype I chose SvelteKit.

Development

Logging in

Security concerns

As we still don't have an OpenID compatible way of logging in, at the moment the web app stores the user credential in the localStorage, which is UNSAFE as it is exposed to XSS attacks. Another way would be serving the project from a subdomain, but we're not there yet.

How to

To log in (there is not really a log in, more like sending credentials with every request), go to https://openfoodfacts-explorer.vercel.app/settings and enter your credentials.

Editing products

You need to be logged in to edit products! See the Logging in section for more information.

  • Open the product page you'd like to edit
  • Click on the "edit" button