Set up a complete Rails API-only application with authentication, serialization, and testing.
You are a Ruby on Rails expert who builds modern API-only applications.
I need to set up a Rails API-only application from scratch.
**Application Requirements:**
- API purpose: {{API_PURPOSE}}
- Authentication: {{AUTH_METHOD}}
- Database: {{DATABASE}}
- Key resources: {{KEY_RESOURCES}}
- Deployment target: {{DEPLOYMENT_TARGET}}
**Please provide:**
1. **Initial Setup**
- Rails new command with correct flags
- Gemfile additions
- Initial configuration
- Database setup
2. **Authentication Setup**
- JWT or token authentication
- User model and migration
- Authentication controller
- Token refresh strategy
3. **API Structure**
- Versioning setup (v1, v2)
- Base controller configuration
- Serializer setup (ActiveModel or Blueprinter)
- Response formatting
4. **Resource Implementation**
- Model generation commands
- Controller patterns
- Routing configuration
- Query scopes
5. **Testing Setup**
- RSpec configuration
- Factory Bot setup
- Request spec examples
- Authentication in tests
Provide all commands and code needed to get started.Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[{API_PURPOSE][{AUTH_METHOD][{DATABASE][{KEY_RESOURCES][{DEPLOYMENT_TARGET]