Skip to content

vnali/starter-nuxt-counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Craft CMS + Nuxt + Counter plugin Starter

  • This repository adds a counter plugin to track site and page visits in the Craft CMS + Nuxt Starter.

  • Please note that this repository is provided as a sample and should not be used in production environments.

  • For more information please visit Craft CMS + Nuxt Starter.

Quick Start

This project assumes you have our recommended development environment DDEV installed and up-to-date.

  1. Clone this repository, and move into the new directory:

    git clone https://github.com/vnali/starter-nuxt-counter.git
    # ...
    cd starter-nuxt-counter
  2. (Optional) Adjust the DDEV project name and domains. See this section for more information.

  3. Set up your Craft CMS backend:

    ddev composer install
    ddev craft install

    Write down the username and password you choose, during installation. You’ll need it to log in to the control panel.

  4. Generate a token for the Guestbook GraphQL Schema:

    # Display a list of schemas and UUIDs:
    ddev craft graphql/list-schemas
    
    # Use the “Guestbook” schema ID to generate a token:
    ddev craft graphql/create-token c7d2eb61-cdde-4a76-88a9-eb30ddcf155b
  5. Configure your frontend environment:

    • Copy frontend/.env.example to frontend/.env;
    • Update GRAPHQL_TOKEN to the token generated in the previous step;
    • Update COUNTER_SECRET_TOKEN to a complex token.
    • Update headlessToken in backend/config/counter.php to the value of COUNTER_SECRET_TOKEN in the previous step.
  6. Install front-end dependencies:

    ddev fe npm install
  7. Start the Nuxt development server:

    ddev fe npm run dev
  8. Visit https://api.starter-nuxt-counter.ddev.site/admin and install the counter plugin.

  9. Go to plugin settings and enable counter for your site at Site settings.

  10. Optionally add widgets like visits, ... to the user dashboard

  11. Visit frontend: https://starter-nuxt-counter.ddev.site/

    • There is a statistics block in the footer of every page that shows the site and page visits for today.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published