开源项目教程:avneesh0612/portfolio
portfolio This is my portfolio which is also a template. Feel free to fork, star, and use it. 项目地址:https://gitcode.com/gh_mirrors/portfolio16/portfolio
1. 项目的目录结构及介绍
/portfolio
├── public
│ ├── favicon.ico
│ └── index.html
├── src
│ ├── assets
│ │ ├── images
│ │ └── styles
│ ├── components
│ │ ├── Header.js
│ │ ├── Footer.js
│ │ └── ProjectCard.js
│ ├── pages
│ │ ├── Home.js
│ │ ├── About.js
│ │ └── Contact.js
│ ├── App.js
│ ├── index.js
│ └── App.css
├── .gitignore
├── package.json
└── README.md
目录结构介绍
public : 包含公共资源文件,如 favicon.ico
和 index.html
。src : 源代码目录。
assets : 包含项目所需的静态资源,如图片和样式文件。components : 包含项目的React组件,如 Header.js
, Footer.js
, 和 ProjectCard.js
。pages : 包含项目的页面组件,如 Home.js
, About.js
, 和 Contact.js
。App.js : 主应用组件。index.js : 入口文件。App.css : 主样式文件。 .gitignore : Git忽略文件配置。package.json : 项目依赖和脚本配置。README.md : 项目说明文档。
2. 项目的启动文件介绍
index.js
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
reportWebVitals();
ReactDOM.render : 将 App
组件渲染到 root
DOM节点。reportWebVitals : 用于性能监控。
3. 项目的配置文件介绍
package.json
{
"name": "portfolio",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
dependencies : 项目依赖包。scripts : 项目脚本,如 start
, build
, test
, 和 eject
。eslintConfig : ESLint配置。browserslist : 目标浏览器配置。
portfolio This is my portfolio which is also a template. Feel free to fork, star, and use it. 项目地址:https://gitcode.com/gh_mirrors/portfolio16/portfolio