Transform your scattered code snippets into a beautiful, searchable visual library
A visual code snippet manager that combines the visual appeal of Pinterest with the functionality of GitHub Gists.
Want to jump right in? Try the live demo - no installation needed!
For local development, you'll need Node.js 18+ and PostgreSQL. See detailed setup below β¬οΈ
- Pinterest-Style Interface - Visually appealing snippet organization
- Syntax Highlighting - Beautiful code display for 100+ languages
- Dark/Light Themes - Customizable visual experience
- Responsive Design - Perfect on desktop, tablet, and mobile
- Smart Search & Filtering - Find snippets by language, tags, or content
- Custom Collections - Organize snippets into themed groups
- Tags & Metadata - Rich categorization and discovery
- Import/Export - Easy backup and migration
- Public Sharing - Share snippets with customizable links
- Comment System - Collaborate and discuss code
- Secure Authentication - Google OAuth or email/password
Beautiful Pinterest-style code snippet organization
Elegant dark theme for comfortable coding
- Node.js (v18+)
- PostgreSQL database
- Firebase project (for authentication)
-
Clone the repository:
git clone https://github.com/hexawolf/CodePatchwork.git cd CodePatchwork -
Install dependencies:
npm install
-
Create a
.envfile in the root directory with the following variables:# PostgreSQL Database DATABASE_URL=postgres://username:password@localhost:5432/codepatchwork # Firebase Configuration VITE_FIREBASE_API_KEY=your-api-key VITE_FIREBASE_PROJECT_ID=your-project-id VITE_FIREBASE_APP_ID=your-app-id -
Set up Firebase for authentication:
- Create a Firebase project at firebase.google.com
- Enable Authentication with Google and Email/Password providers
- Add your domain to Authorized Domains in Firebase Console (Authentication > Settings)
- Copy your Firebase configuration values to the
.envfile
-
Set up the database:
npm run db:push
-
Start the development server:
npm run dev
- Click the "+" button in the navigation bar
- Enter the snippet title, code, and select the language
- Add optional tags and description
- Click "Save" to add the snippet to your collection
- Navigate to the Collections page
- Click "Create Collection"
- Name your collection and add an optional description
- Add snippets to your collection from the snippet context menu
- Use the search bar at the top of the page
- Filter by language, tags, or full-text search
- Toggle between grid and list views for different visualization options
- Click the "Share" button on any snippet
- Toggle the "Public" switch to make the snippet publicly accessible
- Copy the generated link to share with others
-
Frontend:
- React.js 18 (Functional components & hooks)
- TypeScript
- TailwindCSS (with light/dark mode)
- Vite (for fast development & builds)
- Shadcn UI (for accessible UI components)
- Prism.js (for code syntax highlighting)
- TanStack Query (for data fetching)
- Zod (for validation)
-
Backend:
- Node.js
- Express.js
- PostgreSQL (for data storage)
- Drizzle ORM (for type-safe database queries)
- Firebase Authentication (for user management)
βββ client/ # Frontend React application
β βββ public/ # Static assets
β βββ src/ # React source code
β βββ components/ # UI components
β βββ contexts/ # React contexts
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utilities and constants
β βββ pages/ # Application pages
βββ server/ # Backend Express server
β βββ index.ts # Server entry point
β βββ routes.ts # API routes
β βββ storage.ts # Database operations
β βββ vite.ts # Vite development server setup
βββ shared/ # Shared code between client and server
βββ schema.ts # Database schema and types
npm run dev- Start development servernpm run build- Build for productionnpm run test:logger- Verify Winston file logging indistnpm run db:push- Push schema changes to databasenpm run db:studio- Open Drizzle Studio to manage database
After running npm run build, execute npm run test:logger to verify that
/home/zk/logs/codepatchwork.log is created. The test script writes a few
messages using the bundled logger to ensure file logging works in production.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please see CONTRIBUTING.md for details on how to contribute to this project.
For questions or support, please open an issue on the GitHub repository.
Made with β€οΈ by hexawulf
