How 09ahmad/analytics- works
This is a web analytics product: site owners create projects, install a tracking script on their domains, and review collected traffic analytics in a dashboard. The sampled tracking endpoint validates the project and records aggregate visits and visitor dimensions. The tree also shows project management, authentication, bug reporting, and operational logs. Dashboard data wiring is not established by the sampled source, so those UI components are represented without speculative connections.
Main entry points: auth.ts Authentication · db.ts Application database · project/route.ts Project API · [id]/route.ts Project update API
Components 20
Event collection
- Tracking script
public/tracking-script.js - Track endpoint
src/app/api/track/route.ts
Analytics dashboard
- Analytics views
src/app/(root)/projects/_components/analytics.tsx - Analytics graph
src/app/(root)/projects/_components/analytics-graph.tsx - Project detail
src/app/(root)/projects/_components/project-data.tsx
Project management
- Project list
src/app/(root)/projects/page.tsx - Project creation
src/app/(root)/projects/_components/create-project.tsx - Project API
src/app/api/project/route.ts - Project update API
src/app/api/project/[id]/route.ts - Project use cases
src/use-cases/projects.ts - Project data access
src/data-access/projects.ts
Identity and operations
- Sign-in page
src/app/(auth)/signin/page.tsx - Authentication
src/auth.ts - Bug reports API
src/app/api/bug-report/route.ts - Settings views
src/app/(root)/settings/page.tsx - Logs API
src/app/api/logs/route.ts
Other components
- Site visitor
- Site owner
- Google identity
- Application database
src/lib/db.ts
Connections 15
- Site visitor → Tracking script: loads
- Tracking script → Track endpoint: sends events
- Track endpoint → Application database: writes aggregates
- Site owner → Project list: manages projects
- Project API → Authentication: checks session
- Project API → Application database: creates project
- Project update API → Authentication: checks session
- Project update API → Application database: updates project
- Sign-in page → Authentication: signs in
- Authentication → Google identity: authenticates with
- Authentication → Application database: uses adapter
- Bug reports API → Authentication: checks session
- Bug reports API → Application database: reads and writes
- Logs API → Authentication: checks session
- Logs API → Application database: reads and writes