Sample Authentication Frontend is a Vue 3 + TypeScript single-page application that demonstrates email/password authentication backed by Firebase. It delivers a localized right-to-left experience, complete with responsive Bootstrap styling, client-side form validation, and toast-based feedback. The project is scaffolded with Vite and organized for rapid iteration while keeping the codebase maintainable as the app grows.
- Framework: Vue 3 with the Composition API and Vite
- Language: TypeScript
- State Management: Pinia
- Routing: Vue Router
- UI & Styling: Bootstrap 4, BootstrapVue Next, custom RTL styles, Font Awesome
- Forms & Validation: Vee Validate + Zod
- Notifications: vue-sonner
- Authentication: Firebase Authentication (email/password)
- Utilities: js-cookie for token persistence
- Email/password registration and sign-in backed by Firebase Authentication
- Schema-driven validation with localized error messaging
- Auto-logout timer with cookie-based token persistence
- Route guards that separate guest and authenticated areas
- Toast notifications for success and error flows
- Responsive, RTL-friendly design with reusable form component
- Node.js 20.19 or 22.12 and above (as defined in
package.jsonengines) - npm v10+
- Clone the repository and install dependencies:
npm install
- Copy the environment template, fill in your Firebase project credentials, and rename it to
.env(or.env.local). - Run the development server:
npm run dev
- Visit
http://localhost:3200to access the app.
Create an .env file in the project root with the following keys:
VITE_FIREBASE_API_KEY="<your-api-key>"
VITE_FIREBASE_AUTH_DOMAIN="<your-auth-domain>"
VITE_FIREBASE_PROJECT_ID="<your-project-id>"
VITE_FIREBASE_STORAGE_BUCKET="<your-storage-bucket>"
VITE_FIREBASE_MESSAGING_SENDER_ID="<your-messaging-sender-id>"
VITE_FIREBASE_APP_ID="<your-app-id>"Firebase will reject requests when these variables are missing or incorrect, so double-check them against your Firebase console.
npm run devThe command starts Vite on port 3200 with hot module replacement.
npm run type-check
npm run lintlint runs both ESLint and Oxlint with auto-fix enabled for supported rules.
npm run buildThe build command performs type checking and outputs static assets to dist/. To preview the production build locally, run npm run preview.
.
├── public/ # Static assets served as-is
├── src/
│ ├── assets/ # Global styles, fonts, and images
│ ├── components/ # Reusable UI components (e.g., AuthForm)
│ ├── firebase/ # Firebase initialization
│ ├── pages/ # Route-level views (Login, Register, Dashboard)
│ ├── router/ # Vue Router configuration and guards
│ ├── schemas/ # Zod schemas and types for forms
│ └── stores/ # Pinia stores (authentication state)
├── eslint.config.ts # ESLint + Oxlint configuration
├── package.json # Scripts and dependencies
└── vite.config.ts # Vite configuration with aliases and dev tools
npm run dev– Start the Vite development server.npm run build– Type-check and build the production bundle.npm run preview– Preview the production build locally.npm run lint– Run ESLint and Oxlint with auto-fix.npm run lint:eslint– Run ESLint only.npm run lint:oxlint– Run Oxlint only.npm run type-check– Executevue-tsc --buildfor strict type checks.npm run format– Format source files with Prettier.
- Amin Heidarzadeh