A modern, comprehensive analytics platform
Introduction •
Tech Stack •
Getting Started •
Docker & Deployment
A modern, comprehensive open-source self-hosted analytics platform designed to help you collect, analyze, and understand your website data effortlessly.
- Next.js - Framework
- TypeScript - Language
- Drizzle ORM - ORM
- Neon PostgreSQL - Database
- Better Auth - Authentication
- Tailwind - Styling
- Resend - Email
- Biome - Linting & Formatting
- Vercel - Deployment
- Node.js 18+
- PostgreSQL database (we recommend Neon for easy setup)
- Resend account for email functionality
- Google OAuth credentials (optional, for Google login)
- Clone the repository:
git clone https://github.com/ibrahimraimi/inflow.git
cd inflow- Install dependencies:
bun install- Set up environment variables:
cp .env .envFill in your environment variables in .env:
# Database
DATABASE_URL="postgresql://username:password@host:port/database"
# Authentication
NEXT_PUBLIC_APP_URL="https://inflow.studio21.studio"
BETTER_AUTH_SECRET="your-secret-key"
BETTER_AUTH_URL="https://inflow.studio21.studio"
# Google OAuth (optional)
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
# Email (Resend)
RESEND_API_KEY="your-resend-api-key"
EMAIL_SENDER_NAME="Inflow Analytics"
EMAIL_SENDER_ADDRESS="noreply@yourdomain.com"- Set up the database:
bun db:generatebun db:migrate- Start the development server:
bun devOpen https://inflow.studio21.studio in your browser.
The application uses a PostgreSQL database with the following main entities:
- Users: User accounts with authentication
- Organizations: Multi-user organizations with role-based access
- Members: Organization members with roles (owner, admin, member)
- Websites: Websites being tracked for analytics
- Sessions: User authentication sessions
- Invitations: Organization membership invitations
bun dev- Start development serverbun build- Build for productionbun start- Start production serverbun lint- Run Biome linterbun format- Format code with Biomebun db:generate- Generate database migrationsbun db:migrate- Run database migrationsbun db:push- Push schema changes to databasebun db:pull- Pull schema from database
Or use the Makefile for common tasks:
make help # Show all available commands
make dev # Start development server
make ci # Run CI checks locally (lint, type-check, build)
make docker-up # Start with Docker- Build and run with Docker Compose:
docker compose up --build- Or use the Makefile:
make docker-upThe application will be available at https://inflow.studio21.studio.
This project includes a complete CI/CD pipeline with GitHub Actions:
- Continuous Integration: Automated linting, type checking, and builds on every PR
- Docker Build: Multi-platform Docker images published to GitHub Container Registry
- Deployment: Automated deployment to production on merge to main
-
Configure GitHub Secrets (Settings → Secrets → Actions):
DEPLOY_HOST- Production server hostnameDEPLOY_USER- SSH usernameDEPLOY_SSH_KEY- Private SSH keyDEPLOY_PATH- Application path on server
-
Create a production environment with variable:
APP_URL- Your production URL
For detailed setup instructions, see .github/SETUP.md.
After pushing to main, Docker images are available at:
docker pull ghcr.io/ibrahimraimi/inflow:latest
docker run -p 3000:3000 --env-file .env.prod ghcr.io/ibrahimraimi/inflow:latestThis project is private and proprietary.
For support or questions, please contact the development team.