Skip to content

Danielkhakbaz/Code-Snippets

Repository files navigation

Code Snippets

A modern code snippets collection built with Next.js and TypeScript, designed to help developers quickly find and implement common code patterns and solutions. This project serves as a practical resource for front-end development patterns and best practices.

Project Overview

This code snippets project provides a curated collection of reusable code examples, components, and patterns that can be easily integrated into various web development projects. It's built with performance and developer experience in mind, featuring a clean interface for browsing and implementing code snippets.

Table of Contents

Features

  • Code Organization: Well-structured collection of code snippets by category and technology.
  • Syntax Highlighting: Beautiful code presentation with proper syntax highlighting.
  • Responsive Design: Fully responsive layout for all screen sizes.
  • Dark/Light Mode: Theme support for comfortable viewing in any environment.

Technologies Used

  • Next.js - React framework for server-side rendering and static website generation.
  • React - JavaScript library for building user interfaces.
  • TypeScript - JavaScript with static typing.
  • Tailwind CSS - Utility-first CSS framework for rapid UI development.
  • Prism.js - Lightweight syntax highlighting library.
  • React Syntax Highlighter - Syntax highlighting component for React.

Folder Structure

code-snippets/
├── app/                       # Source files for app pages
│   ├── snippets/              # Snippets section (page for code snippets)
│   ├── categories/            # Categories section (page for snippet categories)
│   ├── search/                # Search section (page for searching snippets)
│   ├── layout.tsx             # Root layout component
│   └── page.tsx               # Main landing page
│
├── components/                # Reusable components
│   ├── ui/                    # UI(shadCN) components
│   ├── snippets/              # Snippet-related components
│   └── layout/                # Layout components
│
├── lib/                       # Utility functions and configurations
│   ├── snippets/              # Snippet data and utilities
│   ├── utils/                 # Helper functions
│   └── types/                 # TypeScript type definitions
│
├── styles/                    # Global styles and Tailwind configuration
├── public/                    # Static assets
└── content/                   # Snippet content and metadata

Installation

To set up this project locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/Danielkhakbaz/Code-Snippets
    cd code-snippets
  2. Install dependencies:

    yarn
  3. Run the development server:

    yarn dev
  4. Open http://localhost:3000 in your browser to see the project.

Development Scripts

Here are some helpful scripts to assist in the development and maintenance of this project:

  • dev: Runs the app in development mode.
  • build: Compiles the app for production.
  • start: Starts the production server.
  • lint: Lints and fixes files using ESLint.
  • fix: Formats files using Prettier.
  • knip: Analyzes the project structure and provides suggestions for improvement.
  • check-prettier: Checks the code format without making changes.

About

Write and share your code snippets

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published