DataTime Machine is a full-stack, hackathon-ready analytics platform that treats real-time time series data as version-controlled "commits." It ingests live data from external APIs, captures regular snapshots, detects large shifts, generates event records, and visualizes everything in a premium dark-mode interface.
This repository contains two core applications:
BACKEND/— Node.js + Express + MongoDB REST API, scheduled data polling, analytics, event generation, and auth.FRONTEND/— React + Vite + Tailwind CSS dashboard, charting, geospatial visualization, login/signup flows, and AI-enabled event interaction.
- Rishab — Frontend lead
- Vineet — Backend lead
- Frontend (deployed):
https://pixel-pwnz.vercel.app/ - Frontend (local dev):
http://localhost:5173 - Backend (local dev):
http://localhost:5000
- Backend:
Node.js,Express,MongoDB,Mongoose,Axios,node-cron,dotenv - Frontend:
React,Vite,Tailwind CSS v4,Recharts,Framer Motion,React Leaflet - Package manager:
pnpm
DataTimeMachine/
├── BACKEND/
│ ├── config/ # MongoDB connection and environment loaders
│ ├── controllers/ # HTTP request handlers
│ ├── middlewares/ # auth and error handling middleware
│ ├── models/ # Mongoose data models
│ ├── routes/ # Express route definitions
│ ├── services/ # business logic and third-party integrations
│ ├── utils/ # logger and error utilities
│ ├── index.js # server entrypoint and scheduler setup
│ ├── seed.js # seeded dataset and snapshot generator
│ └── package.json
└── FRONTEND/
├── public/ # static assets
├── src/
│ ├── components/ # reusable UI primitives and cards
│ ├── contexts/ # React context providers for auth and app state
│ ├── lib/ # API client and shared libraries
│ ├── pages/ # route-based page components
│ ├── services/ # client-side service helpers
│ └── utils/ # formatters and helpers
├── package.json
├── vite.config.js
└── tailwind.config.mjs
The backend is responsible for:
- connecting to MongoDB
- defining normalized dataset models
- polling live APIs on a schedule
- storing dataset snapshots
- comparing values and generating events
- supporting authenticated actions like flagging and notes
- exposing a stable REST API for the frontend
Core backend files:
BACKEND/index.js— configures Express, CORS, routes, and scheduler startupBACKEND/config/db.js— opens a MongoDB connection usingMONGO_URIBACKEND/models/— schema definitions for datasets, snapshots, events, and usersBACKEND/routes/— route maps for auth, datasets, snapshots, events, meta, and manual operationsBACKEND/controllers/— controller logic that translates requests into service callsBACKEND/services/— data ingestion, change detection, forecasting, and AI-prompt orchestrationBACKEND/middlewares/authMiddleware.js— protects sensitive endpointsBACKEND/utils/— centralized error and logging helpers
The frontend provides an immersive dashboard experience with:
- a sidebar-driven navigation layout
- dashboard metrics and sparkline charts
- dataset detail pages with snapshot history
- event log and flagged event workflows
- a map page for geospatial insights
- login/signup authentication
- AI-style event explanation and annotations
Key frontend files:
FRONTEND/src/main.jsx— React entry pointFRONTEND/src/App.jsx— route definitions and top-level layoutFRONTEND/src/lib/api.js— API client for all backend requestsFRONTEND/src/context/*— auth provider and app stateFRONTEND/src/pages/*— high-level page viewsFRONTEND/src/components/*— design system components, charts, and cards
A dataset stores metadata for each tracked series.
Fields:
name— human-friendly dataset namecategory— category, e.g.crypto,weather,aqisource_api— origin of the datalocation— region or city labelunit— unit of measurementcreatedAt/updatedAt
A snapshot is a single time-stamped data point.
Fields:
dataset_id— reference to a datasetvalue— numeric measurementtimestamp— when the snapshot was takenmetadata— optional extra payload or source detailscreatedAt
An event records a significant change.
Fields:
dataset_id— reference to a datasettype— event type (e.g.spike,drop,forecast)percentage_change— change magnitudeprevious_value— prior snapshot valuecurrent_value— current snapshot valuemessage— human-readable event descriptionseverity— impact level, such aslow,medium,highflagged— boolean marker for reviewnote— developer/analyst notecreatedAt
Used for authentication and protected actions.
Fields:
nameemailpassword— hashedcreatedAt
The app detects events by comparing consecutive snapshots:
- Fetch the latest metric value.
- Store a new
Snapshot. - Compare the new value with the previous snapshot.
- Calculate percent change:
(current - previous) / previous * 100. - If the change exceeds a configured threshold, create an
Event.
Typical thresholds used in the project:
> 15%→ create an event> 25%→ mark severity as high
The backend uses a cron-based scheduler to poll external data sources at regular intervals. This enables the platform to act like a real-time analytics engine and continuously generate new snapshots and events.
POST /api/auth/signupPOST /api/auth/loginGET /api/auth/me
GET /api/datasetsGET /api/datasets/:id/snapshotsGET /api/datasets/:id/eventsGET /api/datasets/:id/export
GET /api/eventsGET /api/events/flaggedPOST /api/events/:id/flagPOST /api/events/:id/note
GET /api/meta/time-boundsPOST /api/fetch-now/:id
- The backend supports CORS via
CLIENT_URL. - Protected endpoints require a JWT in
Authorization: Bearer <token>.
- Marketing-first hero section
- Demo dashboard preview
- GitHub CTA and login flow
- Designed to onboard users into the analytics experience
- Dataset summary cards with sparklines
- Real-time metric overview
- Activity feed of recent events
- Time-range selectors and chart controls
- Full snapshot history table
- Dataset-specific event stream
- Manual refresh and export actions
- Filterable event list
- Flagged event review
- Event notes and annotations
- Geospatial dataset visualization using React-Leaflet
- Region-based markers for data events
- Login and signup flows
- Authentication state managed in
src/contexts/AuthContext.jsx
DatasetCard.jsxTimelineChart.jsxBeforeAfterChart.jsxNavbar.jsxSidebar.jsxLoader.jsxButton.jsxInput.jsxSelect.jsx
MONGO_URI=mongodb+srv://<username>:<password>@cluster0.mongodb.net/Pixel
GROQ_API_KEY=<your-groq-api-key>
JWT_SECRET=<your-jwt-secret>
CLIENT_URL=https://pixel-pwnz.vercel.app/If using environment variables in the frontend, Vite expects VITE_ prefixes, for example:
VITE_API_URL=http://localhost:5000/apicd DataTimeMachine/BACKEND
pnpm install
pnpm devcd DataTimeMachine/FRONTEND
pnpm install
pnpm dev- Start MongoDB and ensure
MONGO_URIis reachable. - Run backend from
DataTimeMachine/BACKEND. - Run frontend from
DataTimeMachine/FRONTEND. - Open
http://localhost:5173.
- Build production assets with
pnpm build. - Deploy to Vercel or any static host.
- Ensure the built app points to the backend API URL.
- Deploy a Node.js backend to a cloud provider such as Heroku, Railway, Render, or DigitalOcean.
- Set environment variables in the target host.
- Ensure CORS allows the frontend deployed URL.
- Keep
JWT_SECRETsecure. - Keep
GROQ_API_KEYprivate. - Use a production-grade MongoDB cluster.
- Configure
CLIENT_URLto the deployed frontend domain.
- Check
FRONTEND/src/lib/api.jsfor syntax errors. - Ensure the frontend code is valid JSX and the module type is correct.
- Verify
BACKEND/.envcontainsJWT_SECRET. - Confirm the frontend sends
Authorizationheader correctly.
- Confirm
CLIENT_URLmatches the frontend origin. - Verify the backend allows requests from deployed and local frontend URLs.
- Add dataset configuration UI for custom tracked sources
- Support graph zoom and replay controls on timeline charts
- Add AI-based root-cause event explanations
- Add mobile-responsive dashboard refinements
- Add deployment scripts for one-click staging
- DataTime Machine is designed to make dataset shifts visible and actionable.
- The platform is built for rapid hackathon delivery while preserving architectural separation.
- Use this README as the canonical guide for running and extending the codebase.