Skip to content

janeAnezi/G-Blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting Started with Create React App

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.

The page will reload when you make changes.
You may also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

npm run eject

Note: this is a one-way operation. Once you eject, you can't go back!

If you aren't satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

npm run build fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

######################################################

install the extension ES7 React/Redux/GraphQL..... install react-router-dom Path intellisense ....auto imputs path of components install react-icons install react-quill {for text area} install node for the backend create a mongoDB account to save the data in a database postman to test API

##################### npm init -y ( to install the package.json file) ************* (packages for api) npm install express npm install mongoose npm install cors npm install dotenv npm install body-parser npm install jsonwebtoken npm install bcrypt

then we create our express server....(index.js) install install -D nodemon (a development dependency)

####################### In the index page..... React and ReactDOM: These are core libraries for building and rendering the React application. React is used to create components, while ReactDOM is used to render those components into the DOM. RouterProvider and createBrowserRouter: These are utilities from react-router-dom for setting up and managing routes in the application. Component Imports: These are custom components representing different parts of the application, such as Layout, Home, ErrorPage,

for the router configuration createBrowserRouter: This function creates a router using the browser's history API. It manages navigation, matching paths to components. path: '/': This is the root path of the application. When users visit the root URL (/), the component specified by element will be rendered, which in this case is Layout. element: : This specifies that the Layout component will be rendered at the root path. The Layout component likely includes the general structure of your app, such as a header, footer, and a place to display different pages. errorElement: : If an error occurs during routing, the ErrorPage component will be displayed. children: These are nested routes. Each object inside the children array represents a route that is a child of the root path. {index: true, element: }: This specifies that when the user is at the root path (/), the Home component should be rendered. {path: 'post/id', element: }: When the user navigates to /post/id, the PostDetail component will be displayed. :id in path: This is a dynamic segment, meaning id will be replaced by actual values (like /profile/123). This is used in routes like profile/:id and posts/:id/edit to display dynamic content based on the ID provided.

In rendering the application ReactDOM.createRoot(document.getElementById('root')): This initializes the root of your React application, targeting an HTML element with the ID of root. root.render(...): This renders the React application into the DOM. <React.StrictMode>: This is a development tool that helps identify potential problems in your React app. It doesn't affect the production build. : This wraps the entire application with the routing context, passing the router object that was created earlier. It makes sure that the routing logic is available throughout the app.

This code in the index.js file sets up a React application with a routing structure. It defines different paths and the corresponding components to render when those paths are visited. The Layout component is the main structure of the app, and the child routes determine what specific content is shown within that layout. The app uses react-router-dom to handle client-side routing, making it a Single Page Application (SPA).

🔧 Technologies Used: HTML: Structuring the web pages CSS: Styling the application JavaScript: Adding dynamic behavior Node.js: Server-side scripting Express.js: Building the server and handling routes MongoDB: Database management EJS: Templating engine for dynamic content

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors