This is a simple web application that allows users to render .glb
(GLB) 3D model files with custom textures.
- Clone the repository:
git clone https://gitlab.com/deniskolosov/glb_render_example.git
cd glb_render_example
- Build and run the containers using Docker Compose (make sure 8000 and 8080 ports are free):
docker-compose up -d
- Run tests for backend
docker-compose exec backend pytest
- Check logs for the apps
docker-compose logs
Once the application is running, you can access:
- The Vue frontend at
http://localhost:8080
- The FastAPI Swagger docs at
http://localhost:8000/docs
To use the application, follow these steps:
- Navigate to the frontend URL in your web browser.
- Apply a custom texture by uploading an .png file.
The frontend is a Vue.js application. To work on it directly, navigate to the frontend directory and install dependencies:
cd frontend
npm install
To serve the frontend application with hot-reload for development purposes:
npm run serve
The backend is built using FastAPI. To check the backend code locally, navigate to the backend
directory and set up a virtual environment:
cd backend
python -m venv venv
source venv/bin/activate # For Unix/Linux/MacOS
venv\Scripts\activate # For Windows
Install the required dependencies:
pip install -r requirements.txt
To run the FastAPI server for development:
uvicorn main:app --reload
The FastAPI backend provides several endpoints for interaction with the frontend:
POST /render
: Endpoint to upload textures.GET /ping
: Will reply "pong" to every request
Swagger documentation can be accessed at http://localhost:8000/docs
once the backend service is running.