Accumulator is a personal productivity and data tracking application built with Elixir/Phoenix. It serves as a unified platform for various personal utilities and data collection services.
- Track website/blog visitor statistics in real-time
- Show current page viewers using Phoenix Presence
- Sort and organize blog analytics data
- Monitor page view counts across my website
- Create and organize notes in workspaces
- Public/private sharing capabilities
- Markdown support
- Search functionality
- Date-based organization
- Create private text snippets/pastes
- Set expiration times
- File attachment support
- Automatic cleanup of expired pastes
- Display currently playing track
- Show top tracks and artists
- Auto-refreshes data on scheduled intervals
- Track houseplants watering schedules
- Get notifications for plants that need watering
- Store plant details and care instructions
- Secure user authentication system
- Protected routes for private data
- Built on Elixir and Phoenix LiveView
- PostgreSQL for data persistence
- Phoenix PubSub for real-time updates
- Phoenix Presence for tracking active users
- Scheduled jobs using periodic workers
- Distributed Elixir clustering with libcluster
Requires: Elixir, PostgreSQL.
This application uses PostgreSQL. You can either install it manually or through Docker. If the port is different, you need to make changes to the config/dev.exs file.
To start your Phoenix server:
- Clone the repo
- Create a
.envfile with necessary environment variables (see.env.exampleif available) - Run
mix setupto install and setup dependencies - Start Phoenix endpoint with
mix phx.serveror inside IEx withiex -S mix phx.server
Now you can visit localhost:4000 from your browser.
This application is configured for deployment on Fly.io using the included fly.toml and Dockerfile.
The application uses Phoenix PubSub and Presence for real-time features:
- Data Collection: Various endpoints collect data (website visits, Spotify plays, etc.)
- Storage: Data is stored in PostgreSQL
- Real-time Updates: When data changes, PubSub messages notify relevant components
- LiveView: Phoenix LiveView ensures UI is always in sync with the latest data
- Scheduled Updates: Background jobs regularly refresh external data (Spotify, etc.)
All the data is stored on Postgres. The first render shows dummy data. As soon as a LiveView connection is established, we fetch data from Postgres and current user count (using Presence) and update the client. LiveView also subscribes (through Phoenix PubSub) to a particular topic (with "update:" prefix) to get some updates.
Whenever data is updated (a new user visits my website/blog), we send a PubSub message to that "update:" topic. The LiveView gets a message on this topic, fetches latest data from Postgres and Presence count, and updates the LiveView.
High overview on how everything fits together:
