Work with data/content from entries I'm usually working on Backends with PHP and ZF/Laminas. 

Now I'm building a headless (only Backend) Craft CMS website and have a couple of questions that I didn't find a clear answer on. The Craft CMS project is developed "offline" with Vagrant+Docker and has currently no frontend and won't have it in the near future.


The authors should be able to create an entry (fieldset has only a text) that contains a name. I want to be able to work with the created entry like with a variable/item so I can link other entries and modules to it. Is there a way to do it in the Craft backend itself or in PHP in a controller for example? As I'm working headless, I'm not able to do twig as I don't have the templates or any kind of frontend for now.
The users should be able to upload files and link them to an created item from an author.
What's the best way to fetch these data? I'd like to be able to fetch all (or filter for files or text entries etc.) uploaded files or associated entries to that item.


Is it possible to get the content from specific entries out of my database executing SQL statements in PHP and use the data within a controller?

I'd like to have the newly created entries (by authors) dynamically as items that users can link their uploaded files to. 

I'm very thankful for any kind of help!
In Craft almost everything is an element type (assets, categories, entries, global sets, matrix blocks, tags and users). If something is an element type you can attach arbitrary fields to it. Using fields like the Assets field, Entries field, Categories field or Users field you can define relations (link) between these elements.

For fetching elements via an API there are these options:


the built-in GraphQL API
the Element API plugin
creating a plugin or module and define API endpoints freestyle using the element query builders


Other non-API options for querying elements are:


use element queries in Twig and dump the result
use element queries in PHP and dump the result to the browser
use the REPL via the CLI with ./craft shell