- Ruby 3.3.3
- Rails 7.1.3 or higher
- PostgreSQL
- Clone the repository
git clone git@github.com:hoasung01/devcision.git
cd devcision
- Install dependencies
bundle install
- Setup database
rails db:create
rails db:migrate
The database is organized hierarchically:
AlgorithmCategory
├── AlgorithmType
│ └── Algorithm
│ ├── AlgorithmImplementation
│ ├── AlgorithmComplexity
│ ├── AlgorithmExample
│ └── AlgorithmBenchmark
AlgorithmCategory
: High-level categories (Sorting, Searching, etc.)AlgorithmType
: Specific types within categories (Comparison-based sorting, etc.)Algorithm
: Individual algorithms with their characteristicsAlgorithmImplementation
: Code implementations in various languagesAlgorithmComplexity
: Time and space complexity analysisAlgorithmExample
: Usage examples and test casesAlgorithmBenchmark
: Performance benchmarks
The seed data is organized in categories:
db/
└── seeds/
├── shared/
│ └── constants.rb
└── algorithms/
├── 01_sorting.seeds.rb
├── 02_searching.seeds.rb
├── 03_graph.seeds.rb
├── 04_dynamic_programming.seeds.rb
├── 05_string.seeds.rb
├── 06_tree.seeds.rb
├── 07_greedy.seeds.rb
├── 08_divide_conquer.seeds.rb
├── 09_backtracking.seeds.rb
├── 10_computational_geometry.seeds.rb
└── 11_numerical.seeds.rb
Load all seeds:
rails db:seed
Load specific category:
rails db:seed:algorithms:sorting
Reset and reload:
rails db:reset # Drops, creates, migrates, and seeds
# Get all sorting algorithms
sorting = AlgorithmCategory.find_by(name: 'Sorting Algorithms')
sorting_algorithms = sorting.algorithms
# Find specific algorithm
quick_sort = Algorithm.find_by(name: 'Quick Sort')
# Get complexity analysis
quick_sort.complexity_analysis
# Get implementations
quick_sort.implementations.by_language('ruby')
# Get examples
quick_sort.examples.by_difficulty(:beginner)
Explore some of the features of Devcision:
Input a problem description to get AI-powered algorithm analysis and recommendations.
- Fork the repository
- Create your feature branch (
git checkout -b feature/your-feature
) - Add your algorithms to the appropriate seed file
- Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin feature/your-feature
) - Create a Pull Request
This project is licensed under the MIT License