# ADMIN_IMPLEMENTATION.md

Summarizes the implementation of the admin panel and related backend/frontend changes for the NocoDB Map Viewer.

# Instuctions.md

Project development instructions and rules for contributors to the canvassing map application.

# README.md

Main documentation for the NocoDB Map Viewer project, including features, setup, and usage.

# build-nocodb.md

Documents the development and requirements of the NocoDB automation script for table setup.

# build-nocodb.sh

Bash script to automate creation of required NocoDB tables and default data for the app.

# docker-compose.yml

Docker Compose file to orchestrate the map-viewer app container and its environment.

# app/Dockerfile

Dockerfile for building the Node.js application image for deployment.

# app/config/index.js

Handles environment config and NocoDB URL parsing for the backend.

# app/controllers/authController.js

Controller for user authentication (login, logout, session check).

# app/controllers/locationsController.js

Controller for CRUD operations on map locations.

# app/controllers/settingsController.js

Controller for application settings, start location, and walk sheet config.

# app/controllers/shiftsController.js

Controller for volunteer shift management (public and admin). When users sign up for shifts, the signup record includes the shift title for better tracking and display. Fixed variable scope issue in signup method to prevent "allSignups is not defined" error.

# app/controllers/usersController.js

Controller for user management (list, create, delete users).

# app/middleware/auth.js

Express middleware for authentication and admin access control.

# app/middleware/rateLimiter.js

Express middleware for API rate limiting, with Cloudflare IP support.

# app/package.json

Node.js project manifest, dependencies, and scripts for the backend app.

# app/server.js

Main Express server entry point for the map application backend.

# app/server copy.js

Legacy or backup version of the main server file, possibly for reference or migration.

# app/services/geocoding.js

Service for geocoding and reverse geocoding using external APIs, with caching.

# app/services/nocodb.js

Service for interacting with the NocoDB API (CRUD, config, etc).

# app/services/qrcode.js

Service for generating QR codes and handling QR-related logic.

# app/utils/helpers.js

Utility functions for geographic data, validation, and helpers used across the backend.

# app/utils/logger.js

Winston logger configuration for backend logging.

# app/public/admin.html

Admin panel HTML page for managing start location, walk sheet, shift management, and user management.

# app/public/css/admin.css

CSS styles specific to the admin panel UI.

# app/public/css/shifts.css

CSS styles for the volunteer shifts page, including grid view, calendar view, and view toggle functionality.

# app/public/css/style.css

The style.css file is the base .css file for the application. It is referenced in many of the .html files.

# app/public/favicon.ico

Favicon for the web application.

# app/public/index.html

Main map viewer HTML page for the canvassing application. Features "Confirm Address" functionality that requires users to confirm the geocoded address before saving location data.

# app/public/login.html

Login page HTML for user authentication.

# app/public/shifts.html

Volunteer shifts management and signup page HTML with both grid and calendar view options.

# app/public/user.html

User profile page HTML for displaying user information and account management.

# app/public/css/user.css

CSS styles for the user profile page and user management components in the admin panel.

# app/public/js/admin.js

JavaScript for admin panel functionality (map, start location, walk sheet, shift management, and user management).

# app/public/js/user.js

JavaScript for user profile page functionality and user account management.

# app/public/js/auth.js

JavaScript for authentication logic and user session management.

# app/public/js/config.js

Global configuration constants for the frontend app.

# app/public/js/location-manager.js

JavaScript for loading, displaying, and managing map locations on the frontend. Includes address confirmation validation that prevents saving locations until the geocoded address is confirmed by the user.

# app/public/js/main.js

Main entry point for initializing the frontend application.

# app/public/js/map-manager.js

JavaScript for initializing and managing the Leaflet map instance.

# app/public/js/map.js.backup

Backup or legacy version of the main map JavaScript logic.

# app/public/js/shifts.js

JavaScript for volunteer shift signup, management, and UI logic with both grid and calendar view functionality. Features include view toggling, calendar navigation, shift color-coding, and interactive shift popups. Updated to use shift titles directly from signup records.

# app/public/js/ui-controls.js

JavaScript for UI controls, event handlers, and user interaction logic. Includes address confirmation functionality that manages state for ensuring users confirm geocoded addresses before saving locations.

# app/public/js/utils.js

Utility functions for the frontend (escaping HTML, parsing geolocation, etc).

# app/routes/admin.js

Express router for admin-only endpoints (start location, walk sheet config).

# app/routes/auth.js

Express router for authentication endpoints (login, logout, check).

# app/routes/debug.js

Express router for debug endpoints (session info, table structure, etc).

# app/routes/geocoding.js

Express router for geocoding and reverse geocoding endpoints.

# app/routes/index.js

Main router that mounts all sub-routes for the backend API.

# app/routes/locations.js

Express router for CRUD endpoints on map locations.

# app/routes/qr.js

Express router for QR code generation endpoints.

# app/routes/settings.js

Express router for application settings endpoints (start location, walk sheet).

# app/routes/shifts.js

Express router for volunteer shift management endpoints (public and admin).

# app/routes/users.js

Express router for user management endpoints (list, create, delete users).

