This project is a web-based application designed to run on a Raspberry Pi. It fetches and displays social media analytics (e.g., Facebook, Instagram) in real-time. The application includes an admin console for configuring API credentials and a responsive frontend for displaying data.
- Real-time Data Fetching: Fetches data from Facebook and other social media platforms using their APIs.
- Admin Console: Allows users to input API credentials, select fields to display, and manage data.
- Responsive Design: Works seamlessly on both desktop and mobile devices.
- Manual Refresh: Users can manually refresh the data using a refresh button.
- Drag-and-Drop Support: (Future feature) Allows reordering of social media data boxes.
/social-counter
│
├── /assets
│ └── /icons
│ └── facebook.png # Facebook logo
│
├── /css
│ └── styles.css # CSS styles for the application
│
├── /data # Directory for storing fetched data
│
├── /js
│ ├── admin.js # JavaScript for the admin console
│ └── main.js # JavaScript for the main dashboard
│
├── /api
│ ├── facebook.js # Facebook API integration
│ └── instagram.js # Instagram API integration (future)
│
├── index.html # Main dashboard page
├── admin.html # Admin console page
├── server.js # Node.js server script
├── package.json # Node.js dependencies
└── README.md # This file
- Raspberry Pi: Running Raspberry Pi OS (preferably Lite version).
- Node.js: Install Node.js and npm on your Raspberry Pi.
- Facebook API Access: A Facebook Developer account and a valid Page Access Token.
- Open the terminal on your Raspberry Pi.
sudo apt update sudo apt full-upgrade -y sudo raspi-config # extend file system sudo reboot
- Clone the repository:
git clone https://github.com/furipaf/social-counter.git cd social-counter md data
- Install the required Node.js packages:
npm install express body-parser fs path node-fetch
-
Facebook API:
- Obtain a Page Access Token from the Facebook Graph API Explorer.
- Enter the Page Access Token and Page ID in the Facebook settings form.
-
Other Social Media Platforms:
- Follow similar steps for Instagram, Twitter, etc., by adding their respective API credentials in the admin console.
- Run the Node.js server:
node server.js
- The application will be accessible at:
- Dashboard:
http://<raspberry-pi-ip>:3000
- Admin Console:
http://<raspberry-pi-ip>:3000/admin
- Dashboard:
- Displays real-time social media analytics in a responsive layout.
- Use the refresh icon (🔄) in the top-right corner to manually refresh the data.
- Configure API credentials for social media platforms.
- Select which fields to display (e.g., fan count, followers count).
- Delete old data files using the "Delete Old Data" button.
- Home Icon (🏠): Redirects to the dashboard.
- Info Icon (ⓘ): Opens the Facebook Graph API documentation in a new tab.
- Gear Icon (⚙️): Opens the Admin Console to configure API credentials for social media platforms.
- Support for More Platforms: Add integrations for Instagram, Twitter, LinkedIn, etc.
- Drag-and-Drop Interface: Allow users to reorder social media data boxes.
- Auto-Refresh: Add an option to enable/disable auto-refresh.
- User Authentication: Secure the admin console with a login system.
Contributions are welcome! If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a detailed description of your changes.
- NOTE: Currently only Facebook is added for display, if you want other social media platforms, please mention Social Media Platform Name and the required fields, I will add them on request basis only.
- Font Awesome: For providing the icons used in this project.
- Facebook Graph API: For enabling access to Facebook data.
- DeekSeek: For providing AI-powered assistance in developing this project.
Enjoy using the Social Media Dashboard! If you have any questions or issues, feel free to open an issue on GitHub.