-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Welcome to the comprehensive documentation for the Tracking application - a modern web application built for learning management, training tracking, and team coordination.
This application serves as a replacement for traditional spreadsheet-based tracking systems, providing:
- Learning Management System: Track training progress and completion
- Time Tracking: Monitor time spent in training and activities
- Training Area Management: Organize and track different areas of expertise
- User Management: Comprehensive role-based access control
- Battery Tracking: Monitor robot battery status and usage
- React 19 - Modern React with latest features
- React Router 7 - Full-stack React framework with SSR
- Tailwind CSS 4 - Utility-first CSS framework
- TypeScript - Type-safe development
- Express.js - Node.js web framework
- Better Auth - Modern authentication system
- Drizzle ORM - Type-safe database toolkit
- PostgreSQL - Robust relational database
- ESLint + TypeScript ESLint - Code linting and quality
- Prettier - Code formatting
- Husky + lint-staged - Git hooks for quality gates
- Docker - Containerized development and deployment
Complete guide to the authentication implementation including:
- Email/password authentication with Better Auth
- Session management and security
- Database integration with user storage
- TypeScript integration and type safety
- API endpoints and middleware setup
Comprehensive role-based access control system:
- Default Roles: ADMIN, MENTOR, STUDENT_ADMIN, STUDENT, PARENT, GUEST
- Permission Categories: User management, content control, progress tracking
- User Management Interface: Edit users, assign roles, manage permissions
- Permission Checking: Utilities for route protection and UI control
- Database Schema: Detailed table structure and relationships
βοΈ React Router Setup
Modern full-stack React application setup:
- Server-side rendering (SSR) capabilities
- Hot Module Replacement for development
- Asset bundling and optimization
- Data loading and mutation patterns
- Type-safe routing with TypeScript
Development standards and tooling:
- ESLint configuration for TypeScript and React
- Automated code fixing and quality checks
- Pre-commit hooks with Husky and lint-staged
- Consistent code formatting with Prettier
- Best practices and development workflows
- Node.js 18+
- Docker and Docker Compose
- PostgreSQL (or use Docker setup)
-
Clone the repository
git clone <repository-url> cd tracking
-
Install dependencies
npm install
-
Environment setup
cp .env.example .env # Edit .env with your database URL and other settings -
Database setup
# Start PostgreSQL with Docker docker-compose up -d postgres # Run migrations npm run db:migrate # Seed roles and permissions npm run db:seed
-
Start development server
npm run dev
-
Visit the application Open http://localhost:3000
The application uses PostgreSQL with the following key tables:
-
user- User accounts and profile information -
session- Authentication sessions -
role- System roles (ADMIN, MENTOR, etc.) -
permission- Granular permissions -
user_role- User role assignments -
user_permission- Direct user permissions
- Authentication: Secure email/password authentication with Better Auth
- Authorization: Role-based access control with granular permissions
- Session Management: Secure session handling with automatic refresh
- Route Protection: Server-side route protection with permission checks
- CSRF Protection: Built-in CSRF protection with Better Auth
- Type Safety: Full TypeScript coverage for security-critical code
# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
# Database
npm run db:generate # Generate new migrations
npm run db:migrate # Run database migrations
npm run db:seed # Seed roles and permissions
# Code Quality
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint issues
npm run format # Format code with Prettier
npm run typecheck # Run TypeScript checkingtracking/
βββ app/ # React Router application
β βββ components/ # Reusable UI components
β βββ lib/ # Utility functions and helpers
β βββ routes/ # Application routes
β βββ welcome/ # Welcome page components
βββ database/ # Database schema and utilities
β βββ schema.ts # Drizzle schema definitions
β βββ context.ts # Database context management
β βββ seed.ts # Data seeding utilities
βββ docs/ # Documentation files
βββ drizzle/ # Generated migrations
βββ public/ # Static assets
βββ scripts/ # Utility scripts
βββ server/ # Express server setup
- Follow the established code style (ESLint + Prettier)
- Write TypeScript with proper types
- Add tests for new features
- Update documentation for changes
- Use conventional commit messages
- React Router Documentation
- Better Auth Documentation
- Drizzle ORM Documentation
- Tailwind CSS Documentation
- TypeScript Documentation
For questions, issues, or contributions:
- Check existing documentation in this wiki
- Review the codebase for examples
- Create issues for bugs or feature requests
- Submit pull requests for improvements
This documentation is automatically updated from the main branch. Last updated: 7/30/2025