{"id":18780522,"url":"https://github.com/barkprotocol/membership-platform","last_synced_at":"2025-10-12T12:27:34.585Z","repository":{"id":257693827,"uuid":"858524155","full_name":"barkprotocol/membership-platform","owner":"barkprotocol","description":"BARK is a Members Club Platform built as a SaaS application that provides exclusive features and rewards to its members. This platform includes user authentication, Stripe integration for payments, role-based access control, and a personalized dashboard for users to manage memberships and NFTs.","archived":false,"fork":false,"pushed_at":"2024-09-18T02:05:37.000Z","size":123,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T04:32:58.950Z","etag":null,"topics":[],"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/barkprotocol.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}},"created_at":"2024-09-17T03:45:13.000Z","updated_at":"2025-03-05T13:11:55.000Z","dependencies_parsed_at":"2024-09-18T19:30:55.198Z","dependency_job_id":null,"html_url":"https://github.com/barkprotocol/membership-platform","commit_stats":null,"previous_names":["barkprotocol/underdogs-saas-platform","barkprotocol/membership-platform"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/barkprotocol/membership-platform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barkprotocol%2Fmembership-platform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barkprotocol%2Fmembership-platform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barkprotocol%2Fmembership-platform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barkprotocol%2Fmembership-platform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barkprotocol","download_url":"https://codeload.github.com/barkprotocol/membership-platform/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barkprotocol%2Fmembership-platform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273213765,"owners_count":25065058,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-07T20:26:54.097Z","updated_at":"2025-10-12T12:27:29.548Z","avatar_url":"https://github.com/barkprotocol.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BARK - Members Club Platform\n**Proof of Concept**\n\nBARK is a Members Club Platform built as a SaaS application that provides exclusive features and rewards to its members. This platform includes user authentication, Stripe integration for payments, role-based access control, and a personalized dashboard for users to manage memberships, clubs, and NFTs.\n\n## Features\n\n- **Marketing Landing Page** (`/`):  \n  A beautifully designed landing page that introduces the platform, including sections for **Marketing**, **Membership**, and **Club** information.\n  \n- **Pricing Page** (`/pricing`):  \n  A pricing page that connects to both **Solana Pay** and **Stripe Checkout**, offering users flexible payment methods.\n\n- **Dashboard Pages**:  \n  Authenticated users can manage their data and interact with the platform using **CRUD operations** on users and clubs.\n\n- **Role-Based Access Control (RBAC)**:  \n  Basic access control system supporting **Owner** and **Member** roles for fine-grained permissions.\n\n- **Subscription Management**:  \n  Integrates with **Stripe Customer Portal** for managing subscription plans, billing details, and payment history.\n\n- **Email/Password Authentication**:  \n  Secure **JWT-based** authentication system. JWTs are stored in cookies for session management.\n\n- **Global Middleware**:  \n  Protects logged-in routes by ensuring only authenticated users can access certain pages.\n\n- **Local Middleware**:  \n  Used to secure server actions and validate inputs using **Zod** schemas to ensure correct data handling.\n\n- **Activity Logging System**:  \n  Tracks and logs key user events to monitor activity across the platform.\n\n- **Database Management with Drizzle Kit**:  \n  Drizzle Kit is used to manage database migrations, schema updates, and SQL query generation for your application.\n\n## Tech Stack\n\n- **Next.js**: React framework with server-side rendering and static site generation.\n- **TypeScript**: Provides type safety to ensure code reliability.\n- **NextAuth.js**: Manages authentication using JWTs for secure user sessions.\n- **Stripe**: Handles membership payments and subscription management.\n- **Solana Pay**: Integration for Solana-based payment options.\n- **Drizzle Kit**: Simplifies database migrations and schema management.\n- **Tailwind CSS**: Utility-first CSS framework for styling.\n- **MongoDB**: Database solution for storing user and subscription data.\n- **Vercel**: Hosting and deployment platform optimized for Next.js applications.\n\n## Getting Started\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/barkprotocol/members-club-platform.git\ncd members-club-platform\n```\n\n### 2. Install Dependencies\n\nInstall the required dependencies with npm or yarn:\n\n```bash\nnpm install\n```\n\nor\n\n```bash\nyarn install\n```\n\n### 3. Set Up Environment Variables\n\nCreate a `.env.local` file in the root of your project and include the following variables:\n\n```bash\n# NextAuth settings\nNEXTAUTH_URL=http://localhost:3000\nNEXTAUTH_SECRET=your-nextauth-secret\n\n# Stripe settings\nSTRIPE_SECRET_KEY=your-stripe-secret-key\nSTRIPE_PUBLISHABLE_KEY=your-stripe-publishable-key\nSTRIPE_WEBHOOK_SECRET=your-stripe-webhook-secret\n\n# MongoDB settings\nMONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/dbname?retryWrites=true\u0026w=majority\n\n# Supabase\nDATABASE_URL=your-database-url\nDB_CONNECTION=your-connection-string\n```\n\n### 4. Drizzle Kit Setup\n\nDrizzle Kit is used for handling database migrations and schema management. To set it up, follow these steps:\n\n1. Install **Drizzle Kit** as a development dependency:\n\n   ```bash\n   npm install drizzle-kit --save-dev\n   ```\n\n2. Create a **drizzle.config.ts** file to configure the database connection and migration paths:\n\n   ```ts\n   import { defineConfig } from 'drizzle-kit';\n\n   export default defineConfig({\n     schema: './src/db/schema', // Path to your schema files\n     out: './migrations',       // Directory where migrations are stored\n     driver: 'pg',              // Database driver, e.g., 'pg' for PostgreSQL\n     dbConnectionString: process.env.DRIZZLE_DB_CONNECTION, // Database connection string from .env\n   });\n   ```\n\n3. Run migrations:\n\n   ```bash\n   npx drizzle-kit generate\n   npx drizzle-kit push\n   ```\n\n4. Add database schema changes and run migrations as your application grows.\n\n### 5. Run the Development Server\n\nTo start the development server, run:\n\n```bash\nnpm run dev\n```\n\nor\n\n```bash\nyarn dev\n```\n\nAccess the app at `http://localhost:3000`.\n\n## Scripts\n\n- **Start Development**: `npm run dev` – Runs the app in development mode.\n- **Build for Production**: `npm run build` – Builds the app for production deployment.\n- **Start in Production**: `npm start` – Starts the app using the built files.\n- **Linting**: `npm run lint` – Runs ESLint to check for code quality.\n- **Run Migrations**: `npx drizzle-kit generate \u0026\u0026 npx drizzle-kit push` – Generates and applies database migrations.\n\n## Key Components\n\n- **Landing Page**: \n  - Marketing and club introduction for prospective users.\n  \n- **Pricing**: \n  - Flexible payment integration with **Stripe** and **Solana Pay**.\n\n- **Dashboard**: \n  - Allows users to manage clubs and view NFT-related content.\n  \n- **RBAC (Role-Based Access Control)**: \n  - Defines permissions for **Owners** and **Members** to manage club assets and content.\n\n- **Authentication \u0026 JWT**: \n  - Authentication system using **NextAuth.js** to manage user sessions securely with **JWTs** stored in cookies.\n\n- **Stripe Payment**: \n  - Handles subscription payments and plan upgrades using **Stripe Checkout** and **Customer Portal**.\n\n- **Middleware**: \n  - Global middleware to protect logged-in routes.\n  - Local middleware to secure server actions or validate **Zod** schemas.\n\n- **Activity Logging**: \n  - Logs user activities for improved monitoring and auditing.\n\n- **Database with Drizzle Kit**: \n  - Simplified schema migrations and updates using Drizzle Kit for consistent database management.\n\n## Deployment\n\nFor deployment, platforms like **Vercel** are ideal for deploying Next.js applications.\n\n1. Push your code to GitHub or another Git provider.\n2. Link your repository to [Vercel](https://vercel.com/).\n3. Set the **environment variables** on Vercel under \"Settings \u003e Environment Variables\".\n4. Vercel will handle the build and deployment process automatically.\n\n## Webhooks\n\nTo handle Stripe events like subscription creation or payment failures, set up a webhook endpoint:\n\n1. In your Stripe dashboard, navigate to **Developers \u003e Webhooks**.\n2. Add a new endpoint with the URL `https://your-domain.com/api/webhooks/stripe`.\n3. Configure necessary Stripe events (e.g., `invoice.payment_succeeded`, `invoice.payment_failed`).\n4. Add your **webhook secret** to `.env.local` as `STRIPE_WEBHOOK_SECRET`.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarkprotocol%2Fmembership-platform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarkprotocol%2Fmembership-platform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarkprotocol%2Fmembership-platform/lists"}