Welcome to the CTK New project documentation. This document provides an overview of the project structure and links to all relevant documentation.
ctk-new/
├── app/ # Next.js application
│ ├── (routes)/ # App router pages
│ ├── api/ # API routes
│ ├── components/ # React components
│ └── ...
├── docs/ # Documentation
│ ├── sql/ # Database schemas and setup
│ ├── setup/ # Configuration and setup guides
│ └── api/ # API documentation
├── lib/ # Utility libraries
├── public/ # Static assets
└── ...
- supabase-setup.sql - Complete database schema setup
- categories-setup.sql - Categories table and blog relationships
- blogs - Blog posts with categories, content, and metadata
- categories - Blog categories for organization
- users - User authentication and profiles
- Row Level Security (RLS) - Secure data access policies
- supabase-config.md - Supabase configuration guide
- BLOG_CRM_SETUP.md - Blog CRM system setup instructions
Required environment variables for the project:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
# Site Configuration
NEXT_PUBLIC_SITE_URL=https://yourdomain.com- Clone the repository
- Install dependencies:
npm installoryarn install - Set up environment variables (see setup guides above)
- Run database setup scripts (see SQL documentation)
- Start development server:
npm run dev
- Blog Management System - Create, edit, delete blog posts
- Category Management - Organize blogs with categories
- Admin Panel - Secure admin interface for content management
- Image Management - Supabase storage integration
- SEO Optimized - Sitemap generation and meta tags
- Responsive Design - Mobile-first approach
GET /api/blogs- Fetch all blogsPOST /api/blogs- Create new blogPUT /api/blogs- Update existing blogDELETE /api/blogs- Delete blog
GET /api/categories- Fetch all categoriesPOST /api/categories- Create new categoryPUT /api/categories- Update existing categoryDELETE /api/categories- Delete category
- Frontend: Next.js 14, React, TypeScript
- Styling: Tailwind CSS
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth
- Storage: Supabase Storage
- Markdown: @uiw/react-md-editor
- TypeScript for type safety
- ESLint for code quality
- Prettier for code formatting
- Component-based architecture
- Follow the existing code style
- Add tests for new features
- Update documentation as needed
- Use conventional commit messages
Common issues and solutions:
- Database connection errors: Check Supabase credentials
- Image upload failures: Verify storage bucket permissions
- Build errors: Ensure all dependencies are installed
For questions or issues:
- Check this documentation first
- Review the setup guides
- Check existing issues
- Create a new issue with detailed information
Last updated: ${new Date().toLocaleDateString()}