Which create-react-app files should I add in my github repo? - reactjs

So I have a react practice project that I want to add in my github repo. I used create-react-app and there are many folders. I tried adding the whole project folder but it says the size is too big. Which folders should I put there? Also I want to be able to deploy it with netlify.

Related

create-react-app without removing existing files

i have an existing project folder that contains project assets, some text files, &c. and we're having to use React on this one. when i run create-react-app . or npx create-react-app <folder>, it errors out saying i have to remove existing files because 'they might conflict'. SMH. how do i override this behaviour and force it to deploy? because i'm not doing this for every project we do...
and, no, this post has nothing useful to offer.

pushing whole react folder to github

Im new with git stuff. I wanted to push my react project made with "create-react-app" into github and make it work with github pages. So i followed some tutorial and it basically worked so i could preview it on a github page. But now i want to push whole folder of my react project instead of only files. To make it working i deleted .git folder inside my app folder and initialized one outside. I ended up pushing it to my github repo but i cannot live preview my site for some reason.
https://github.com/Adrian397/react_projects - here is how it looks like (there is main folder in master branch)
This is how my package.json looks like.
I dont know if the "homepage" is written properly but i tried to change it to "homepage": "http://Adrian397.github.io/react_projects/expenses" (react_projects is my whole repo and expenses is my folder that i pushed into github) but still did not work.
Is there any other way to do it because it is kinda weird if i had to create a new repository for every react project instead of having them separeted in one global repository?

Adding React app to existing folder on GitHub

I have a group of projects that I've been compiling on Github as part of the Frontend Mentor challenges - https://github.com/MikeBish13/frontend-mentor-challenges
These are all stored in the same folder locally on my PC and every time I add a folder, VS Code recognises this and queues that folder up to be committed and then pushed to the Github folder.
I've just created a new React App via create-react-app and have added that to my folder locally on my PC and I now want to add it to the folder on Github, but VS Code is not recognising it as a new folder and won't let me commit, and then push changes.
Does anybody know how I could do this? Are there settings I need to change in the React project?
I've run npm build on my React project, if that makes any difference, but I've not changed or added anything new other than the initial create react app.
It's probably a simple answer but I'm a novice when it comes to React/Github.
UPDATE:
Here is a screenshot of my folder structure

how to update a custom GitHub Pages with create-react-app as root

Hello I have read many docs online on connecting gh-pages with create-react-app. But most guides either assume that one does not already have a github pages set up, and that the react app is to be hosted as a directory (ie. username.github.io/react-app) instead of the homepage/root (username.github.io). I am hoping someone can help me out:
I have an existing repo for a github pages custom domain. It is currently hosting an older site I built with gulp and static html/css/js, and a CNAME file for custom url.
I built a new website redesign with create-react-app in a separate repo (It uses react-router for multiple pages).
I want to overwrite the contents of my old github pages site with my new create-react-app website as the root homepage.
Is this possible? If so, what is the best way to achieve this? Thanks
In the existing Github Pages app, remove the CNAME and/or delete master branch. Deleting master branch will remove the site, while deleting CNAME will clear up the custom domain back to default [username].github.io.
In create-react-app, add CNAME to /public folder.
In create-react-app, add line "homepage":"./" to package.json.
In create-react-app, run npm run build then run gh-pages -d build build process, then run npm run deploy

What folders can be deleted from create-react-app?

I want to put my first react app on my website but the file size is 122MB. What folders can be deleted from node_modules?
Run npm run build and deploy folders build and public only. Those contain all you need for production.

Resources