Welcome to the R3F Starter Project! This template is designed to help you kickstart your journey with React Three Fiber (R3F) and create stunning 3D web applications with ease.
- Introduction
- Features
- Getting Started
- Project Structure
- Available Scripts
- Dependencies
- Contributing
- License
This project is a boilerplate for creating 3D web applications using React Three Fiber, a powerful library that brings the power of Three.js to React. Whether you're a seasoned developer or just starting out, this template provides a solid foundation to build upon.
- React Three Fiber: Leverage the power of Three.js within the React ecosystem.
- @react-three/drei: A collection of useful helpers and abstractions for R3F.
- @react-three/rapier: Physics engine integration for realistic simulations.
- Express Server: Serve your application with a simple Express server.
- Vite: Fast and modern build tool for blazing fast development.
To get started with this project, follow these steps:
-
Clone the repository:
git clone https://github.com/your-username/r3f-starter.git cd r3f-starter -
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Build the project for production:
npm run build
-
Preview the production build:
npm run preview
Here's a quick overview of the project's structure:
r3f-starter/ ├── dist/ # Production build output ├── node_modules/ # Node.js modules ├── public/ # Static assets ├── src/ # Source code │ ├── components/ # React components │ │ ├── Experience.jsx # Main 3D experience component │ │ ├── Loader.jsx # Loading screen component │ │ └── Loader.css # Styles for the loader │ ├── App.jsx # Main application component │ ├── index.css # Global styles │ ├── main.jsx # Entry point for the React application ├── .gitignore # Git ignore file ├── index.html # HTML template ├── package.json # Project metadata and scripts ├── Procfile # Heroku deployment configuration ├── server.js # Express server setup ├── vite.config.js # Vite configuration └── README.md # Project documentation In the project directory, you can run the following scripts:
npm run dev: Starts the development server.npm run build: Builds the project for production.npm run preview: Previews the production build.npm start: Starts the Express server.
This project relies on the following key dependencies:
@react-three/drei: ^9.111.3@react-three/fiber: ^8.17.6@react-three/rapier: ^1.5.0express: ^4.21.1react: ^18.3.1react-dom: ^18.3.1react-router-dom: ^7.0.2three: ^0.167.1
- You can use This Site to quickly convert GLTF models into JSX components
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
Happy coding! 🚀