π Catalyst is an interactive, modular Phoenix project generator that sets up a complete development environment with everything you need for modern web development.
- β Interactive project creation
- β Database selection (Postgres, MySQL, SQLite)
- β Tailwind CSS integration (built-in with Phoenix)
- β Modern development environment
- π§ Oban - Background job processing with database schema and sample workers
- π Authentication - User registration and login with phx_gen_auth
- β‘ LiveView - Real-time interactive examples and components
- π‘οΈ Bodyguard - Authorization policies integrated with authentication
- π― Absinthe - GraphQL API with schema and resolvers
- π Waffle - File uploads with uploader and controller
- π HTTPoison - HTTP client for external API requests
- π§ Swoosh - Email functionality with mailer and templates
- π§ͺ ExMachina - Test factories for reliable test data
- β Credo - Code quality analysis and linting
- π Dialyxir - Static analysis and type checking
- β‘ Alpine.js - Lightweight JavaScript framework for interactivity
- π³ Docker - Containerized development and deployment
# Clone the repository
git clone https://github.com/your-username/catalyst.git
cd catalyst
# Install dependencies
mix deps.get
# Build the project
mix compile# Run the interactive setup
mix catalyst.newThe setup will guide you through:
-
Project Configuration
- Project name (with validation)
- Database choice (Postgres/MySQL/SQLite)
-
Module Selection
- Choose which modules to include
- Each module adds specific functionality
-
Automatic Setup
- Creates Phoenix project with your choices
- Installs and configures selected modules
- Generates comprehensive documentation
$ mix catalyst.new
π Welcome to Catalyst - Modular Phoenix Setup!
Project name? my_awesome_app
Database [1] Postgres (default), [2] MySQL, [3] SQLite: 1
Include Oban (background jobs)? [Yn] y
Include Authentication (phx_gen_auth)? [Yn] y
Include LiveView with examples? [Yn] y
Include Bodyguard (authorization)? [Yn] y
Include Absinthe (GraphQL)? [Yn] y
Include Waffle (file uploads)? [Yn] y
Include HTTPoison (HTTP requests)? [Yn] y
Include Swoosh (email)? [Yn] y
Include ExMachina (test factories)? [Yn] y
Include Credo (code quality)? [Yn] y
Include Dialyxir (static analysis)? [Yn] y
Include Alpine.js? [Yn] y
Include Docker support? [Yn] n
β
Phoenix project created successfully!
β
Oban setup completed!
β
Auth setup completed!
β
LiveView setup completed!
β
Bodyguard setup completed!
β
Absinthe setup completed!
β
Waffle setup completed!
β
HTTPoison setup completed!
β
Swoosh setup completed!
β
ExMachina setup completed!
β
Credo setup completed!
β
Dialyxir setup completed!
β
Alpine setup completed!
π Catalyst setup is complete! Navigate to your project with:
cd my_awesome_app
mix setupEach module includes comprehensive documentation in docs/catalyst/:
- π Oban - Background job processing guide
- π Authentication - User auth setup and usage
- β‘ LiveView - Real-time interactive components
- π‘οΈ Bodyguard - Authorization policies and helpers
- π― Absinthe - GraphQL API development
- π Waffle - File upload handling
- π HTTPoison - HTTP client usage
- π§ Swoosh - Email functionality
- π§ͺ ExMachina - Test factory patterns
- β Credo - Code quality guidelines
- π Dialyxir - Static analysis setup
- β‘ Alpine.js - Interactive components and directives
- π³ Docker - Containerization and deployment
- Reliable background job processing with database schema
- Sample EmailWorker, ExampleWorker, and NotificationWorker templates
- Multiple queue configuration (default, emails, critical)
- Job scheduling and monitoring capabilities
- Automatic retry and error handling
- User registration and login with phx_gen_auth
- Password reset functionality
- Session management
- Route protection helpers
- Real-time interactive components
- Multiple example implementations
- Event handling and state management
- Smooth transitions and animations
- Authorization policies and helpers
- Integration with authentication
- Policy-based access control
- Plugs and helpers for controllers
- Complete GraphQL API setup
- Schema definitions and resolvers
- Query and mutation examples
- Router integration
- File upload handling with uploader
- Controller and template integration
- Route configuration
- Upload validation and processing
- HTTP client for external API calls
- GET, POST, PUT, DELETE, PATCH methods
- JSON encoding/decoding
- Error handling and response processing
- Email functionality with mailer
- Welcome, password reset, and notification emails
- HTML and text email templates
- Background job integration
- Test factories for reliable test data
- User, post, comment, category, and tag factories
- Factory helpers and custom traits
- Build and insert functions
- Comprehensive code quality analysis
- Consistency, design, and readability checks
- Refactoring opportunities
- Warning detection
- Static type analysis and checking
- Dead code detection
- Race condition detection
- Specification checking
- Lightweight JavaScript framework
- Reactive components
- Event handling
- Smooth transitions
- Multi-stage production builds
- Development environment with database
- Containerized deployment
- Environment configuration
lib/
βββ catalyst/
β βββ modules/
β β βββ oban/
β β βββ auth/
β β βββ liveview/
β β βββ bodyguard/
β β βββ absinthe/
β β βββ waffle/
β β βββ httpoison/
β β βββ swoosh/
β β βββ ex_machina/
β β βββ credo/
β β βββ dialyxir/
β β βββ alpine/
β β βββ docker/
β βββ utils.ex
βββ mix/
β βββ tasks/
β βββ catalyst.new.ex
βββ catalyst.ex
- Create a new module directory in
lib/catalyst/modules/ - Implement the
setup/1function using the Utils module - Add comprehensive documentation
- Update the module list in
catalyst.new.ex
defmodule Catalyst.Modules.YourModule do
@moduledoc """
Description of what this module does.
"""
import Catalyst.Modules.Utils, only: [
create_file_from_template: 3,
inject_dependency: 2,
create_documentation: 3
]
def setup(project_path) do
inject_dependency(project_path, {:your_dep, "~> 1.0"})
create_your_files(project_path)
create_documentation(project_path)
System.cmd("mix", ["deps.get"], cd: project_path)
:ok
rescue
e -> {:error, Exception.message(e)}
end
end- Use the Utils module for consistency
- Provide comprehensive documentation
- Include real-world examples
- Handle errors gracefully
- Test all functionality
- Run Credo for code quality checks
- Use Dialyxir for static analysis
- Follow Elixir best practices
- Write comprehensive tests
- Use ExMachina factories for test data
- Write integration tests
- Test error scenarios
- Maintain test coverage
- Fork the repository
- Create a feature branch
- Add your module or improvement
- Add tests and documentation
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Phoenix Framework team for the excellent web framework
- Oban team for reliable background job processing
- Alpine.js team for lightweight JavaScript framework
- All the Elixir community for amazing tools and libraries
Catalyst - Building better Phoenix applications, one module at a time. π