Uncategorized

docker – Integrating Nuxt.js for SSR in a Dockerized Stack with Python FastAPI, Elasticsearch, MongoDB, and Vue.js



I’m currently using a Docker Compose stack that includes:

  • Traefik for SSL and proxying (all to the FastAPI).
  • Python FastAPI for backend API and serving static files.
  • Elasticsearch for search functionality.
  • MongoDB for data storage.
  • Vue.js, Tailwind Daisy UI for building a SPA frontend.

The routing setup (all handled by Python FastAPI) is:

  • /api/<version>/<endpoint>: Dynamic API handled by the Python backend.
  • /api/v1/media/<id>: Fetches images and videos from MongoDB FS using FastAPI.
  • /assets/...: Static assets built using Vite and served by the Python backend.
  • Other URLs: Default to sending index HTML, where the client fetches content by calling the API— displaying a 404 error if not found.

In the current setup, I have tried the following:

  • I’ve experimented with managing metadata in the SPA with JavaScript, which didn’t yield the desired SEO results due to crawler limitations.
  • I’m exploring the integration of Nuxt.js, but am unsure how to do this efficiently in my existing stack.
  • I expected that adding Nuxt.js would enhance my SEO without necessitating a major overhaul of my backend.

So, I want to integrate Nuxt.js for server-side rendering to improve SEO. However, I’d like to retain my existing APIs and am hesitant to shift entirely to a JavaScript-based backend due to my limited experience with JS and personal concern with its reliability and future-proof. So, I would like to know:

  1. How can I integrate Nuxt.js for SSR in my existing setup in a manner that’s efficient and server-friendly?

  2. Would rewriting my APIs in JavaScript offer significant benefits for this integration, especially considering development and deployment aspects?

  3. How can I effectively manage metadata for SEO in this JavaScript-heavy environment?


Additional context:

  • My setup is fully containerized with Docker Compose for CI/CD.
  • I’m proficient in Python but less so in JavaScript.
  • Server performance and load are important considerations.
  • This is small personal project in the early alpha release stage.
    • Around 700 lines of Python backend code.
    • Around 1500 lines of VUE frontend code.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *