Skip to content

About

En web app for å logge når jeg tar inn/ut skinner

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

SkinneTracker

A Vite + Preact app for tracking orthodontic braces activity (remove/replace events) per user.

Features

  • Firebase email/password login
  • Per-user braces setup (users/{uid}/braces)
  • Event tracking per brace (remove and replace)
  • Edit and delete previously logged events
  • Current brace status based on latest event
  • Dedicated pages for tracking, all events, setup, and stats
  • Responsive Material UI interface with automatic light/dark theme selection

Tech Stack

  • Preact + Vite
  • Material UI (@mui/material, @mui/x-date-pickers)
  • Day.js
  • Firebase Auth + Firestore
  • Firebase Hosting (configured)

Prerequisites

  • Node.js 18+
  • npm
  • A Firebase project with:
    • Email/Password authentication enabled
    • Firestore database enabled

Getting Started

  1. Install dependencies:
npm install
  1. Create a .env.local file in the project root:
VITE_FIREBASE_API_KEY=your_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id
VITE_FIREBASE_MEASUREMENT_ID=your_measurement_id
  1. Start the dev server:
npm run dev
  1. Open the URL shown in the terminal (typically http://localhost:5173).

Available Scripts

  • npm run dev: Start local development server
  • npm run build: Create production build in dist/
  • npm run preview: Preview the production build locally

Firestore Data Model

  • users/{userId}
  • users/{userId}/braces/{braceId}
    • number
    • createdAt
  • users/{userId}/braces/{braceId}/events/{eventId}
    • eventType (remove or replace)
    • eventTime
    • createdAt
    • optional updatedAt

Firebase Rules and Hosting

This repository includes:

  • firestore.rules
  • firestore.indexes.json
  • firebase.json

Deploy rules/indexes and hosting with Firebase CLI:

firebase deploy --only firestore:rules,firestore:indexes
npm run build
firebase deploy --only hosting

.firebaserc currently points to Firebase project skinnetracker.

Project Structure

src/
  components/
  pages/
  service/
  lib/
public/

Notes

  • The app requires authentication before any tracker routes are available.
  • Create braces from the Setup page before tracking events.

About

En web app for å logge når jeg tar inn/ut skinner

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages