Git Product home page Git Product logo

cv-ts-react-fiber's Introduction

React Three Fiber Demos, the world of Reactive3D

This free-to-use project is a collection of micro applications, written in TypeScript using React and 3D by the end of 2022.Please try the demo here.

This project is primarily serving educational purposes, my goal was to demonstrate how 'easy' is to integrate WebGL content into React using today's standards, creating a rich but coherent user experience by using '3D Components' seemlesly integrating with the 2D World of the Web.

The 'hosting' React Application was created 'from zero' (create-react-app), as a general purpose 'Personal Portfolio', building up gradually:

  • with a 'Functional First' approach, prefering the usage of Hooks and Functional Components.
  • with a 'Cloud First' approach, means you can integrate with a Firebase project in minutes. (Authentication, Storage and Firestore)
  • with 'Continuous Integration' approach.

React Fiber Applications, what the heck?

These 3D Components, I like to refer to as React Fiber Applications. The center theme of these Fiber Application were to build our 3D world step by step.

The last and most complex demo took about a month to create, by reusing concepts or components that were 'covered' earlier.

During the 3 months of development, from simpler to complex the following Fiber Apps have been created:

Basic Demos (1 day)

  • Navigation Demo - Learning the very basics of a React Three Component. source
  • Keyboard Navigation Demo - Learning How to handle user input.
  • SVG Shape Loader - Drawing, positioning and aligning 2D objects in a 2D plane. source
  • 3D Globe Demo - How to Integrate a pre-existing Three.js application as a 'React Fiber Application' considering both mobile and desktop users.

Simple Demos (1-3 days)

Intermediate complexity Demo (1 week)

  • Topographic Map Viewer - Displaying topography in both 2D and 3D from anywhere around the world. Using compression, persisted module-level state and generally extending the Elevation Demo in every 'meaningful' way.

Real Life complexity Demo (1 month of development)

  • WikiData World Demography - Displaying demography information about 60+ countries using 'country datasets' and WikiData API. To support content sharing every displayed element has a permalink, so you can start in Belgium or you can even start at a specific location like Copenhagen in Denmark. When displaying the details of a location, the application shows every information (claim) received from WikiData, not exclusively demography related content, so finally this happened to become 'My Hitchhiker Guide to the Galaxy'. ;)

All the above Fiber Applications are 'standalone' and can be used as a good starting point of a more complex solution. This is not the 'best way', but 'one way' of creating Reactive 3D Components. The project's minimalist design is intended, as in such a sort time frame, I liked to be more focused on 'how things work', not on 'how things look'. Feel free to fork the repo or use/extend these Fiber Applications or the Fibers they made of.

Getting Started, Local Installation

This project was bootstrapped with Create React App. Package management made with yarn. Be sure you have node, npm and yarn installed.

  1. After cloning the repo, install the project with

yarn install

  1. Make a copy of the provided .env.sample file, located in the project's root folder and rename it to .env .
  2. Ensure you have the following key in your .env file with the value of FALSE

REACT_APP_FIREBASE_ENABLED=FALSE

Running the Project

After successful installation, in the project directory, you can run:

yarn start

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

The page will reload if you make edits.
You will also see any lint errors in the console.

yarn test

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

yarn 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.

Getting Started, Cloud Installation

To be added extended soon...

  1. After cloning the repo, install the project with

yarn install

  1. Make a copy of the provided .env.sample file, located in the project's root folder and rename it to .env .
  2. Ensure you have the following key in your .env file with the value of FALSE

REACT_APP_FIREBASE_ENABLED=TRUE

  1. Also make sure you set the following environment variables in your .env file and/or cloud hosting provider (e.g. Netlify)

REACT_APP_FIREBASE_PROJECT_ID=your-project-id

REACT_APP_FIREBASE_AUTH_DOMAIN=your-project-id.appspot.com

REACT_APP_FIREBASE_STORAGE_BUCKET=your-storage-bucket.appspot.com

REACT_APP_FIREBASE_API_KEY=your-api-key

REACT_APP_FIREBASE_APP_ID=your-app-id

REACT_APP_FIREBASE_MESSAGING_SENDER_ID=your-messaging-sender-id

Country Dataset Generation

To be added soon...

cv-ts-react-fiber's People

Contributors

wwwworkingprocess avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.