Skip to content

Zakir176/BAS-Web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1,023 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Barcode Attendance System (BAS)

Vue.js Vite Supabase Playwright Vitest License

A modern, reliable, and easy-to-use barcode-based attendance system designed for universities. This project is the frontend implementation, built with Vue.js and designed to provide a clean, professional, and user-friendly interface for both students and lecturers.

🎨 Design & Interface

The UI is designed to be modern, clean, and academic-friendly. It features a dual-theme system, allowing users to switch between a light and a dark mode for optimal viewing comfort. The interface is fully responsive and built with a focus on clear visual hierarchy and high readability.

Light Mode

Home Student Login Lecturer Login
Home Page Student Login Lecturer Login
Student Homepage Report Page
Student Homepage Report Page

Dark Mode

Home Student Login Lecturer Login
Home Page Student Login Lecturer Login
Student Homepage Report Page
Student Homepage Report Page

✨ Features

  • Dual-Theme UI: Seamlessly switch between Light and Dark modes.
  • Distinct User Portals: Separate login and dashboard experiences for Students and Lecturers.
  • Lecturer Dashboard: A comprehensive view for lecturers to manage their courses, view student information, and track attendance in real-time.
    • Course and Session Management: Create, update, and manage courses and attendance sessions.
    • Barcode Scanning: Utilize the device's camera to scan student ID barcodes for quick and efficient attendance marking.
    • Real-time Roster: View a live roster of students for each session, with instant updates as attendance is taken.
    • Manual Attendance: Manually mark students as present or absent.
    • Reporting: Generate and export attendance reports in Excel format.
  • Student Dashboard: A personalized dashboard for students to monitor their attendance and academic standing.
    • Attendance Tracking: View overall attendance statistics and a detailed history of attended and missed sessions.
    • Attendance Heatmap: Visualize attendance patterns throughout the semester with an intuitive heatmap.
    • Recent Activity: See a timeline of recent attendance activity.
  • Authentication: Secure authentication for both lecturers and students using Supabase Auth.
  • Modern Tech Stack: Built with Vue.js 3, Vite, and modern CSS for a fast and reliable experience.

πŸ›  Tech Stack

πŸš€ Getting Started

To get the frontend running locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/Zakir176/BAS-Web.git
    cd BAS-Web
  2. Navigate to the project directory: The Vue.js project is located in the BAS sub-directory.

    cd BAS
  3. Install dependencies:

    npm install

    Node version: Requires Node ^20.19.0 or >=22.12.0.

  4. Set up environment variables: Create a .env file in the BAS directory by copying the example file. Then, fill in the required Supabase URL and anonymous key.

    # macOS / Linux
    cp .env.example .env
    
    # Windows (Command Prompt)
    copy .env.example .env
    
    # Windows (PowerShell)
    Copy-Item .env.example .env

    Open .env and set:

    VITE_SUPABASE_URL=your_supabase_project_url
    VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
  5. Run the development server:

    npm run dev

The application will be available at the local address provided by Vite (e.g., http://localhost:5173).

πŸ§ͺ Testing

This project uses Vitest for unit/component tests and Playwright for end-to-end (E2E) integration tests.

Unit Tests (Vitest)

# Run tests in watch mode
npm run test

# Run tests once (CI mode)
npm run test:run

# Run with interactive UI
npm run test:ui

# Run with coverage report
npm run test:coverage

Unit test files are co-located in BAS/src/test/.

E2E Tests (Playwright)

# Install Playwright browsers (first time only)
npx playwright install

# Run all E2E tests
npx playwright test

# Run a specific test file
npx playwright test tests/auth-redirect-integration.spec.ts

E2E test files are located in BAS/tests/. Key test suites include:

  • auth-redirect-integration.spec.ts β€” Auth flow and route guard integration
  • improved-student-auth.spec.ts / improved-lecturer-auth.spec.ts β€” Login/logout flows
  • barcode-scanning.spec.ts β€” Scanner functionality

Note: E2E tests require a running dev server and valid Supabase credentials in .env. See tests/global-setup.ts for setup details.

πŸ“„ Project Structure

BAS-Web/
β”œβ”€β”€ BAS/                        # Vue.js application root
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ assets/             # Global styles and static assets
β”‚   β”‚   β”œβ”€β”€ components/         # Reusable Vue components
β”‚   β”‚   β”œβ”€β”€ core/               # Core abstractions
β”‚   β”‚   β”‚   β”œβ”€β”€ api/            # Supabase API wrappers
β”‚   β”‚   β”‚   └── ui/             # Core UI primitives
β”‚   β”‚   β”œβ”€β”€ features/           # Feature-based modules
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/           # Authentication views & logic
β”‚   β”‚   β”‚   β”œβ”€β”€ home/           # Landing/home page
β”‚   β”‚   β”‚   β”œβ”€β”€ lecturer/       # Lecturer dashboard & components
β”‚   β”‚   β”‚   β”œβ”€β”€ scanner/        # Barcode scanner feature
β”‚   β”‚   β”‚   β”œβ”€β”€ student/        # Student dashboard & components
β”‚   β”‚   β”‚   └── legal/          # Terms, privacy, etc.
β”‚   β”‚   β”œβ”€β”€ router/             # Vue Router config & navigation guards
β”‚   β”‚   β”œβ”€β”€ services/           # Business logic / service layer
β”‚   β”‚   β”œβ”€β”€ shared/             # Shared utilities and composables
β”‚   β”‚   β”œβ”€β”€ stores/             # Pinia state stores
β”‚   β”‚   β”œβ”€β”€ views/              # Page-level route components
β”‚   β”‚   └── main.js             # App entry point
β”‚   └── tests/                  # Playwright E2E test suite
β”‚       β”œβ”€β”€ utils/              # Shared test helpers
β”‚       β”œβ”€β”€ global-setup.ts     # Test environment setup
β”‚       └── global-teardown.ts  # Test environment teardown
└── docs/                       # Project documentation & UI screenshots
    β”œβ”€β”€ ui/                     # UI screenshots (light & dark mode)
    β”œβ”€β”€ api.md                  # API reference
    β”œβ”€β”€ components.md           # Component documentation
    β”œβ”€β”€ DEPLOYMENT.md           # Deployment guide
    └── TROUBLESHOOTING.md      # Common issues & FAQ

πŸ“š Documentation

Document Description
API Reference Supabase API wrappers and data layer
Component Docs Reusable component reference
Deployment Guide How to deploy to production
Troubleshooting Guide Common fixes for scanner and connection issues

πŸ“„ License

This project is licensed under the MIT License.

About

barcode attendance system for recording attendeance seamlessly

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors