├── .env.example ├── .eslintrc.json ├── .gitignore ├── README.md ├── actions ├── fetchActiveUsers.ts ├── fetchAnalytics.ts ├── fetchViews.ts └── pageSpeedMetrics.ts ├── app ├── (auth) │ └── sign-in │ │ └── page.tsx ├── api │ ├── events │ │ └── route.ts │ └── track │ │ └── route.ts ├── dashboard │ └── page.tsx ├── favicon.ico ├── globals.css ├── layout.tsx ├── not-found.tsx ├── page.tsx ├── settings │ └── page.tsx └── site │ └── [website] │ └── page.tsx ├── components.json ├── components ├── 24hour-stats-box.tsx ├── add-website.tsx ├── analytics-card.tsx ├── analytics-chart.tsx ├── code-block.tsx ├── code.tsx ├── discord-message.tsx ├── footer.tsx ├── header.tsx ├── icons.tsx ├── loading.tsx ├── mock-discord-ui.tsx ├── no-page-views.tsx ├── site-custom-events.tsx ├── site-general-analytics.tsx ├── site-performance.tsx ├── site-settings.tsx ├── snippet.tsx ├── testimonial.tsx ├── ui │ ├── accordion.tsx │ ├── alert-dialog.tsx │ ├── animated-list.tsx │ ├── avatar.tsx │ ├── badge.tsx │ ├── blur-fade.tsx │ ├── button.tsx │ ├── card.tsx │ ├── carousel.tsx │ ├── chart.tsx │ ├── dialog.tsx │ ├── dropdown-menu.tsx │ ├── input.tsx │ ├── safari.tsx │ ├── scroll-area.tsx │ ├── select.tsx │ ├── sheet.tsx │ ├── tabs.tsx │ ├── text-hover-effect.tsx │ ├── textarea.tsx │ ├── toast.tsx │ ├── toaster.tsx │ └── user-nav.tsx └── website-card.tsx ├── config └── supabase.ts ├── hooks ├── use-toast.ts └── useUser.ts ├── lib ├── constants.tsx ├── cors.ts ├── discord-client.ts └── utils.ts ├── next.config.ts ├── package-lock.json ├── package.json ├── postcss.config.mjs ├── public ├── diagram.png ├── file.svg ├── github.svg ├── globe.svg ├── google.svg ├── hero.png ├── logo.png ├── next.svg ├── noise.png ├── og.png ├── product1.png ├── product2.png ├── product3.png ├── spinner.svg ├── tracking-script.js ├── vercel.svg └── window.svg ├── tailwind.config.ts ├── tsconfig.json └── types ├── index.ts └── tailwind.d.ts /.env.example: -------------------------------------------------------------------------------- 1 | NEXT_PUBLIC_SUPABASE_URL= 2 | 3 | NEXT_PUBLIC_SUPABASE_ANON_KEY= 4 | 5 | DISCORD_BOT_TOKEN= 6 | 7 | GOOGLE_PAGESPEED_API_KEY= -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["next/core-web-vitals", "next/typescript"] 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.* 7 | .yarn/* 8 | !.yarn/patches 9 | !.yarn/plugins 10 | !.yarn/releases 11 | !.yarn/versions 12 | 13 | # testing 14 | /coverage 15 | 16 | # next.js 17 | /.next/ 18 | /out/ 19 | 20 | # production 21 | /build 22 | 23 | # misc 24 | .DS_Store 25 | *.pem 26 | 27 | # debug 28 | npm-debug.log* 29 | yarn-debug.log* 30 | yarn-error.log* 31 | 32 | # env files (can opt-in for commiting if needed) 33 | .env 34 | 35 | # vercel 36 | .vercel 37 | 38 | # typescript 39 | *.tsbuildinfo 40 | next-env.d.ts 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # Analyzr 📊 4 | 5 | ![OG](./public/og.png) 6 | 7 | ![Next.js](https://img.shields.io/badge/next%20js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white) 8 | ![shadcn/ui](https://img.shields.io/badge/shadcn%2Fui-000000?style=for-the-badge&logo=shadcnui&logoColor=white) 9 | ![Discord](https://img.shields.io/badge/Discord-5865F2?style=for-the-badge&logo=discord&logoColor=white) 10 | ![Supabase](https://img.shields.io/badge/Supabase-181818?style=for-the-badge&logo=supabase&logoColor=white) 11 | ![Vercel](https://img.shields.io/badge/Vercel-000000?style=for-the-badge&logo=vercel&logoColor=white) 12 | 13 |
14 | 15 | --- 16 | 17 | ### TL;DR 🚀 18 | Analyzr is a free and open-source analytics tool that requires just one line of code to set up. 19 | 20 | It comes with built-in Discord notifications and works seamlessly with any website, giving you all the analytics data you need to make informed decisions. 21 | 22 | --- 23 | 24 | ### 📑 Table of Contents 25 | - [Why Did We Build This?](#-why-did-we-build-this) 26 | - [Who Is This For?](#-who-is-this-for) 27 | - [What Can It Do?](#-what-can-it-do) 28 | - [How Does It Work?](#how-does-it-work) 29 | - [Discord Integration](#-discord-integration) 30 | - [What Makes It Different?](#-what-makes-it-different) 31 | - [Want to Try It?](#-want-to-try-it) 32 | - [Quick Links](#-quick-links) 33 | - [Let's Chat!](#-lets-chat) 34 | - [FAQ](#-frequently-asked-questions) 35 | 36 | --- 37 | 38 | Hey there! 👋 39 | 40 | Thanks for checking out Analyzr. It's a free tool that manages your website analytics and performance and offers many other features. 41 | 42 | This project is an alternative to premium analytics services like Vercel Analytics. 43 | 44 | With Analyzr, you can monitor everything from visitor activity to site performance without paying for it. 45 | 46 | And the best part? It's **open-source** and **free for everyone**. 47 | 48 | --- 49 | 50 | ### 💡 Why Did We Build This? 51 | 52 | Analyzr doesn't charge you for tracking custom events or monitoring performance, unlike other analytics tools. 53 | 54 | You get all of this and more, totally free. 55 | 56 | --- 57 | 58 | ### 🎯 Who Is This For? 59 | 60 | ![Product 2](./public/product2.png) 61 | 62 | Developers who want to track their side projects. 63 | 64 | Small business owners watching their website traffic. 65 | 66 | Anyone who wants simple analytics without paying $$$. 67 | 68 | --- 69 | 70 | ### 🚀 What Can It Do? 71 | 72 | Here are some of the core features of Analyzr: 73 | 74 | - **Real-Time Tracking:** See what's happening on your website as it happens. 75 | 76 | - **Custom Event Tracking:** Track specific actions your visitors take (for example, clicks on certain buttons). 77 | 78 | Here's how to track custom events: 79 | 80 | Using JavaScript/Node.js: 81 | ```javascript 82 | const axios = require('axios'); 83 | 84 | const API_KEY = "YOUR_API_KEY"; 85 | const url = "https://getanalyzr.vercel.app/api/events"; 86 | const headers = { 87 | "Content-Type": "application/json", 88 | "Authorization": `Bearer ${API_KEY}` 89 | }; 90 | 91 | const eventData = { 92 | name: "", // required - event name 93 | domain: "", // required - your website domain 94 | description: "", // required - event description 95 | emoji: "🔔", // optional - emoji for Discord notification 96 | fields: [ // optional - additional fields for Discord notification 97 | { 98 | name: "Field Name", 99 | value: "Field Value", 100 | inline: true // optional - display fields in same line 101 | } 102 | ] 103 | }; 104 | 105 | const sendRequest = async () => { 106 | try { 107 | const response = await axios.post(url, eventData, { headers }); 108 | console.log("Event sent successfully", response.data); 109 | } catch (error) { 110 | console.error("Error:", error.response ? error.response.data : error.message); 111 | } 112 | }; 113 | 114 | sendRequest(); 115 | ``` 116 | 117 | Using Python: 118 | ```python 119 | import requests 120 | 121 | API_KEY = "YOUR_API_KEY" 122 | url = "https://getanalyzr.vercel.app/api/events" 123 | headers = { 124 | "Content-Type": "application/json", 125 | "Authorization": f"Bearer {API_KEY}" 126 | } 127 | 128 | event_data = { 129 | "name": "", # required - event name 130 | "domain": "", # required - your website domain 131 | "description": "", # required - event description 132 | "emoji": "🔔", # optional - emoji for Discord notification 133 | "fields": [ # optional - additional fields for Discord notification 134 | { 135 | "name": "Field Name", 136 | "value": "Field Value", 137 | "inline": True # optional - display fields in same line 138 | } 139 | ] 140 | } 141 | 142 | def send_request(): 143 | try: 144 | response = requests.post(url, json=event_data, headers=headers) 145 | response.raise_for_status() 146 | print("Event sent successfully", response.json()) 147 | except requests.exceptions.RequestException as error: 148 | print("Error:", error) 149 | 150 | send_request() 151 | ``` 152 | 153 | Yes, it's that simple! 154 | 155 | - **Performance Monitoring:** Monitor how fast your site loads (and find areas to improve with smart suggestions on what to optimize next). 156 | 157 | - **Device & Browser Stats:** See what devices, browsers, and operating systems your visitors are using. 158 | 159 | - **Location Tracking:** Understand where your visitors are coming from. 160 | 161 | - **Discord Notifications:** Get live updates on events right in your Discord DM. 162 | 163 | --- 164 | 165 | ### How Does It Work? 166 | 167 | ![Diagram](./public/diagram.png) 168 | 169 | Here's exactly how Analyzr works, with no secrets: 170 | 171 | First, you add our tracking script to your website - it's just a simple piece of code that counts when people visit your pages and what they click on. 172 | 173 | This information goes straight to Supabase (our database provider), which organizes all this data. 174 | 175 | We store everything safely in Supabase's storage system. 176 | 177 | When you log in to your dashboard, you'll see all this information displayed in charts and numbers. 178 | 179 | And if you want, we can send updates about your website straight to your Discord - it's that straightforward! 180 | 181 | You can look at our code on GitHub to see exactly how everything works. 182 | 183 | --- 184 | 185 | ### 🤖 Discord Integration 186 | 187 | ![Product 3](./public/product3.png) 188 | 189 | Setting up Discord notifications is easy: 190 | 191 | 1. **Enable Developer Mode in Discord** 192 | - Open User Settings 193 | - Go to App Settings → Advanced 194 | - Enable Developer Mode 195 | 196 | 2. **Get Your Discord User ID** 197 | - Right-click your profile or username 198 | - Click "Copy User ID" 199 | 200 | 3. **Add it to Analyzr** 201 | - Go to /settings in your Analyzr dashboard 202 | - Paste your Discord User ID 203 | - Save the changes 204 | 205 | Once set up, you'll get real-time notifications for: 206 | 207 | - Website traffic spikes 208 | - Performance alerts 209 | - Custom event triggers 210 | - Error notifications 211 | - And more! 212 | 213 | (as you set it.) 214 | 215 | --- 216 | 217 | ### 💪 What Makes It Different? 218 | 219 | ![Product 1](./public/product1.png) 220 | 221 | 1. **It's Free** 222 | - No "free trial" tricks 223 | - No "upgrade to see more data" stuff 224 | - Just free, forever! 225 | 226 | 2. **Super Easy to Use** 227 | - Add one line of code to your site 228 | - See your stats right away 229 | 230 | 3. **Discord Integration** 231 | - Real-time notifications 232 | - Custom alerts for important events 233 | - Manage everything from Discord 234 | 235 | --- 236 | 237 | ### 📦 Want to Try It? 238 | 239 | It's super easy to get started: 240 | 241 | 1. **Add the Tracking Script (and other stuff if needed)** 242 | 243 | For Vanilla/React apps: 244 | ```html 245 | 251 | ``` 252 | 253 | For Next.js apps: 254 | ```html 255 | `; 23 | 24 | const next_snippet = `