Spaces:
Sleeping
Sleeping
Jimin Huang commited on
Commit ·
db45c7f
1
Parent(s): 342fb1a
feat: add interface
Browse filesFiles changed (15)
- README.md+12-77
- index.htmlAdded+13
- package.json+16-32
- src/App.cssDeleted-38
- src/App.jsDeleted-25
- src/App.test.jsDeleted-8
- src/index.cssDeleted-13
- src/index.jsDeleted-17
- src/index.tsxAdded
- src/logo.svgDeleted
- src/main.tsxAdded+9
- src/reportWebVitals.jsDeleted-13
- src/setupTests.jsDeleted-5
- tsconfig.jsonAdded+12
- vite.config.tsAdded+8
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081---title: LetYourProfitsRunemoji: 🐠colorFrom: indigocolorTo: redsdk: staticpinned: falseapp_build_command: npm run buildapp_file: build/index.html---# Getting Started with Create React AppThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).## Available ScriptsIn the project directory, you can run:### `npm start`Runs the app in the development mode.\Open [http://localhost:3000](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](https://facebook.github.io/create-react-app/docs/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](https://facebook.github.io/create-react-app/docs/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 MoreYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).To learn React, check out the [React documentation](https://reactjs.org/).### Code SplittingThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)### Analyzing the Bundle SizeThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)### Making a Progressive Web AppThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)### Advanced ConfigurationThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)### DeploymentThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)### `npm run build` fails to minifyThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)12345678910111213141516# Asset Choice Simulation (React + Vite)Interactive simulation where users pick daily assets and evaluate portfolio performance.## Run locally```bashnpm installnpm run dev```## Build```bashnpm run build```Deploy to [Hugging Face Spaces](https://huggingface.co/spaces) as a Static Space.
12345678910111213<!doctype html><html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>Asset Choice Simulation</title> <script src="https://cdn.tailwindcss.com"></script> </head> <body class="bg-gray-50"> <div id="root"></div> <script type="module" src="/src/main.tsx"></script> </body></html>123456789101112131415161718192021222324252627282930313233343536373839{"name": "react-template","version": "0.1.0","private": true,"dependencies": {"@testing-library/dom": "^10.4.0","@testing-library/jest-dom": "^6.6.3","@testing-library/react": "^16.3.0","@testing-library/user-event": "^13.5.0","react": "^19.1.0","react-dom": "^19.1.0","react-scripts": "5.0.1","web-vitals": "^2.1.4"},"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"]}}1234567891011121314151617181920212223{"name": "asset-choice-space","private": true,"version": "0.0.1","type": "module","scripts": {"dev": "vite","build": "vite build","preview": "vite preview --port 7860 --strictPort"},"dependencies": {"react": "^18.3.1","react-dom": "^18.3.1","recharts": "^2.12.7"},"devDependencies": {"typescript": "^5.4.0","vite": "^5.2.0","@vitejs/plugin-react": "^4.2.0","@types/react": "^18.2.0","@types/react-dom": "^18.2.0"}}
1234567891011121314151617181920212223242526272829303132333435363738.App { text-align: center;}
.App-logo { height: 40vmin; pointer-events: none;}
@media (prefers-reduced-motion: no-preference) { .App-logo { animation: App-logo-spin infinite 20s linear; }}
.App-header { background-color: #282c34; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: calc(10px + 2vmin); color: white;}
.App-link { color: #61dafb;}
@keyframes App-logo-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); }}12345678910111213141516171819202122232425import logo from './logo.svg';import './App.css';
function App() { return ( <div className="App"> <header className="App-header"> <img src={logo} className="App-logo" alt="logo" /> <p> Edit <code>src/App.js</code> and save to reload. </p> <a className="App-link" href="https://reactjs.org" target="_blank" rel="noopener noreferrer" > Learn React </a> </header> </div> );}
export default App;12345678import { render, screen } from '@testing-library/react';import App from './App';
test('renders learn react link', () => { render(<App />); const linkElement = screen.getByText(/learn react/i); expect(linkElement).toBeInTheDocument();});12345678910111213body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;}
code { font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;}1234567891011121314151617import React from 'react';import ReactDOM from 'react-dom/client';import './index.css';import App from './App';import reportWebVitals from './reportWebVitals';
const root = ReactDOM.createRoot(document.getElementById('root'));root.render( <React.StrictMode> <App /> </React.StrictMode>);
// If you want to start measuring performance in your app, pass a function// to log results (for example: reportWebVitals(console.log))// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitalsreportWebVitals();123456789import React from "react";import { createRoot } from "react-dom/client";import App from "./index";
createRoot(document.getElementById("root")!).render( <React.StrictMode> <App /> </React.StrictMode>);12345678910111213const reportWebVitals = onPerfEntry => { if (onPerfEntry && onPerfEntry instanceof Function) { import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { getCLS(onPerfEntry); getFID(onPerfEntry); getFCP(onPerfEntry); getLCP(onPerfEntry); getTTFB(onPerfEntry); }); }};
export default reportWebVitals;12345// jest-dom adds custom jest matchers for asserting on DOM nodes.// allows you to do things like:// expect(element).toHaveTextContent(/react/i)// learn more: https://github.com/testing-library/jest-domimport '@testing-library/jest-dom';123456789101112{ "compilerOptions": { "target": "ES2020", "lib": ["ES2020", "DOM"], "jsx": "react-jsx", "module": "ESNext", "moduleResolution": "Bundler", "strict": true, "skipLibCheck": true }, "include": ["src"]}12345678import { defineConfig } from "vite";import react from "@vitejs/plugin-react";
export default defineConfig({ plugins: [react()], server: { port: 5173 }, preview: { port: 7860 }});README.md+12-77
index.htmlAdded+13
package.json+16-32
src/App.cssDeleted-38
src/App.jsDeleted-25
src/App.test.jsDeleted-8
src/index.cssDeleted-13
src/index.jsDeleted-17
src/index.tsxAdded
src/logo.svgDeleted
src/main.tsxAdded+9
src/reportWebVitals.jsDeleted-13
src/setupTests.jsDeleted-5
tsconfig.jsonAdded+12
vite.config.tsAdded+8