NotJar is a powerful, fully open-source alternative to Hotjar, designed for developers and privacy-conscious teams. It allows you to monitor user behavior on your own servers, giving you full control over your data.
- Pixel-Perfect Replays: Watch exactly what your users see, including mouse movements, clicks, and scrolls.
- Event Timeline: A chronological log of every interaction within a session.
- Privacy Controls: Automatically masks sensitive data fields.
- Click Heatmaps: See where users are clicking most.
- Scroll Heatmaps: Understand how far down users are scrolling.
- Move Heatmaps: Track user attention through mouse movement.
- Multi-Tenant System: Manage multiple websites/projects from a single dashboard.
- Dynamic Script Generation: Each project gets a unique, lightweight tracking snippet.
- Geographic Data: Insights into where your users are coming from (Country/City).
- Full Data Ownership: Your data stays on your infrastructure.
- GDPR Friendly: Easy IP anonymization and cookie-less tracking options.
- No Hidden Costs: No monthly fees or recording limits.
- Backend: Node.js with Express and TypeScript.
- Database: PostgreSQL with Prisma ORM.
- Frontend: Next.js 15 with Tailwind CSS.
- Containerization: Docker & Docker Compose.
- Icons: Lucide React.
Get up and running in less than 2 minutes:
# 1. Clone and enter
git clone https://github.com/sentu1993/NotJar.git
cd NotJar
# 2. Setup Env
cp .env.example .env
# 3. Launch
docker-compose up -d --build
# 4. Init Database
docker-compose exec api npx prisma migrate dev --name initAccess the dashboard at http://localhost:3000
Ensure you have the following installed on your machine:
- Docker (v20.10.0 or higher)
- Docker Compose (v2.0.0 or higher)
- Git
git clone https://github.com/your-username/notjar.git
cd notjarCreate a .env file from the example:
cp .env.example .envNote: For production, make sure to change the JWT_SECRET and database credentials in .env and docker-compose.yml.
Start all services using Docker Compose:
docker-compose up -d --buildThis command will:
- Spin up a PostgreSQL database.
- Start the Express API (Backend) on port
5000. - Start the Next.js Dashboard (Frontend) on port
3000.
Once the containers are running, run the Prisma migrations:
docker-compose exec api npx prisma migrate dev --name initIf you prefer not to use Docker, follow these steps:
cd backend
npm install
cp .env.example .env # Update with your DB credentials
npx prisma migrate dev
npm run devcd frontend
npm install
cp .env.example .env # Update NEXT_PUBLIC_API_URL
npm run devNavigate to http://localhost:3000/register and create your admin account.
In your dashboard, click "Add Project". Provide a name (e.g., "My Blog") and the domain where you'll install the script (e.g., myblog.com).
Copy the generated tracking script from the project settings page. Paste it into the <head> section of your target website:
<script>
(function(n,o,t,j,a,r){
n.NotJarId=j; a=o.getElementsByTagName('head')[0];
r=o.createElement('script'); r.async=1;
r.src='http://your-server-ip:5000/tracker.js?id='+j;
a.appendChild(r);
})(window,document);
</script>Open your website in a new tab, move around, and click some buttons. Go back to the NotJar dashboard, click on your project, and you'll see your session appear under "Recent Sessions". Click "Replay" to watch the magic!
notjar/
├── backend/ # Express API & Prisma Schema
├── frontend/ # Next.js Dashboard UI
├── tracker/ # Vanilla JS tracking script
├── docker-compose.yml # Docker orchestration
└── .env.example # Template for environment variables
To save your changes and push them to your own GitHub:
# 1. Stage your changes
git add .
# 2. Commit your changes
git commit -m "feat: updated installation instructions"
# 3. Push to GitHub
git push origin main- JWT Auth: All dashboard endpoints are secured with JSON Web Tokens.
- CORS: Configurable cross-origin resource sharing.
- Data Scrubbing: The tracker can be configured to ignore specific input fields to protect PII (Personally Identifiable Information).
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or new features.
Built with ❤️ for the Open Source Community.