A simplified Phoenix application starter template with Auth0 integration and role-based authentication.
The file architecture for this is dramatically different from the default Phoenix Generated experience, and is optimized for domain-based organization.
Optimized with dual workflow (sqlite/postgres) for phoenix.new vibecoding experiences.
- Role-based Authentication: Admin and User roles with different access levels
- Auth0 Integration: Secure OAuth authentication flow
- Phoenix LiveView: Real-time, interactive web application
- Tailwind CSS: Modern, responsive styling
- SQLite Database: Lightweight database for development
- Comprehensive Test Suite: Full test coverage with colocated tests
- Elixir 1.15+
- Phoenix 1.8+
- Node.js (for asset compilation)
- Clone the repository:
git clone <repository-url>
cd my_app- Install dependencies:
mix deps.get- Set up the database:
mix ecto.setup-
Configure Auth0 (see Auth0 Setup section below)
-
Start the server:
./start_server.shVisit localhost:4000 to see the application.
Create a config/.env file with your Auth0 credentials:
export AUTH0_DOMAIN=your-domain.auth0.com
export AUTH0_CLIENT_ID=your_client_id
export AUTH0_CLIENT_SECRET=your_client_secret
export AUTH0_REDIRECT_URI=http://localhost:4000/auth/callback
export AUTH0_HOME_URI=http://localhost:4000mix testThis application uses a domain-driven architecture with:
- Context modules in
lib/my_app/these contain business logic:- pubsub notifications (if applicable)
- accounting/mathematical transformations
- role logic
- specific business-based data access patterns
- Web layer in
lib/web/- all live- and dead- views, organized by domain and not "type of page"
- Data layer in
lib/data/data modules should contain:- database access
- table caches (if applicable)
- OAuth integration in
lib/oauth/
- Admin: Full system access, user management
- User: Standard user access to personal dashboard
mix credo --strictThe application uses Postgres by default. To use sqlite:
DATABASE_ADAPTER=sqlite mix compileThis project is available as open source under the terms of the MIT License.