My personal Data Structures and Algorithms practice repository converted into a modern web interface for easy code browsing and sharing, built with Next.js and TypeScript.
DSA started as my personal practice repository where I solve and implement various Data Structures and Algorithms problems. I decided to convert this collection into a web-based interface so that anyone can easily browse through my code implementations, solutions, and practice progress in a clean, organized manner.
- π Personal DSA Collection: 90+ problems and algorithms I've practiced, covering arrays, sorting, patterns, hashing, STL, and mathematical operations
- π Easy Code Browsing: Clean interface to view my code implementations organized by topics with syntax highlighting
- π Dynamic Content Organization: Automated index generation to keep my growing practice collection organized
- β‘ Modern Web Interface: Built with Next.js 15, React 19, and TypeScript 5 for smooth browsing experience
- π¨ Clean Design: Responsive design with Tailwind CSS 4 for easy viewing on any device
- π₯ Fast Development: Turbopack integration for quick updates as I add more solutions
- π± Mobile Friendly: View my code implementations on any device
- π Code Highlighting: Beautiful syntax highlighting with Prism React Renderer for better readability
- Framework: Next.js 15.4.6 with App Router
- UI Library: React 19.1.0
- Language: TypeScript 5.x
- Styling: Tailwind CSS 4.x
- Syntax Highlighting: Prism React Renderer 2.3.1
- Build Tool: Turbopack (Next.js bundler)
- Linting: ESLint 9.x with Next.js config
- PostCSS: Tailwind CSS PostCSS plugin
- Node Runtime: Node.js with ES Modules support
- Web: TypeScript (52.8%), JavaScript (5.2%), CSS (2.7%)
- Algorithms: C++ (39.3%)
- Node.js: 18.x or higher
- Package Manager: npm, yarn, pnpm, or bun
- Git: For cloning the repository
# Clone the repository
git clone https://github.com/DestroyerV/DSA.git
cd DSA
# Install dependencies
npm install
# or
yarn install
# or
pnpm install
# or
bun install
# Run the development server
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 in your browser to see the application.
No additional environment variables are required for local development. The application works out of the box.
The following npm scripts are available in package.json:
| Script | Command | Description |
|---|---|---|
dev |
npm run prebuild && next dev --turbopack |
Starts development server with Turbopack and auto-generates data index |
prebuild |
node scripts/buildCode.mjs |
Generates DSA index from C++ files in /dsa directory |
build |
npm run prebuild && next build |
Creates production build with optimized assets |
start |
next start |
Starts production server (requires npm run build first) |
lint |
next lint |
Runs ESLint for code quality checks |
The scripts/buildCode.mjs is a crucial Node.js script that:
- π Scans the
/dsadirectory recursively for C++ files (.cpp,.h,.hpp,.txt) - π Indexes all code files with metadata (path, name, content)
- π³ Builds a hierarchical folder tree structure for navigation
- πΎ Generates
data/dsa-index.jsonconsumed by the Next.js application - β° Timestamps the generation for cache invalidation
# Run data generation manually
node scripts/buildCode.mjsstriver-dsa/
βββ π app/ # Next.js App Router pages and layouts
βββ π components/ # Reusable React components
βββ π data/ # Generated JSON index files
β βββ dsa-index.json # Auto-generated DSA content index
βββ π dsa/ # C++ algorithm implementations
β βββ π arrays/ # Array-based algorithms
β βββ π hashing/ # Hash table implementations
β βββ π maths/ # Mathematical algorithms
β βββ π patterns/ # Pattern printing programs
β βββ π sorting/ # Sorting algorithms
β βββ π stl/ # STL (Standard Template Library) examples
βββ π public/ # Static assets (images, icons, etc.)
βββ π scripts/ # Build and utility scripts
β βββ buildCode.mjs # DSA index generation script
βββ π types/ # TypeScript type definitions
βββ π .gitignore # Git ignore rules
βββ π README.md # Project documentation (this file)
βββ π eslint.config.mjs # ESLint configuration
βββ π next-env.d.ts # Next.js TypeScript declarations
βββ π next.config.ts # Next.js configuration
βββ π package.json # Project dependencies and scripts
βββ π postcss.config.mjs # PostCSS configuration
βββ π tsconfig.json # TypeScript configuration
- The
buildCode.mjsscript scans the/dsafolder for C++ files - Extracts file content, metadata, and builds a searchable index
- Creates a hierarchical tree structure for intuitive navigation
- Outputs
data/dsa-index.jsonwith timestamped data
- Next.js loads the generated JSON index at build/runtime
- React components render the DSA content with syntax highlighting
- Users can browse topics, view code implementations, and search algorithms
- Responsive design ensures optimal experience across all devices
- Add new C++ files to appropriate
/dsasubdirectories - Run
npm run devto auto-generate index and start development server - Hot reload updates the UI instantly as you modify code or content
- Production builds include pre-generated static content for optimal performance
- All DSA implementations are indexed and ready for fast client-side navigation
We welcome contributions to expand the DSA collection and improve the platform! Here's how to get started:
- π Create or navigate to the appropriate folder in
/dsa/ - βοΈ Write your C++ implementation with clear comments
- π§ͺ Test your algorithm with sample inputs/outputs
- π Run
npm run devto regenerate the index - π Submit a pull request with your changes
- Language: C++ with clear, educational comments
- Naming: Descriptive file and function names
- Structure: Organize files by topic/category
- Examples: Include sample usage in
main()function - Performance: Add time/space complexity comments where relevant
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-algorithm - Make your changes and test locally
- Commit with descriptive messages:
git commit -m "feat: add binary search implementation" - Push to your branch:
git push origin feature/new-algorithm - Open a pull request with detailed description
- Basic Next.js application setup
- C++ code indexing and generation
- Responsive UI with Tailwind CSS
- Syntax highlighting for code display
- Search functionality across algorithms
- Algorithm categorization and filtering
- Interactive Code Editor: In-browser C++ compilation and execution
- Complexity Analysis: Visual time/space complexity graphs
- Test Case Runner: Automated testing with custom inputs
- Performance Benchmarks: Algorithm performance comparisons
- Learning Paths: Guided tutorials for beginners
- Multi-language Support: Java, Python, JavaScript implementations
- Visual Algorithms: Step-by-step algorithm visualizations
- Community Features: User submissions and discussions
- Mobile App: Native iOS/Android applications
- AI Integration: Algorithm recommendations and explanations
This project is licensed under the MIT License - see the LICENSE file for details.
β Star this repo if you find it helpful!