Technical Round
Goal: Develop a mini web application that includes frontend, backend, and database integration. Requirements:
Frontend: ○ Create a responsive webpage using React (preferred) that displays a 3D model using Three.js or React Three Fiber. ○ Include basic interaction: the ability to rotate, zoom, and pan the 3D model. ○ Provide a search bar where users can filter models by name (data fetched from the backend).
Backend: ○ Develop a Node.js/Express server with the following endpoints: ■ GET /models: Fetch a list of stored 3D models (return mock data with fields like id, name, and url). ■ POST /upload: Accept links for 3D models (e.g., GLB/GLTF files) along with the name, description and store them in the firebase database.
Database: ○ Use Firebase to store model metadata (e.g., id, name, description, uploadDate, url). ○ Ensure the /models endpoint fetches data from this database.
Documentation: ○ Share the steps to deploy the application over the internet.
You may refer to the Three.js Documentation for guidance on using the library’s features. While web searches for syntax clarification and Three.js documentation reference are permitted.
I'll create a full-stack application with React, Three.js, Express, and Firebase integration. Let's build this step by step.
We'll create:
To use Firebase with this application, you'll need to set up a Firebase project and configure it:
NEXT_PUBLIC_FIREBASE_API_KEY=your-api-key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-auth-domain
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-storage-bucket
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your-messaging-sender-id
NEXT_PUBLIC_FIREBASE_APP_ID=your-app-id
The easiest way to deploy this application is using Vercel:
You can also deploy to other platforms:
Netlify:
Manual Deployment:
npm run build
This application includes:
3D Model Viewer:
Model Management:
Backend API:
Firebase Integration:
This application demonstrates a complete full-stack implementation with 3D model visualization capabilities, search functionality, and database integration.
Please make sure to add the following environment variables to your project:
Great! Now that you've added all the required Firebase environment variables to your Vercel project, your 3D Model Web App should be fully functional. Here's what you can do next:
Add Test Models: Use the upload form to add some test 3D models. You can use these sample GLB model URLs for testing:
https://threejs.org/examples/models/gltf/Duck.glb
https://threejs.org/examples/models/gltf/FlightHelmet/FlightHelmet.gltf
https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf
Your application is set up to use the following Firestore structure:
models
Documents: Each with fields:
name
: Stringdescription
: Stringurl
: String (URL to the GLB/GLTF file)uploadDate
: String (ISO date string)If you want to extend the application further, here are some ideas:
If you encounter any issues:
Your application is now deployed and should be ready to use! Let me know if you need any further assistance or have questions about specific aspects of the implementation.
i want o upload the model from both ways from url and file upload