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

[Issue 2498] update frontend readme for current file structure #2247

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,22 @@
│ └── locales # Internationalized content
├── src # Source code
│ ├── components # Reusable UI components
│ ├── pages # Page routes and data fetching
│   │ ├── api # API routes (optional)
│   │ └── _app.tsx # Global entry point
│ ├── app # Page routes and data fetching
│   │ └── api # API routes (optional)
│ └── styles # Sass & design system settings
├── stories # Storybook pages
└── tests
```

## 💻 Development

[Next.js](https://nextjs.org/docs) provides the React framework for building the web application. Pages are defined in the `pages/` directory. Pages are automatically routed based on the file name. For example, `pages/index.tsx` is the home page.

Files in the `pages/api` are treated as [API routes](https://nextjs.org/docs/api-routes/introduction). An example can be accessed at [localhost:3000/api/hello](http://localhost:3000/api/hello) when running locally.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we used to support this at the /api route? Is that no longer a thing or do we need to implement a route.ts file to handle API requests into Next? https://nextjs.org/docs/app/api-reference/file-conventions/route

Based on the discussion about the API today, it seems like would likely want to avoid this and instead direct traffic to the API

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do see a subscribe.ts under pages/api, and it looks like it is called from 'NewsletterForm.tsx', whether or not that means we need a routes.ts, not sure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that's true, but I think we're in the process of deprecating that, so I was thinking we should remove it from the README at this point. Does that sound right @acouch ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we used to support this at the /api route?

Yes, that is how the pages router works. With the move to the app router what you removed doesn't make sense.

[Next.js](https://nextjs.org/docs) provides the React framework for building the web application. Pages are defined in the `app/` directory. Pages are automatically routed based on the file name. For example, `pages/[locale]/page.tsx` is the home page.

[**Learn more about developing Next.js applications** ↗️](https://nextjs.org/docs)

### Getting started

The application can be ran natively or in a Docker container.
The application can be run natively or in a Docker container.

#### Native

Expand Down
Loading