Branchwell
AI Resource Pro project

website

git clone https://branchwell.ai/airesourcepro/website.git

1 commit pushed here · 1 open to votes · 0 removed by votes · updated 26 min ago

Latest: Website: current files by Branchwell, 26 min ago

📁 .cursor
📁 .roo
📁 content
📁 d1
📁 docs
📁 e2e
📁 episodes
📁 lib
📁 public
📁 scripts
📁 src
📁 supabase
📁 tests
📄 .cursorrules4.0 KB
📄 .eslintrc.json183 B
📄 .gitignore790 B
📄 ADMIN_AUTH.md2.6 KB
📄 analyze-instance-count-issues.md3.7 KB
📄 API_SECURITY.md3.2 KB
📄 cloudflare-worker.mjs2.2 KB
📄 code-updates-after-rename.md2.4 KB
📄 components.json446 B
📄 directory-site-next@0.1.00 B
📄 examples.jsonl10.5 KB
📄 fav.png9.9 KB
📄 fix-dashboard-code.md2.9 KB
📄 fix-dashboard-page.md3.7 KB
📄 jest.config.mjs542 B
📄 jest.setup.mjs1.2 KB
📄 jwtauth-implementation.md2.3 KB
📄 MIGRATION_INSTRUCTIONS.md3.0 KB
📄 MIGRATION-INSTRUCTIONS.md1.4 KB
📄 next0 B
📄 next.config.js3.4 KB
📄 open-next.config.ts477 B
📄 package-lock.json892.2 KB
📄 package.json4.1 KB
📄 playwright.config.ts2.2 KB
📄 postcss.config.cjs81 B
📄 postcss.config.mjs135 B
📄 README-BLOG-FIX.md2.5 KB
📄 README.md5.7 KB
📄 robots.txt170 B
📄 run_tests.sh3.8 KB
📄 SECURITY_AUDIT.md10.4 KB
📄 SECURITY_UPDATES.md2.1 KB
📄 start-next.sh95 B
📄 supabase-types.ts0 B
📄 tailwind.config.js8.1 KB
📄 tailwind.config.ts1.9 KB
📄 test-api.sh4.5 KB
📄 test-auth-bypass.js1.8 KB
📄 test-blog-post.json77 B
📄 tmp_target_tools.json53.1 KB
📄 tsconfig.json704 B
📄 wrangler.jsonc1.1 KB

AI Resource Pro - airesourcepro.com

This is the repository for the AI Resource Pro website (airesourcepro.com), a platform dedicated to providing resources related to Artificial Intelligence.

Project Overview

AI Resource Pro is built using a modern web stack focused on performance, developer experience, and scalability. It utilizes Supabase for backend services like authentication and database management, and is deployed on Plesk.

Tech Stack

Key Features

  • AI Tool Directory: Curated list of AI tools, filterable by category.
  • Learning Resources: Educational content related to AI.
  • News Feed: Latest news in the AI space.
  • AI Coach: Personalized AI learning recommendations.
  • Admin Dashboard: Interface for managing content (Tools, Learning, News, Categories, Users).
  • API: Provides data access for various parts of the application.

Getting Started

  1. Clone the repository:
    ```bash
    git clone <repository-url>
    cd airesource-pro-site
    ```
  2. Install dependencies:
    ```bash
    npm install
    ```
  3. Set up environment variables:
    • Copy the example environment file: cp .env.example .env.local
    • Fill in the required values in .env.local, especially Supabase credentials (NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, SUPABASE_SERVICE_ROLE_KEY) and the API key (AI_RESOURCE_PRO_API_KEY).
    • Important Security Note: Ensure BYPASS_AUTH_IN_DEV is never set to true unless specifically for isolated local testing, and never commit it as true.
  4. Set up Supabase:
    • Ensure your local Supabase instance (if using Docker) or your remote Supabase project is running and configured according to the project's schema (potentially using Prisma migrations). Refer to supabase/ directory and Prisma schema if needed.
  5. Run Prisma migrations (if necessary):
    ```bash
    npx prisma migrate dev
    # or apply deployments if targeting a specific environment
    npx prisma migrate deploy
    ```
  6. Run the development server:
    ```bash
    npm run dev
    ```
  7. Open http://localhost:3001 in your browser.

Authentication

  • Primary Method: Supabase Authentication (JWT-based, handled via Supabase client libraries). Admin access relies on Supabase user roles.
  • Secondary Method (API): API Key (AI_RESOURCE_PRO_API_KEY set in .env.local). Required for certain backend API routes when not authenticated via Supabase. Include the header x-api-key: YOUR_API_KEY.

API Endpoints

The application exposes various API endpoints under /api/. Key areas include:

  • /api/admin/...: Endpoints for the admin dashboard (require Supabase admin authentication).
  • /api/auth/...: Authentication-related endpoints (login, logout, status checks).
  • /api/tools: CRUD operations for AI tools.
  • /api/learning: CRUD operations for learning resources.
  • /api/news: CRUD operations for news articles.
  • /api/categories: CRUD operations for categories.
  • /api/featured-tools, /api/featured-learning: Endpoints for featured content.
  • /api/faqs: Endpoint for FAQs.
  • /api/ai-coach/...: Endpoints for the AI Coach feature.
  • /api/webhooks/midjourney: Webhook for Midjourney image generation updates.
  • /api/revalidate: On-demand cache revalidation for content updates.
  • /api/health-check: Basic health check endpoint.

(For detailed request/response formats and parameters, please refer to the respective route handler files within src/app/api/)

Caching and Revalidation

Blog posts, news, and potentially other content types utilize Next.js caching.

  • Dynamic pages often use export const dynamic = 'force-dynamic' or similar strategies for fresh data.
  • The /api/revalidate endpoint allows invalidating specific paths (e.g., /api/revalidate?path=/news/[slug]) when content is updated via the admin panel, ensuring users see the latest information.

Testing

  • Unit/Integration Tests: Located in src/__tests__/. Run using:
    ```bash
    npm test
    # or yarn test, pnpm test
    ```
  • E2E Tests (Selenium): Refer to the "Selenium Testing" section in the previous README version or relevant test files if applicable. Ensure WebDriver and browser drivers are installed.

Deployment

  • The application is deployed on a Plesk server.
  • Configuration for PM2 (process manager) might be present in ecosystem.config.js.
  • Ensure environment variables are correctly set on the production server.

Color Palette

Light Theme

  • Primary: #1a1a1a
  • Secondary Accent: #46AAE9
  • Text: #000000
  • Background: #ffffff

Dark Theme

  • Primary: #ffffff
  • Secondary Accent: #46AAE9
  • Text: #ffffff
  • Background: #1a1a1a

Contribution Guidelines

  • Follow the coding patterns and separation rules outlined in .roo/rules/rules.md.
  • Write clean, simple, and maintainable code.
  • Avoid code duplication (DRY principle).
  • Ensure changes are well-tested.
  • Keep files focused (Single Responsibility Principle). Aim for < 300 lines per file.
  • Update this README if significant changes are made to the stack, architecture, or setup process.