Skip to content

Route '/docs' returns 404 locally due to unconfigured external content source and lack of documentation in README.md #203

@gitcrusher

Description

@gitcrusher

Description

The local development environment for the website is currently broken "out of the box." When running the website locally, the documentation routes fail to resolve because the content source files which reside in the external gofr-dev/gofr repository are not automatically fetched or documented as prerequisites.

Steps to Reproduce the same issues-

  1. Clone the website repository: git clone https://github.com/gofr-dev/website.git
  2. Install dependencies: npm install
  3. Run the local server: npm run dev
  4. Navigate to the route: http://localhost:3000/docs

Actual Behavior

The application throws a 404 Page Not Found error.

Technical Analysis & Root Cause

The issue is coming from missing dependencies required by the src/app/docs directory structure from gofr-dev/gofr/..../docs

1. Local Entry Points: The website repository contains the scaffolding for the docs in:

  • src/app/docs/layout.jsx
  • src/app/docs/page.jsx

2. Missing External Dependencies: These entry points attempt to render content that is expected to exist locally but is actually hosted in the core gofr repository gofr-dev/gofr/.../docs

  • As there is no script to fetch them, the local environment lacks the following critical files/directories required for the router to function:

    • quick-start/
    • references/
    • navigation.js
    • page.md

3. Result: Since these files are missing from the local file system and there is no fallback logic or documentation in README.md instructing how to link them, the Next.js router cannot resolve the content, resulting in a 404 error.

Suggested Fix

To fix the developer experience (DX), we should either:

  1. Update Documentation: Explicitly list steps in the README.md to clone the gofr docs into the website directory.
  2. Add Automation: Create a script (e.g., `npm run fetch-docs) that pulls the docs folder from the gofr repository into the local website project during setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions