As part of the MongoDB Atlas + Dev hackathon, I am glad to present FollowStats. FollowStats enables you to be more intentional about building an audience and helps you to track your followers, subscribers from various platforms periodically. It keeps a daily track of your followers and subscribers count. You can view your growth/ decline of your followers and subscribers in an organized dashboard. It also sends you a weekly overview of your audience to your email every Monday morning at 09:00.
- The
realm-backend
folder contains the code for MongoDB Realm Functions. - A Sendgrid API Key is needed to be used in file https://github.com/geekysrm/follow-stats/blob/main/realm-backend/functions/sendFollowersReport.js#L66.
- The sendgrid email HTML code is here: https://github.com/geekysrm/follow-stats/blob/main/sendgrid-email-template.html
- Install all dependencies for the frontend:
npm i
- The root app is a Next.js app which can be run by using:
npm run dev
. - Auth0 also needs to be configured with GitHub as social login.
- Please create a
env.local
file at the root of the project with the following content:
AUTH0_SECRET=<Auth0 secret>
AUTH0_BASE_URL='http://localhost:3000'
AUTH0_ISSUER_BASE_URL=<Auth0 domain>
AUTH0_CLIENT_ID=<Auth0 client ID>
AUTH0_CLIENT_SECRET=<Auth0 client secret>
Settings Page
Weekly Email Report
I have prepared a demo video which can be viewed here: Video Link
- MongoDB Realm functions for backend
- MongoDB Realm Triggers to keep track of follower count on schedule and send email on Monday
- Auth0 for login
- Taiwind CSS for styling
- Next.js as frontend framework
I had previously used MongoDB but was unaware of the cool functionalities like Realm functions, triggers etc. I was really fascinated by how easy it is to build your backend using MongoDB Realm functions. We can easily import npm packages and use those too. I also used triggers for the first time to fetch followers' count everyday and send email report every Monday.
The major challenge was to figure out the way to fetch followers/ subscribers data from various platforms. I had to try many methods (like using official API, scraping etc.) before I arrived at a method that works.
- Add more platforms like Instagram, LinkedIn and newsletter platforms like Mailchimp, Convertkit, Buttondown etc.
- Add charts and graphs to visualize followers' growth.
Please try this out and give your valuable feedback in the comments below or on Twitter.