Skip to content
/ pausa Public template
generated from cesswhite/v4.20

Minimal authentication solution for Nuxt projects with Supabase - ready to integrate in seconds

Notifications You must be signed in to change notification settings

cesswhite/pausa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

39 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

pausa_cover_image

Pausa: Minimal Authentication Starter Template for Nuxt

Pausa is a modern web application built with Nuxt and Supabase that serves as a minimal authentication template and starter kit for developers. It provides a robust authentication flow that can be integrated into any application in seconds.

🎯 Main Purpose

Pausa is a minimal authentication solution that allows developers to integrate a robust authentication flow into their applications in seconds. It functions as a starter template that includes everything needed to handle user authentication and management.

πŸ—οΈ Technical Architecture

Technology Stack:

  • Frontend: Nuxt with TypeScript
  • UI Framework: Nuxt UI
  • Database: Supabase (Auth)
  • Global State: Pinia
  • Animations: VueUse Motion
  • State Management: Composables + Stores

Built on cutting-edge technologies:

  • Nuxt for powerful, streamlined development
  • Nuxt UI for customizable and sleek UI components
  • Pinia for state management simplicity
  • Tailwind CSS for responsive and modern design
  • Supabase for backend-as-a-service with authentication
  • Fully compatible with the Nuxt v4 folder structure

πŸ“ Project Structure

app/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ Auth/          # Complete authentication components
β”‚   β”œβ”€β”€ Dashboard/     # Dashboard components
β”‚   β”œβ”€β”€ Landing/       # Landing page components
β”‚   └── App/          # General app components
β”œβ”€β”€ layouts/          # Layouts for different sections
β”œβ”€β”€ pages/           # Application routes
β”œβ”€β”€ stores/          # Global state with Pinia
β”œβ”€β”€ middleware/      # Authentication middleware
└── composables/     # Reusable logic

πŸ” Authentication System

Implemented Features:

  • βœ… User registration with email/password
  • βœ… Traditional login
  • βœ… Social provider authentication
  • βœ… Password recovery
  • βœ… Magic links
  • βœ… Route protection middleware
  • βœ… Session management with Supabase

Authentication Flow:

  1. Landing Page β†’ Redirects to dashboard if already authenticated
  2. Sign Up β†’ Registration with password validation
  3. Sign In β†’ Login with multiple options
  4. Dashboard β†’ Protected area with sidebar and navigation

🎨 User Interface

UI/UX Features:

  • Responsive Design: Adaptable to mobile and desktop
  • Dark/Light Mode: Automatic toggle
  • Smooth Animations: Transitions with VueUse Motion
  • Reusable Components: Based on Nuxt UI v3
  • Collapsible Sidebar: Adaptive navigation
  • Validated Forms: With visual feedback

πŸ”§ Configuration and Features

Key Configuration:

  • SEO Optimized: Automatic meta tags
  • Strict TypeScript: Complete typing
  • Hot Module Replacement: Fast development
  • Auto-imports: Automatic Nuxt configuration
  • Tailwind CSS v4: Modern styling

πŸ“Š State and Data Management

Global State:

  • Pinia Store: For authentication data
  • Composables: For reusable logic
  • Supabase Client: Direct database integration

πŸš€ Project Strengths

  1. Completeness: Complete and functional auth system
  2. Modernity: Updated technology stack
  3. Scalability: Modular and extensible architecture
  4. UX/UI: Modern and accessible interface
  5. Developer Experience: Optimized configuration
  6. Documentation: Detailed README

🎯 Use Cases

Ideal for:

  • Startups needing quick authentication
  • MVPs with authentication requirements
  • Projects requiring login/registration
  • Templates for developers
  • Basic SaaS applications

πŸ“ˆ Improvement Potential

Expansion Areas:

  • More authentication providers
  • Advanced user profiles
  • Roles and permissions
  • Real-time notifications
  • Integrated analytics

πŸ› οΈ Project Setup

Prerequisites

  • Node.js (>= 14.x)
  • npm or yarn
  • Supabase Account: You need to have a Supabase account and be familiar with creating projects
  • OAuth Providers Setup: Familiarity with creating OAuth applications for Google and GitHub

Required Accounts & Setup

1. Supabase Account

  • Create a free account at Supabase
  • Create a new project in your Supabase dashboard
  • Familiarize yourself with the Supabase dashboard and API settings

2. Google OAuth Setup

  • Go to Google Cloud Console
  • Create a new project or select an existing one
  • Enable the Google+ API
  • Go to "Credentials" β†’ "Create Credentials" β†’ "OAuth 2.0 Client IDs"
  • Set up authorized redirect URIs: https://your-project.supabase.co/auth/v1/callback
  • Copy your Client ID and Client Secret

3. GitHub OAuth Setup

  • Go to GitHub Developer Settings
  • Click "New OAuth App"
  • Set the Authorization callback URL: https://your-project.supabase.co/auth/v1/callback
  • Copy your Client ID and Client Secret

4. Configure OAuth in Supabase

  • In your Supabase dashboard, go to "Authentication" β†’ "Providers"
  • Enable and configure Google and GitHub providers
  • Add the Client IDs and Client Secrets from the previous steps

Installation

  1. Clone the repository:

    git clone https://github.com/{username}/pausa.git
    cd pausa
  2. Install dependencies:

    npm install
    # or
    yarn install
  3. Set up environment variables:

    Create a .env file in the root directory and add the following variables:

    # Supabase Configuration
    SUPABASE_URL=your_supabase_project_url
    SUPABASE_KEY=your_supabase_anon_key
    
    # Site Configuration
    NUXT_SITE_URL=http://localhost:3000

    How to get Supabase credentials:

    1. Go to Supabase and create a new project
    2. Navigate to Settings β†’ API in your Supabase dashboard
    3. Copy the "Project URL" and "anon/public" key
    4. Replace your_supabase_project_url and your_supabase_anon_key with your actual values

    Important Notes:

    • The OAuth providers (Google and GitHub) are configured directly in your Supabase dashboard
    • No additional environment variables are needed for OAuth as Supabase handles the configuration
    • Make sure you've completed the OAuth setup steps above before testing social login

    For production:

    # Production environment variables
    SUPABASE_URL=https://your-project.supabase.co
    SUPABASE_KEY=your_supabase_anon_key
    NUXT_SITE_URL=https://yourdomain.com

Development

Start the development server:

npm run dev
# or
yarn dev

The application will be available at http://localhost:3000.

Build

To build the project for production:

npm run build
# or
yarn build

Deployment

After building the project, you can deploy the dist directory to your preferred hosting service.

πŸ”§ Troubleshooting

Common OAuth Issues

Google OAuth Not Working

  • Ensure you've enabled the Google+ API in Google Cloud Console
  • Verify the redirect URI matches exactly: https://your-project.supabase.co/auth/v1/callback
  • Check that your Client ID and Secret are correctly configured in Supabase
  • Make sure your Google Cloud project has billing enabled (required for OAuth)

GitHub OAuth Not Working

  • Verify the Authorization callback URL is set correctly in GitHub OAuth App settings
  • Ensure the Client ID and Secret are properly configured in Supabase
  • Check that your GitHub OAuth App is not in development mode (if you want to test with non-owner accounts)

Supabase Configuration Issues

  • Double-check your SUPABASE_URL and SUPABASE_KEY in the .env file
  • Ensure your Supabase project is active and not paused
  • Verify that Authentication is enabled in your Supabase project settings

Getting Help

If you encounter issues:

  1. Check the Supabase Documentation
  2. Review the Nuxt 3 Documentation
  3. Check the Nuxt UI Documentation
  4. Open an issue in this repository with detailed error information

πŸ“š Usage

State Management

This project uses Pinia for state management. Example store:

export const useAuthStore = defineStore("useAuthStore", {
  state: () => ({
    name: "",
    email: "",
    password: "",
    confirm_password: "",
  }),
  actions: {
    resetState() {
      // Reset state logic
    },
  },
});

Components

  • Auth Components: Complete authentication flow
  • Dashboard Components: Admin panel and navigation
  • Landing Components: Marketing and entry pages
  • App Components: General application components

Pages

  • index.vue: Main landing page
  • auth/: Authentication pages (sign-in, sign-up, etc.)
  • app/: Protected application pages

Layouts

  • default.vue: Default application layout
  • auth.vue: Authentication layout
  • dashboard.vue: Dashboard layout with sidebar

πŸ”’ Security Features

  • Route Protection: Middleware-based authentication
  • Input Validation: Form validation and sanitization
  • Session Management: Secure session handling
  • Environment Variables: Secure configuration management

🎨 Design System

  • Color Schemes: Dark and light mode support
  • Typography: Consistent text hierarchy
  • Spacing: Systematic spacing system
  • Components: Reusable UI components

πŸ† Conclusion

Pausa is an excellent starter template that demonstrates best practices in Nuxt 3 development. It offers a complete, modern, and well-structured authentication solution that can serve as a solid foundation for any application requiring user management.

The project follows Nuxt 3 conventions, uses TypeScript correctly, and provides a smooth development experience with all the modern tools needed to build scalable web applications.

🀝 Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes.

πŸ“„ License

This project is licensed under the MIT License.

About

Minimal authentication solution for Nuxt projects with Supabase - ready to integrate in seconds

Topics

Resources

Stars

Watchers

Forks