How to store code in a repository has many factors.
- How many people are working on this project?
- Who is responsible for testing (devs only, devs and qa)?
- What testing methods are in use: unit tests, integration tests, UI tests?
- Is there a difference between end-to-end and full stack testing?
Are you the only one working on this project and are responsible for developing and testing it? If so, use whatever strategy that makes sense for you and your own personal workflow.
If you are on team with devs and QA, then a common approach is to keep unit tests with the product source code in the same repository. In your case, front-end unit tests stored with the front-end source code; back-end (API, DB) unit tests stored with the back-end source code. Unit tests are typically in the realm of developer testing.
If you are writing UI end-to-end tests using a tool like Selenium, then it's a good practice to store this in a separate source code repository. This is especially true if you have a separate QA team responsible for writing these tests, which is common. If devs are writing Selenium UI tests and there is no separate QA team, then either the same or separate repositories are fine.
All this to say, it depends on how many people are part of the project and who is responsible for what testing activities. There's not necessarily a "right" answer here, but there are common approaches.
Keep in mind, end-to-end testing typically refers to UI/front-end level tests from a QA perspective. Once you start adding in API or databases tests, I'd refer to this as full stack testing. Of course, this could just be a difference of semantics.