A beautiful, structured learning resource for students and professionals
CN Docs is a comprehensive, well-structured documentation site for computer networking and socket programming. Built with Next.js and Fumadocs, it provides clear explanations, practical examples, and high-quality code samples for everything from networking fundamentals to advanced socket programming techniques.
- π Comprehensive documentation with MDX support
- π Full-text search functionality
- πΌοΈ Dynamic OG image generation for social sharing
- π± Fully responsive design for all devices
- π¨ Clean and modern UI powered by Fumadocs
- β‘ Fast and SEO-friendly with Next.js
- π Easy-to-follow structured learning path
- π§ Comprehensive coverage from OSI model to advanced socket programming
- π» High-quality code examples with proper documentation
- π οΈ Practical projects with real-world networking applications
- π Visual explanations with diagrams and illustrations
- π Interactive examples where applicable
- π Beginner-friendly explanations of complex concepts
- π Next.js framework for optimal performance
- π MDX documentation for rich content
- π¨ Tailwind CSS for beautiful styling
- π§ TypeScript for type safety
- π Automated content generation tools
- π SEO optimization for better discoverability
The documentation is organized into logical sections:
- Networking Basics
- OSI Model
- TCP/IP Model
- Network Topologies
- IP Addressing & DNS
- Internet Architecture
- TCP & UDP Protocols
- MAC Addressing
- URL Structure
- HTTP Protocol
- Socket Fundamentals
- Socket Types
- Socket API
- Socket Options
- Byte A6CE Order
- Security Considerations
- Best Practices
- Socket Models
- TCP Sockets
- UDP Sockets
- Client-Server Architecture
- Multicast Communication
- Unix Domain Sockets
- Raw Sockets
- Advanced Techniques
- Blocking vs Non-blocking
- Multiplexing (select/poll)
- Advanced Multiplexing (epoll)
- Socket I/O Techniques
- Debugging Socket Applications
- Error Handling
- Complete networking projects
- Example implementations
- Performance benchmarks
Each topic includes practical, well-commented code examples that demonstrate key concepts. Our examples:
- Follow best practices for production-ready code
- Include comprehensive error handling
- Provide clear comments explaining each step
- Are tested in real-world scenarios
- Include both basic and advanced implementations
Example from our Client-Server Architecture section:
// Message header structure
struct message_header {
uint8_t version; // Protocol version
uint8_t type; // Message type
uint16_t command; // Command identifier
uint32_t payload_size; // Size of the payload
uint32_t sequence_id; // Message sequence number
};
// Complete message structure
struct message {
struct message_header header;
char payload[MAX_PAYLOAD_SIZE];
};
- Node.js 18.0 or higher
- Bun (recommended) or npm/yarn
-
Clone the repository:
git clone https://github.com/subhadeeproy3902/cndocs.git cd cndocs
-
Install dependencies:
bun install # or npm install
-
Run the development server:
bun run dev # or npm run dev
-
Open http://localhost:3000 in your browser.
- Next.js - React framework
- Fumadocs - Documentation framework
- Tailwind CSS - Utility-first CSS framework
- TypeScript - Type-safe JavaScript
- MDX - Markdown with JSX
We use a custom script to easily add content from sources like GeeksforGeeks:
bun run add-doc <url>
This automatically:
- Scrapes content from the provided URL
- Downloads images to the public folder
- Generates well-formatted MDX files
- Applies proper formatting and styling
- Create a new MDX file in the appropriate directory under
content/docs/
- Add frontmatter with title and description
- Write your content using Markdown and MDX components
- Add code examples, images, and other resources as needed
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- GeeksforGeeks for some of the reference content
- All contributors who have helped improve this documentation
- The open-source community for the amazing tools that made this possible
Created with β€οΈ by Subhadeep Roy
Visit the live site: https://cn.mvp-subha.me