Skip to content

ibrahimraimi/inflow

Repository files navigation

A modern, comprehensive analytics platform designed to help you collect, analyze, and understand your website data effortlessly.

Inflow Analytics

A modern, comprehensive analytics platform
IntroductionTech StackGetting StartedDocker & Deployment


Introduction

A modern, comprehensive open-source self-hosted analytics platform designed to help you collect, analyze, and understand your website data effortlessly.

Tech Stack

Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL database (we recommend Neon for easy setup)
  • Resend account for email functionality
  • Google OAuth credentials (optional, for Google login)

Installation

  1. Clone the repository:
git clone https://github.com/ibrahimraimi/inflow.git
cd inflow
  1. Install dependencies:
bun install
  1. Set up environment variables:
cp .env .env

Fill 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"
  1. Set up the database:
bun db:generate
bun db:migrate
  1. Start the development server:
bun dev

Open https://inflow.studio21.studio in your browser.

Database Schema

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

Available Scripts

  • bun dev - Start development server
  • bun build - Build for production
  • bun start - Start production server
  • bun lint - Run Biome linter
  • bun format - Format code with Biome
  • bun db:generate - Generate database migrations
  • bun db:migrate - Run database migrations
  • bun db:push - Push schema changes to database
  • bun 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

Docker & Deployment

Running with Docker

  1. Build and run with Docker Compose:
docker compose up --build
  1. Or use the Makefile:
make docker-up

The application will be available at https://inflow.studio21.studio.

CI/CD Pipeline

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

Setup Instructions

  1. Configure GitHub Secrets (Settings → Secrets → Actions):

    • DEPLOY_HOST - Production server hostname
    • DEPLOY_USER - SSH username
    • DEPLOY_SSH_KEY - Private SSH key
    • DEPLOY_PATH - Application path on server
  2. Create a production environment with variable:

    • APP_URL - Your production URL

For detailed setup instructions, see .github/SETUP.md.

Pulling from GitHub Container Registry

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:latest

License

This project is private and proprietary.

Support

For support or questions, please contact the development team.

About

A modern, comprehensive open-source self-hosted analytics platform.

Topics

Resources

Stars

Watchers

Forks

Languages