{"id":27946024,"url":"https://github.com/kennymwendwax/linksy","last_synced_at":"2025-05-07T13:47:37.780Z","repository":{"id":291802239,"uuid":"975499361","full_name":"KennyMwendwaX/linksy","owner":"KennyMwendwaX","description":"Linksly is a modern, full-featured URL shortening and link management platform built with Next.js, React, and TypeScript. It allows users to shorten, customize, and track links with comprehensive analytics.","archived":false,"fork":false,"pushed_at":"2025-05-06T15:31:57.000Z","size":152,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-06T16:50:19.488Z","etag":null,"topics":["better-auth","drizzle-orm","link-shortener","nextjs","postgresql","reactjs","shadcn-ui","tailwindcss","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KennyMwendwaX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-30T12:16:12.000Z","updated_at":"2025-05-06T15:32:00.000Z","dependencies_parsed_at":"2025-05-07T07:30:20.091Z","dependency_job_id":null,"html_url":"https://github.com/KennyMwendwaX/linksy","commit_stats":null,"previous_names":["kennymwendwax/linksy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KennyMwendwaX%2Flinksy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KennyMwendwaX%2Flinksy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KennyMwendwaX%2Flinksy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KennyMwendwaX%2Flinksy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KennyMwendwaX","download_url":"https://codeload.github.com/KennyMwendwaX/linksy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252890258,"owners_count":21820351,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["better-auth","drizzle-orm","link-shortener","nextjs","postgresql","reactjs","shadcn-ui","tailwindcss","typescript"],"created_at":"2025-05-07T13:47:36.977Z","updated_at":"2025-05-07T13:47:37.762Z","avatar_url":"https://github.com/KennyMwendwaX.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linksy - Modern Link Management Platform\n\n![Linksy](https://linksy.vercel.app)\nis a modern, full-featured URL shortening and link management platform built with Next.js, React, and TypeScript. It allows users to shorten, customize, and track links with comprehensive analytics.\n\n## ✨ Features\n\n- **URL Shortening**: Transform long URLs into clean, memorable links\n- **Custom Links**: Personalize your shortened URLs with custom slugs\n- **Advanced Analytics**: Track clicks, geographic data, referral sources, and more\n- **Link Management**: Organize, edit, and manage all your links from a single dashboard\n- **QR Code Generation**: Generate QR codes for your shortened links\n- **User Authentication**: Secure user accounts with authentication\n- **Responsive Design**: Works seamlessly across all devices\n- **Dark/Light Mode**: Choose between light and dark themes\n\n## 🛠️ Tech Stack\n\n- **Frontend**:\n\n  - [Next.js 14](https://nextjs.org/) - React framework with App Router\n  - [React](https://reactjs.org/) - UI library\n  - [TypeScript](https://www.typescriptlang.org/) - Type safety\n  - [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS\n  - [shadcn/ui](https://ui.shadcn.com/) - UI component library\n\n- **Backend**:\n\n  - [Next.js API Routes](https://nextjs.org/docs/api-routes/introduction) - API endpoints\n  - [PostgreSQL](https://www.postgresql.org/) - Database\n  - [Drizzle ORM](https://orm.drizzle.team/) - TypeScript ORM\n  - [Better Auth](https://www.better-auth.com/) - Authentication\n\n- **Deployment**:\n  - [Vercel](https://vercel.com/) - Hosting platform\n\n## 📋 Prerequisites\n\nBefore you begin, ensure you have the following installed:\n\n- Node.js (v18.17.0 or higher)\n- npm or yarn or pnpm\n- PostgreSQL (v14 or higher)\n\n## 🚀 Getting Started\n\n### Installation\n\n1. Clone the repository:\n   \\`\\`\\`bash\n   git clone https://github.com/KennyMwendwaX/linksy.git\n   cd linksy\n   \\`\\`\\`\n\n2. Install dependencies:\n   \\`\\`\\`bash\n   npm install\n\n   # or\n\n   yarn install\n\n   # or\n\n   pnpm install\n   \\`\\`\\`\n\n3. Set up environment variables:\n   Create a `.env.local` file in the root directory with the following variables:\n   \\`\\`\\`\n\n   # Database\n\n   DATABASE_URL=postgresql://username:password@localhost:5432/linksy\n\n   # BetterAuth\n\n   - BETTER_AUTH_URL=http://localhost:3000\n   - BETTER_AUTH_SECRET=your-secret-key\n\n   # Optional: OAuth providers\n\n   - GOOGLE_CLIENT_ID=your-google-client-id\n   - GOOGLE_CLIENT_SECRET=your-google-client-secret\n\n   # Base URL for shortened links\n\n   NEXT_PUBLIC_BASE_URL=http://localhost:3000\n   \\`\\`\\`\n\n### Database Setup\n\n1. Create a PostgreSQL database:\n   \\`\\`\\`bash\n   createdb linksy\n   \\`\\`\\`\n\n2. Run database migrations:\n   \\`\\`\\`bash\n   npm run db:migrate\n\n   # or\n\n   yarn db:migrate\n\n   # or\n\n   pnpm db:migrate\n   \\`\\`\\`\n\n3. (Optional) Seed the database with initial data:\n   \\`\\`\\`bash\n   npm run db:seed\n   # or\n   yarn db:seed\n   # or\n   pnpm db:seed\n   \\`\\`\\`\n\n### Development\n\nStart the development server:\n\\`\\`\\`bash\nnpm run dev\n\n# or\n\nyarn dev\n\n# or\n\npnpm dev\n\\`\\`\\`\n\nOpen [http://localhost:3000](http://localhost:3000) in your browser to see the application.\n\n## 📁 Project Structure\n\n\\`\\`\\`\nlinksy/\n├── app/ # Next.js App Router\n│ ├── api/ # API routes\n│ ├── (auth)/ # Authentication routes\n│ ├── dashboard/ # Dashboard routes\n│ └── [...slug]/ # Dynamic link redirect route\n├── components/ # React components\n│ ├── ui/ # shadcn/ui components\n│ └── ... # Custom components\n├── db/ # Database configuration\n│ ├── schema/ # Drizzle schema definitions\n│ ├── migrations/ # Database migrations\n│ └── index.ts # Database client\n├── lib/ # Utility functions\n│ ├── auth.ts # Authentication utilities\n│ ├── utils.ts # General utilities\n│ └── ... # Other utilities\n├── public/ # Static assets\n├── styles/ # Global styles\n├── types/ # TypeScript type definitions\n├── .env.example # Example environment variables\n├── .eslintrc.json # ESLint configuration\n├── .gitignore # Git ignore file\n├── drizzle.config.ts # Drizzle ORM configuration\n├── next.config.mjs # Next.js configuration\n├── package.json # Project dependencies\n├── postcss.config.js # PostCSS configuration\n├── README.md # Project documentation\n├── tailwind.config.ts # Tailwind CSS configuration\n└── tsconfig.json # TypeScript configuration\n\\`\\`\\`\n\n## 🗄️ Database Schema\n\n\\`\\`\\`typescript\n// Example schema definition with Drizzle ORM\nimport { pgTable, serial, text, timestamp, integer, boolean } from 'drizzle-orm/pg-core';\n\nexport const users = pgTable('users', {\nid: serial('id').primaryKey(),\nname: text('name'),\nemail: text('email').notNull().unique(),\npassword: text('password'),\ncreatedAt: timestamp('created_at').defaultNow(),\nupdatedAt: timestamp('updated_at').defaultNow(),\n});\n\nexport const links = pgTable('links', {\nid: serial('id').primaryKey(),\nuserId: integer('user_id').references(() =\u003e users.id),\noriginalUrl: text('original_url').notNull(),\nshortCode: text('short_code').notNull().unique(),\ntitle: text('title'),\nisActive: boolean('is_active').default(true),\nexpiresAt: timestamp('expires_at'),\ncreatedAt: timestamp('created_at').defaultNow(),\nupdatedAt: timestamp('updated_at').defaultNow(),\n});\n\nexport const clicks = pgTable('clicks', {\nid: serial('id').primaryKey(),\nlinkId: integer('link_id').references(() =\u003e links.id),\nreferrer: text('referrer'),\nuserAgent: text('user_agent'),\nipAddress: text('ip_address'),\ncountry: text('country'),\ncity: text('city'),\ndevice: text('device'),\nbrowser: text('browser'),\nos: text('os'),\ncreatedAt: timestamp('created_at').defaultNow(),\n});\n\\`\\`\\`\n\n## 🔄 API Routes\n\n### URL Shortening\n\n- `POST /api/links` - Create a new shortened link\n- `GET /api/links` - Get all links for the authenticated user\n- `GET /api/links/:id` - Get a specific link by ID\n- `PUT /api/links/:id` - Update a link\n- `DELETE /api/links/:id` - Delete a link\n\n### Analytics\n\n- `GET /api/links/:id/stats` - Get analytics for a specific link\n- `GET /api/dashboard/stats` - Get aggregated stats for the dashboard\n\n### Authentication\n\n- `POST /api/auth/register` - Register a new user\n- `POST /api/auth/login` - Login a user\n- `GET /api/auth/me` - Get the current authenticated user\n\n## 🧪 Testing\n\nRun tests with:\n\\`\\`\\`bash\nnpm run test\n\n# or\n\nyarn test\n\n# or\n\npnpm test\n\\`\\`\\`\n\n## 🚢 Deployment\n\n### Deploying to Vercel\n\nThe easiest way to deploy Linksy is to use the [Vercel Platform](https://vercel.com).\n\n1. Push your code to a GitHub repository\n2. Import the project to Vercel\n3. Add the required environment variables\n4. Deploy\n\n### Database Deployment\n\nFor production, we recommend using:\n\n- [Vercel Postgres](https://vercel.com/docs/storage/vercel-postgres)\n- [Neon](https://neon.tech/)\n- [Supabase](https://supabase.com/)\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgements\n\n- [Next.js](https://nextjs.org/)\n- [shadcn/ui](https://ui.shadcn.com/)\n- [Tailwind CSS](https://tailwindcss.com/)\n- [Drizzle ORM](https://orm.drizzle.team/)\n- [Lucide Icons](https://lucide.dev/)\n\n---\n\nBuilt with ❤️ by [Your Name](https://github.com/yourusername)\n\n# Linksy - Modern Link Management Platform\n\n![Linksy](https://via.placeholder.com/1200x630?text=Linksy+-+Modern+Link+Management)\n\nLinksy is a modern, full-featured URL shortening and link management platform built with Next.js, React, and TypeScript. It allows users to shorten, customize, and track links with comprehensive analytics.\n\n## ✨ Features\n\n- **URL Shortening**: Transform long URLs into clean, memorable links\n- **Custom Links**: Personalize your shortened URLs with custom slugs\n- **Advanced Analytics**: Track clicks, geographic data, referral sources, and more\n- **Link Management**: Organize, edit, and manage all your links from a single dashboard\n- **QR Code Generation**: Generate QR codes for your shortened links\n- **User Authentication**: Secure user accounts with authentication\n- **Responsive Design**: Works seamlessly across all devices\n- **Dark/Light Mode**: Choose between light and dark themes\n\n## 🛠️ Tech Stack\n\n- **Frontend**:\n\n  - [Next.js 14](https://nextjs.org/) - React framework with App Router\n  - [React](https://reactjs.org/) - UI library\n  - [TypeScript](https://www.typescriptlang.org/) - Type safety\n  - [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS\n  - [shadcn/ui](https://ui.shadcn.com/) - UI component library\n\n- **Backend**:\n\n  - [Next.js API Routes](https://nextjs.org/docs/api-routes/introduction) - API endpoints\n  - [PostgreSQL](https://www.postgresql.org/) - Database\n  - [Drizzle ORM](https://orm.drizzle.team/) - TypeScript ORM\n  - [NextAuth.js](https://next-auth.js.org/) - Authentication\n\n- **Deployment**:\n  - [Vercel](https://vercel.com/) - Hosting platform\n\n## 📋 Prerequisites\n\nBefore you begin, ensure you have the following installed:\n\n- Node.js (v18.17.0 or higher)\n- npm or yarn or pnpm\n- PostgreSQL (v14 or higher)\n\n## 🚀 Getting Started\n\n### Installation\n\n1. Clone the repository:\n   \\`\\`\\`bash\n   git clone https://github.com/yourusername/linksy.git\n   cd linksy\n   \\`\\`\\`\n\n2. Install dependencies:\n   \\`\\`\\`bash\n   npm install\n\n   # or\n\n   yarn install\n\n   # or\n\n   pnpm install\n   \\`\\`\\`\n\n3. Set up environment variables:\n   Create a `.env.local` file in the root directory with the following variables:\n   \\`\\`\\`\n\n   # Database\n\n   DATABASE_URL=postgresql://username:password@localhost:5432/linksy\n\n   # NextAuth\n\n   NEXTAUTH_URL=http://localhost:3000\n   NEXTAUTH_SECRET=your-secret-key\n\n   # Optional: OAuth providers\n\n   GOOGLE_CLIENT_ID=your-google-client-id\n   GOOGLE_CLIENT_SECRET=your-google-client-secret\n\n   # Base URL for shortened links\n\n   NEXT_PUBLIC_BASE_URL=http://localhost:3000\n   \\`\\`\\`\n\n### Database Setup\n\n1. Create a PostgreSQL database:\n   \\`\\`\\`bash\n   createdb linksy\n   \\`\\`\\`\n\n2. Run database migrations:\n   \\`\\`\\`bash\n   npm run db:migrate\n\n   # or\n\n   yarn db:migrate\n\n   # or\n\n   pnpm db:migrate\n   \\`\\`\\`\n\n3. (Optional) Seed the database with initial data:\n   \\`\\`\\`bash\n   npm run db:seed\n   # or\n   yarn db:seed\n   # or\n   pnpm db:seed\n   \\`\\`\\`\n\n### Development\n\nStart the development server:\n\\`\\`\\`bash\nnpm run dev\n\n# or\n\nyarn dev\n\n# or\n\npnpm dev\n\\`\\`\\`\n\nOpen [http://localhost:3000](http://localhost:3000) in your browser to see the application.\n\n## 📁 Project Structure\n\n\\`\\`\\`\nlinksy/\n├── app/ # Next.js App Router\n│ ├── api/ # API routes\n│ ├── (auth)/ # Authentication routes\n│ ├── dashboard/ # Dashboard routes\n│ └── [...slug]/ # Dynamic link redirect route\n├── components/ # React components\n│ ├── ui/ # shadcn/ui components\n│ └── ... # Custom components\n├── db/ # Database configuration\n│ ├── schema/ # Drizzle schema definitions\n│ ├── migrations/ # Database migrations\n│ └── index.ts # Database client\n├── lib/ # Utility functions\n│ ├── auth.ts # Authentication utilities\n│ ├── utils.ts # General utilities\n│ └── ... # Other utilities\n├── public/ # Static assets\n├── styles/ # Global styles\n├── types/ # TypeScript type definitions\n├── .env.example # Example environment variables\n├── .eslintrc.json # ESLint configuration\n├── .gitignore # Git ignore file\n├── drizzle.config.ts # Drizzle ORM configuration\n├── next.config.mjs # Next.js configuration\n├── package.json # Project dependencies\n├── postcss.config.js # PostCSS configuration\n├── README.md # Project documentation\n├── tailwind.config.ts # Tailwind CSS configuration\n└── tsconfig.json # TypeScript configuration\n\\`\\`\\`\n\n## 🗄️ Database Schema\n\n\\`\\`\\`typescript\n// Example schema definition with Drizzle ORM\nimport { pgTable, serial, text, timestamp, integer, boolean } from 'drizzle-orm/pg-core';\n\nexport const users = pgTable('users', {\nid: serial('id').primaryKey(),\nname: text('name'),\nemail: text('email').notNull().unique(),\npassword: text('password'),\ncreatedAt: timestamp('created_at').defaultNow(),\nupdatedAt: timestamp('updated_at').defaultNow(),\n});\n\nexport const links = pgTable('links', {\nid: serial('id').primaryKey(),\nuserId: integer('user_id').references(() =\u003e users.id),\noriginalUrl: text('original_url').notNull(),\nshortCode: text('short_code').notNull().unique(),\ntitle: text('title'),\nisActive: boolean('is_active').default(true),\nexpiresAt: timestamp('expires_at'),\ncreatedAt: timestamp('created_at').defaultNow(),\nupdatedAt: timestamp('updated_at').defaultNow(),\n});\n\nexport const clicks = pgTable('clicks', {\nid: serial('id').primaryKey(),\nlinkId: integer('link_id').references(() =\u003e links.id),\nreferrer: text('referrer'),\nuserAgent: text('user_agent'),\nipAddress: text('ip_address'),\ncountry: text('country'),\ncity: text('city'),\ndevice: text('device'),\nbrowser: text('browser'),\nos: text('os'),\ncreatedAt: timestamp('created_at').defaultNow(),\n});\n\\`\\`\\`\n\n## 🔄 API Routes\n\n### URL Shortening\n\n- `POST /api/links` - Create a new shortened link\n- `GET /api/links` - Get all links for the authenticated user\n- `GET /api/links/:id` - Get a specific link by ID\n- `PUT /api/links/:id` - Update a link\n- `DELETE /api/links/:id` - Delete a link\n\n### Analytics\n\n- `GET /api/links/:id/stats` - Get analytics for a specific link\n- `GET /api/dashboard/stats` - Get aggregated stats for the dashboard\n\n### Authentication\n\n- `POST /api/auth/register` - Register a new user\n- `POST /api/auth/login` - Login a user\n- `GET /api/auth/me` - Get the current authenticated user\n\n## 🧪 Testing\n\nRun tests with:\n\\`\\`\\`bash\nnpm run test\n\n# or\n\nyarn test\n\n# or\n\npnpm test\n\\`\\`\\`\n\n## 🚢 Deployment\n\n### Deploying to Vercel\n\nThe easiest way to deploy Linksy is to use the [Vercel Platform](https://vercel.com).\n\n1. Push your code to a GitHub repository\n2. Import the project to Vercel\n3. Add the required environment variables\n4. Deploy\n\n### Database Deployment\n\nFor production, we recommend using:\n\n- [Vercel Postgres](https://vercel.com/docs/storage/vercel-postgres)\n- [Neon](https://neon.tech/)\n- [Supabase](https://supabase.com/)\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgements\n\n- [Next.js](https://nextjs.org/)\n- [shadcn/ui](https://ui.shadcn.com/)\n- [Tailwind CSS](https://tailwindcss.com/)\n- [Drizzle ORM](https://orm.drizzle.team/)\n- [Lucide Icons](https://lucide.dev/)\n\n---\n\nBuilt with ❤️ by [Kennedy Mwendwa](https://github.com/KennyMwendwax)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennymwendwax%2Flinksy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkennymwendwax%2Flinksy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennymwendwax%2Flinksy/lists"}