How can I host multiple sites from one repository?

Hello, I’m trying to host my portfolio on Netlify, but I’m not sure what’s the best way to host project sites which I want to include inside said portfolio.

I’d like my portfolio to have links which redirect to each site; should I host each site from individual GitHub repositories or is there a way to include everything inside one? Additionally some of those projects were build using React. From what I’ve gathered, I should include “create-react-app” inside build settings in this case.

Lastly, I’m curious if Netlify somehow “stores” data provided by user to a certain site? For example, if I’d like to add something to a list, will it save or will it disappear after refreshing the site?

You could do either of these, it’d come down to personal preference.

If they were different repos then you would connect each site instance to its repo.

If it was a single repo you would connect all site instances to the same repo and set the Base directory in the Build Settings differently for each (Build configuration overview | Netlify Docs).

This isn’t something that would occur “out of the box”, you’d have to engineer a solution, e.g. creating your own API with functions and saving to a database.

Alternatively this recent blog article may be relevant:

Thank you for your answer Nathan, just to make sure, should I understand “site instances” as individual sites (with different domains) or is there a way to make them use one domain that modifies when I change site; something like www.my-domain.com/site1 (sorry for not using proper terminology).

@JackRedgrave I mean separately configured sites in Netlify, for example via “Add new site”.

I’d presumed that you did want them hosted on different domains or subdomains, but if your aim is to have them represent as subfolders then you can look into “Proxying” as per this support guide: