The ultimate act of procrastination: building a custom personal todos/goals dashboard! ๐คจ
r repeat me daily
or r show me every other day 2
.t dig a hole OR fill the hole
.Heavily modified from this tutorial: https://fireship.io/lessons/svelte-v3-overview-firebase
There are room for improvements everywhere and I won't be supporting or updating this repo, so please fork and modify to suit your own needs ๐
src/App.svelte
{#if user && user.email === '[YOUR_EMAIL_HERE]'}
src/firebase.js
var firebaseConfig = {
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: ""
};
In the Firebase console go to Authentication
in the sidebar, select Set up sign-in method
tab and enable Google
.
Go to Database
in the sidebar, create a new Firestore database, then start a new todos
collection. Click Auto-ID
, save, then delete that document. Eventually the fields will look like this:
Upgrade your Firebase project plan to Blaze
. This is required for scheduled functions: USD$0.10 per month.
Add your email in functions/firestore.rules
:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth.token.email == '[YOUR_EMAIL_HERE]'
}
}
}
functions/index.js
if (user.email === "[YOUR_EMAIL_HERE]") return null;
.timeZone("Australia/Sydney") //change to your timezone
cd svelte-sortable-firebase-todo/functions
npm install
npm install -g firebase-tools
firebase login
firebase use --add
firebase deploy
In the Firebase console you should see the two functions listed under Functions
in the sidebar. Also you should see the Rules
and Indexes
tabs within Database
have been updated.
You'll need to wait a few minutes for the index to be built.
cd svelte-sortable-firebase-todo
npm install
npm run dev
Navigate to localhost:5000
See if you can login (click the ๐ฎ) and add/drag/delete todos. Hold down to start drag.
"Oh gawd, oh no, plz no, why, why, just why" ๐ฑ
If it doesn't work, check the console. Could be a domain whitelist issue in Firebase.
** Note: be sure to add the domain to the whitelist in Firebase console and/or Google Cloud console.
Install now
if you haven't already:
npm install -g now
Then, from within your project folder:
npm run build
now deploy --name my-project
Install surge
if you haven't already:
npm install -g surge
Then, from within your project folder:
npm run build
surge public my-project.surge.sh