TrackForge is a production-grade, open-source traffic tracking platform inspired by Keitaro. Built with modern technologies including Next.js 14, React 18, TypeScript, Supabase, and Drizzle ORM.
Clone the repository: ```bash git clone https://github.com/yourusername/trackforge.git cd trackforge ```
Install dependencies: ```bash pnpm install ```
Set up environment variables: ```bash cp .env.example .env.local ```
Fill in your environment variables:
DATABASE_URL - Your PostgreSQL connection stringNEXT_PUBLIC_SUPABASE_URL - Your Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY - Your Supabase anon keyUPSTASH_REDIS_REST_URL - Your Upstash Redis URLUPSTASH_REDIS_REST_TOKEN - Your Upstash Redis tokenSet up the database: ```bash pnpm db:generate pnpm db:migrate ```
Start the development server: ```bash pnpm dev ```
Open http://localhost:3000 to see the application.
``` trackforge/ ├── app/ # Next.js 14 App Router │ ├── actions/ # Server Actions │ ├── api/ # API Routes │ ├── dashboard/ # Dashboard pages │ ├── campaigns/ # Campaign management │ └── layout.tsx # Root layout ├── components/ # React components │ ├── ui/ # shadcn/ui components │ ├── dashboard/ # Dashboard components │ └── campaigns/ # Campaign components ├── lib/ # Utilities and configurations │ ├── db/ # Database schema and connection │ ├── supabase/ # Supabase client configuration │ └── validations/ # Zod schemas ├── hooks/ # Custom React hooks └── scripts/ # Database scripts ```
GET /api/track?c={campaignId} - Track clicks and redirect to offersGET /api/postback?click_id={clickId}&status={status}&revenue={revenue} - Receive conversion postbacksThe application uses a PostgreSQL database with the following main tables:
users - User accounts and authenticationtraffic_sources - Traffic source configurationscampaigns - Campaign settings and metadatastreams - Traffic distribution streamsclicks - Click tracking datapostbacks - Conversion tracking datagit checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)Run the test suite: ```bash pnpm test ```
The application is optimized for deployment on Vercel:
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions, please open an issue on GitHub or contact the maintainers.
Built with ❤️ by the TrackForge team