Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📦 chore(turso): add current-visitors module for tracking and managing… #737

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Commits on Dec 13, 2023

  1. 📦 chore(turso): add current-visitors module for tracking and managing…

    … current visitors
    
    📦 chore(turso): add session-management module for creating and updating user sessions
    📦 chore(turso): add queries-for-stuff.sql file for storing SQL queries related to various stuff
    📦 chore(turso): update schema.sql to include new tables for user sessions and current visitors
    spences10 committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    ca6d816 View commit details
    Browse the repository at this point in the history
  2. 🚀 feat(session-end): add server route to handle session end request

    This commit adds a new server route to handle the POST request for ending a session. The route receives the session ID from the request body and updates the `user_session` table in the database to mark the session as ended. It also calculates the session duration based on the session start time.
    
    🚀 feat(setup-send-beacon.js): add script to send session data on page unload
    
    This commit adds a new JavaScript file `setup-send-beacon.js` that sets up a `beforeunload` event listener. When the page is about to be unloaded, it retrieves the session data from a cookie, sends it to the `/session-end` endpoint using the `navigator.sendBeacon()` method, and deletes the session cookie. This ensures that the session data is sent to the server even if the user closes the page or navigates away.
    spences10 committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    708942e View commit details
    Browse the repository at this point in the history
  3. 🐛 fix(app.d.ts): add Locals interface with user_ip property to store …

    …user IP address
    
    ✨ feat(app.html): add setup-send-beacon.js script to enable sending beacon requests for analytics
    🐛 fix(hooks.server.ts): add user_session handle to handle user session data, including creating or updating session, tracking current visitors, and setting session cookie
    spences10 committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    31f3501 View commit details
    Browse the repository at this point in the history

Commits on Dec 16, 2023

  1. Configuration menu
    Copy the full SHA
    49d7c3b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a9f4b0a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f0ed71d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    04106d4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c36fcf2 View commit details
    Browse the repository at this point in the history

Commits on Dec 22, 2023

  1. Configuration menu
    Copy the full SHA
    2f88892 View commit details
    Browse the repository at this point in the history