Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .claude/claude.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "GradesCentral API",
"description": "Rails API for UW Madison course data and grade distributions",
"version": "1.0.0",
"config": {
"sessionStartHook": ".claude/hooks/session_start.sh"
}
}
5 changes: 5 additions & 0 deletions .claude/commands/migrate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
description: Run database migrations
---

Run pending database migrations using `rake db:migrate`.
5 changes: 5 additions & 0 deletions .claude/commands/reindex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
description: Reindex Elasticsearch data
---

Reindex all searchable models in Elasticsearch using `rake reindex`.
5 changes: 5 additions & 0 deletions .claude/commands/routes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
description: Display all API routes
---

Display all available API routes using `rake routes`.
5 changes: 5 additions & 0 deletions .claude/commands/server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
description: Start the Rails development server
---

Start the Rails development server using `rails s` on port 3000.
5 changes: 5 additions & 0 deletions .claude/commands/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
description: Run the test suite
---

Run the Rails test suite using `bundle exec rails test` or appropriate test command.
62 changes: 62 additions & 0 deletions .claude/hooks/session_start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash
# Session start hook for GradesCentral API
# This script runs when a new Claude Code session starts

echo "🚀 Starting GradesCentral API session..."

# Check Ruby version
if command -v ruby &> /dev/null; then
RUBY_VERSION=$(ruby -v)
echo "✓ Ruby: $RUBY_VERSION"
else
echo "⚠ Ruby not found"
fi

# Check if bundler is installed
if command -v bundle &> /dev/null; then
echo "✓ Bundler installed"
else
echo "⚠ Bundler not found - run: gem install bundler"
fi

# Check if dependencies are installed
if [ -f "Gemfile.lock" ]; then
if bundle check &> /dev/null; then
echo "✓ Bundle dependencies installed"
else
echo "⚠ Bundle dependencies missing - run: bundle install"
fi
fi

# Check for database configuration
if [ -f "config/database.yml" ]; then
echo "✓ Database configuration found"
else
echo "⚠ Database configuration missing - create config/database.yml"
fi

# Check for environment file
if [ -f ".env" ]; then
echo "✓ Environment configuration found"
else
echo "⚠ Environment file missing - copy .env.example to .env"
fi

# Check Elasticsearch connection
if command -v curl &> /dev/null; then
if curl -s http://localhost:9200 &> /dev/null; then
echo "✓ Elasticsearch running at localhost:9200"
else
echo "⚠ Elasticsearch not accessible at localhost:9200"
fi
fi

echo ""
echo "📝 Available commands:"
echo " /test - Run the test suite"
echo " /server - Start Rails development server"
echo " /migrate - Run database migrations"
echo " /routes - Display all API routes"
echo " /reindex - Reindex Elasticsearch data"
echo ""
echo "Ready to code! 🎉"
Loading