Skip to content

hex-0xd4c0/CaptRAW-Documents

Repository files navigation

CaptRAW Documents

A modern technical blog and documentation management system focused on knowledge sharing and technical content.

CaptRAW Documents Banner


πŸš€ Project Overview

CaptRAW Documents is a full-featured blog system that provides user management, article management, and content browsing capabilities. The project adopts a modern technology stack with strong emphasis on code quality, security, and user experience.

✨ Core Features

  • πŸ“ Article Management System – Supports writing and publishing articles in Markdown format
  • 🎨 Modern UI Design – Responsive design with dark/light theme support
  • πŸ” User Authentication System – Complete registration, login, and profile management
  • 🏷️ Tag & Category System – Flexible tagging and categorization of articles
  • πŸ“Š Analytics – Tracks views, likes, and comments
  • πŸ”§ Configuration-Driven Architecture – Flexible configuration system supporting multi-environment deployment
  • πŸ›‘οΈ Security-Oriented Design – Sensitive configuration isolation and secure resource access control

πŸ“Š Project Status

  • Current Version: v0.6.0
  • Development Phase: Phase 2 – Real Database Integration (Day 1 completed)
  • Last Updated: April 2026 (Stage 2, Day 2 in progress)

βœ… Completed Features

  1. Project Foundation – Complete monorepo structure and development environment
  2. Layout System – Header, Footer, Layout components with responsive design
  3. Homepage Features – BannerCarousel (auto-rotating), NoticeBoard, ArticleTimeline with pagination
  4. Configuration System – Secure YAML configuration with frontend runtime loading + database-backed dynamic configuration
  5. Data Layer – Modular API services (articles, banners, notices, tags, auth, files)
  6. Backend Foundation – PostgreSQL database, MinIO/S3 object storage, asset signing service
  7. Asset Management – Signed URL generation, asset registry with database fallback
  8. UI Components – AssetImage, ThemeToggle, UserAvatar with federation support
  9. Custom Hooks – useArticles, useAssetUrl, useBanners, useNotices, useTags
  10. Project Documentation – Complete module documentation across all directories
  11. Real Database Architecture – Complete business tables (users, articles, announcements, banners, server_info)
  12. Server Information System – Dynamic configuration management with public/private controls
  13. Real API Endpoints – Article, Banner, and Authentication APIs with full CRUD operations
  14. Database Management Tools – Reset, seed, and migration scripts
  15. Federal Identity Support – Fediverse user ID integration in user table

🚧 Features in Progress

  1. Frontend Service Layer Refactoring – Removing mock data, switching to real API calls (Day 2 task)
  2. Article Detail Page – Markdown rendering with syntax highlighting
  3. Comment System – Nested comments with reactions
  4. User Authentication Frontend – Login, registration pages (Day 4 task)
  5. Admin Dashboard – Article, user, and content management
  6. Search Functionality – Full-text search with filters
  7. API Documentation – OpenAPI/Swagger specification

πŸ› οΈ Tech Stack

Frontend

  • Framework: React 19.2.4 + TypeScript 4.9.5
  • Routing: React Router DOM 7.13.2
  • State Management: @tanstack/react-query 5.95.2
  • Styling: Tailwind CSS 3.4.19
  • HTTP Client: Axios 1.14.0
  • Build Tool: Create React App 5.0.1
  • Configuration: js-yaml 4.1.1
  • Testing: React Testing Library, Jest

Backend

  • Runtime: Node.js + Express 5.2.1
  • Database: PostgreSQL 16 + pg 8.20.0
  • Object Storage: @aws-sdk/client-s3 (S3 compatible, MinIO support)
  • Asset Management: Signed URL generation with expiry, asset registry
  • Database Operations: Connection pooling, transactions, health checks
  • Configuration: Unified YAML configuration with environment variable overrides
  • Containerization: Docker Compose for development environment

πŸ“ Project Structure

CaptRAW-Documents/
β”œβ”€β”€ frontend/                    # Frontend project (React + TypeScript + Tailwind)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/         # React components
β”‚   β”‚   β”‚   β”œβ”€β”€ layout/         # Layout components (Header, Footer, Layout)
β”‚   β”‚   β”‚   β”œβ”€β”€ ui/             # UI components (AssetImage, ThemeToggle, UserAvatar)
β”‚   β”‚   β”‚   β”œβ”€β”€ home/           # Homepage components (BannerCarousel, NoticeBoard, ArticleTimeline)
β”‚   β”‚   β”‚   └── articles/       # Article components (ArticleCard)
β”‚   β”‚   β”œβ”€β”€ pages/              # Page components (HomePage)
β”‚   β”‚   β”œβ”€β”€ hooks/              # React Hooks (useArticles, useAssetUrl, etc.)
β”‚   β”‚   β”œβ”€β”€ services/           # API services (modular service architecture)
β”‚   β”‚   β”œβ”€β”€ config/             # Configuration module (runtimeConfig, urls)
β”‚   β”‚   β”œβ”€β”€ data/               # Data files (articles, notices, banners JSON)
β”‚   β”‚   β”œβ”€β”€ types/              # TypeScript definitions
β”‚   β”‚   └── utils/              # Utility functions (assetUrl)
β”‚   β”œβ”€β”€ public/                 # Static assets
β”‚   β”œβ”€β”€ scripts/                # Build scripts (config synchronization)
β”‚   └── package.json            # Dependencies
β”œβ”€β”€ backend/                    # Backend project (Node.js + Express + TypeScript)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ database/          # Database module (PostgreSQL connection pool)
β”‚   β”‚   β”‚   β”œβ”€β”€ index.ts      # Database connection and query utilities
β”‚   β”‚   β”‚   β”œβ”€β”€ articles.ts   # Article database operations
β”‚   β”‚   β”‚   β”œβ”€β”€ users.ts      # User database operations
β”‚   β”‚   β”‚   β”œβ”€β”€ banners.ts    # Banner database operations
β”‚   β”‚   β”‚   └── serverInfo.ts # Server info database operations
β”‚   β”‚   β”œβ”€β”€ services/         # Business logic services
β”‚   β”‚   β”‚   β”œβ”€β”€ articleService.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ authService.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ bannerService.ts
β”‚   β”‚   β”‚   └── serverInfoService.ts
β”‚   β”‚   β”œβ”€β”€ routes/          # API route handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ articleRoute.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ authRoute.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ bannerRoute.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ assetSignRoute.ts
β”‚   β”‚   β”‚   └── serverInfoRoute.ts
β”‚   β”‚   β”œβ”€β”€ storage/           # Storage module (S3 compatible client)
β”‚   β”‚   β”œβ”€β”€ assetRegistry.ts   # Asset registry with database fallback
β”‚   β”‚   β”œβ”€β”€ config.ts          # Configuration management
β”‚   β”‚   └── server.ts          # Express server
β”‚   β”œβ”€β”€ scripts/                # Utility scripts (asset upload)
β”‚   β”œβ”€β”€ init-db.sql            # Database initialization script
β”‚   └── package.json            # Dependencies
β”œβ”€β”€ Reference/                  # Project documentation and resources
β”œβ”€β”€ scripts/                    # Global scripts (MinIO initialization)
β”œβ”€β”€ config.yaml                 # Main configuration file
β”œβ”€β”€ docker-compose.yml          # Docker configuration (PostgreSQL + MinIO)
└── .gitignore                  # Git ignore file

πŸš€ Quick Start

Requirements

  • Node.js 18+
  • npm 9+ or yarn 1.22+
  • Git

Installation Steps

  1. Clone the repository

    git clone <repository-url>
    cd CaptRAW-Documents
  2. Install dependencies

    # Frontend dependencies
    cd frontend
    npm install
    
    # Backend dependencies
    cd ../backend
    npm install
  3. Start infrastructure services

    # Start PostgreSQL and MinIO using Docker Compose
    docker-compose up -d
  4. Initialize the database

    # Run database initialization
    cd backend
    npm run seed-db
  5. Upload sample assets

    # Upload sample images to object storage
    npm run upload-assets
  6. Start development servers

    # Terminal 1: Backend server
    cd backend
    npm run dev
    
    # Terminal 2: Frontend server
    cd frontend
    npm start
  7. Access the application


πŸ“– Usage Guide

Development Mode

cd frontend
npm start

Production Build

npm run build

Run Tests

npm test

πŸ”§ Development Guide

Code Standards

  • TypeScript for static typing
  • ESLint for linting
  • Prettier for formatting
  • Functional components + Hooks

Component Development

import React from 'react';

interface NewComponentProps {}

const NewComponent: React.FC<NewComponentProps> = (props) => {
  return (
    // JSX
  );
};

export default NewComponent;

πŸ§ͺ Testing

Commands

npm test
npm test -- --testPathPattern=ComponentName
npm test -- --coverage

Strategy

  • Unit testing
  • Integration testing
  • End-to-end testing

πŸ“¦ Deployment

Build

cd frontend
npm run build

Docker

docker build -t captraw-documents .
docker run -p 3000:80 captraw-documents

Platforms

  • Vercel (Frontend)
  • Railway / Render (Backend)
  • Docker Hub (Images)

πŸ” Security Considerations

Configuration Security

  • Sensitive configs are not exposed to frontend
  • Type validation and error handling
  • Safe fallback mechanisms

Resource Security

  • Signed URL support for object storage
  • Backend-generated short-lived access URLs
  • Permission-based access control

Network Security

  • HTTPS support
  • CORS configuration
  • API rate limiting

🀝 Contribution Guide

Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Commit changes
  4. Push to branch
  5. Open a Pull Request

Code Review

  • Must pass TypeScript checks
  • All tests must pass
  • Follow coding standards
  • Update documentation

πŸ“„ License

This project is licensed under the AGPL-3.0 Licens.


πŸ“ž Contact


πŸ™ Acknowledgements

Thanks to all contributors who helped build this project.


πŸ“ˆ Project Progress

Roadmap

Phase Status Progress
Phase 1: Frontend Foundation βœ… Completed 100%
Phase 2: Backend Foundation βœ… Completed 100%
Phase 3: Real API Integration 🟑 In Progress 50%
Phase 4: Frontend Service Refactor 🟑 In Progress 20%
Phase 5: Article Detail Pages βšͺ Not Started 10%
Phase 6: User Authentication βšͺ Not Started 20%
Phase 7: Admin & Management βšͺ Not Started 0%
Phase 8: Testing & Deployment βšͺ Not Started 15%

Detailed Progress (Phase 2 - Real Database Integration)

  • βœ… Phase 2, Day 1: Real Database Architecture (100%)

    • Complete business tables with foreign key relationships
    • UUID-based primary keys for all entities
    • Federal identity support in user table
  • βœ… Phase 2, Day 1: Server Information System (100%)

    • Dynamic configuration storage in database
    • Public/private configuration controls
    • Runtime configuration API for frontend
  • βœ… Phase 2, Day 1: Article API Implementation (100%)

    • Complete CRUD operations for articles
    • Search, filtering, and pagination
    • Author information joining
  • βœ… Phase 2, Day 1: Banner API Implementation (100%)

    • Active banner filtering by date
    • Display order management
    • Admin management endpoints
  • βœ… Phase 2, Day 1: Authentication API Implementation (100%)

    • User registration and login
    • JWT token generation (basic)
    • Federal user identity support
  • 🟑 Phase 2, Day 2: Frontend Service Layer Refactoring (0%)

    • Remove mock data and simulateDelay
    • Connect to real API endpoints
    • Update error handling and retry logic
  • βšͺ Phase 2, Day 3: Article Detail Page Implementation (0%)

    • Article page component
    • Markdown rendering
    • Comment system foundation
  • βšͺ Phase 2, Day 4: User Authentication Frontend (0%)

    • Login and registration pages
    • Profile management
    • JWT token handling

Phase 2 Completion Goals (7-Day Plan)

βœ… Completed (April 1-2):

  1. Real database architecture and business tables
  2. Server information configuration system
  3. Complete backend API endpoints (articles, banners, auth)
  4. Database management scripts

πŸ”„ In Progress (April 2):

  1. Frontend service layer refactoring

πŸ“… Upcoming (April 3-7):

  1. Article detail pages
  2. User authentication frontend
  3. Testing and quality assurance
  4. Documentation and deployment preparation

Inspired by CaptRAW Community – Misskey Server You are also welcome to visit our CaptRAW community to communicate, share life, or just hang out.


If you want, I can further optimize this into:

  • GitHub README (more concise + badge style)
  • Product landing page copy (more marketing-oriented)
  • Technical whitepaper style (more formal and structured)

Just specify the target.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors