Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Website: Open Stats #20

Closed
jsjoeio opened this issue Dec 13, 2019 · 21 comments
Closed

Website: Open Stats #20

jsjoeio opened this issue Dec 13, 2019 · 21 comments
Labels
enhancement New feature or request

Comments

@jsjoeio
Copy link
Owner

jsjoeio commented Dec 13, 2019

Summary

It would be cool to share some stats related to my newsletter, like number of subscribers, average open rate, average clicks, average number of emails sent per month.

Basic example

If the proposal involves a new or changed API, include a basic code example. Omit this section if it's not applicable.

Motivation

Practicing transparency. Aligns with the idea of open source. Good for the community, fun to share :)

@jsjoeio jsjoeio added the enhancement New feature or request label Dec 13, 2019
@jsjoeio
Copy link
Owner Author

jsjoeio commented May 25, 2020

Something like Lee's Dashboard page

image

He even wrote up a blog post on how to do it!

https://leerob.io/blog/fetching-data-with-swr

@jsjoeio jsjoeio changed the title Newsletter: Open Stats Website: Open Stats May 25, 2020
@jsjoeio
Copy link
Owner Author

jsjoeio commented May 25, 2020

This will help too: https://leerob.io/blog/real-time-post-views

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 25, 2020

And this

https://jamstackfns.com/f/firebase

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 30, 2020

I might call it /open like Nomad List

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 30, 2020

Todos

  • Add netlify functions to site
  • Get function work in production
  • Add firebase
  • Add environment variables to Netlify
  • Refactor into other file
  • Figure out accountServiceKey.json
  • Test function to get page views
  • Add page views to blog posts
  • Add /open page

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 30, 2020

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 30, 2020

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 31, 2020

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 31, 2020

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 31, 2020

Man, I'm struggling hard core with this Firebase part.

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 31, 2020

I think I've run into every error possible...

Error during invocation:  TypeError: i.initStandalone is not a function

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 31, 2020

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 31, 2020

man i give up :(

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 31, 2020

Firebase url

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 31, 2020

what day...6 hours of trying.

okay i got basic functions working with netlify. no luck with firebase yet

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 31, 2020

To get the function to work in production:

  • I added a command to the build in the netlify.toml
  • updated yarn build in the package.json
  • updated the functions directory functions-build in the Netlify UI

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 31, 2020

soooo close, I can't get it to work without the JSON file though...

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 31, 2020

I got it working!

Now to try and make it environment variables: https://community.netlify.com/t/using-firebase-admin-sdk-with-lambda-function/2136

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 31, 2020

Using local env with netlify-lambda

netlify/netlify-lambda#118

@jsjoeio
Copy link
Owner Author

jsjoeio commented May 31, 2020

FINALLY

@jsjoeio
Copy link
Owner Author

jsjoeio commented Jun 1, 2020

Closed via #141

@jsjoeio jsjoeio closed this as completed Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant