0
stars
26
commits
TypeScript
primary language
Jun 30, 2025
updated
A full-stack web application that converts raster images (JPG/PNG) to SVG format using AI-powered technology. Built with React, FastAPI, and GraphQL.
βββ frontend/ # React + TypeScript + Vite
βββ backend/ # FastAPI + GraphQL + Strawberry
βββ docker-compose.yml # Container orchestration
βββ README.md
Clone and start the application:
git clone <repository-url>
cd image-to-svg-converter
docker-compose up --build
Access the application:
Navigate to backend directory:
cd backend
Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install dependencies:
pip install -r requirements.txt
Run the backend:
python main.py
Navigate to frontend directory:
cd frontend
Install dependencies:
npm install
Start development server:
npm run dev
type Mutation {
convertImageToSvg(file: Upload!): ConversionResult!
}
type ConversionResult {
success: Boolean!
svgContent: String
error: String
}
type Query {
hello: String!
}
GET / - API informationGET /health - Health checkPOST /upload - File upload endpointGET /graphql - GraphQL playgroundThe application currently uses a mock conversion function that creates an SVG representation of the uploaded image. To integrate the StarVector model or any other ML model:
Replace the mock function in backend/main.py:
def convert_image_to_svg_mock(image_data: bytes, filename: str) -> str:
# Replace this with actual ML model integration
# Example: StarVector model integration
pass
Add model dependencies to requirements.txt:
transformers==4.35.0
torch==2.1.0
# Add other ML dependencies
Create .env files in both frontend and backend directories:
Frontend (.env):
VITE_API_URL=http://localhost:8000/graphql
Backend (.env):
ENVIRONMENT=development
CORS_ORIGINS=["http://localhost:3000"]
The docker-compose.yml file configures:
Backend Deployment:
pip install -r requirements.txtuvicorn main:app --host 0.0.0.0 --port $PORTFrontend Deployment:
cd frontend && npm install && npm run buildfrontend/distBuild the frontend:
cd frontend && npm run build
Deploy to Netlify:
dist folder to Netlifycd backend
python -m pytest
cd frontend
npm test
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ using React, FastAPI, and GraphQL
TypeScript
56.2%
Python
20.4%
JavaScript
11.1%
Dockerfile
4.7%
HTML
4.0%
CSS
3.6%
0
stars
26
commits
TypeScript
primary language
Jun 30, 2025
updated
A full-stack web application that converts raster images (JPG/PNG) to SVG format using AI-powered technology. Built with React, FastAPI, and GraphQL.
βββ frontend/ # React + TypeScript + Vite
βββ backend/ # FastAPI + GraphQL + Strawberry
βββ docker-compose.yml # Container orchestration
βββ README.md
Clone and start the application:
git clone <repository-url>
cd image-to-svg-converter
docker-compose up --build
Access the application:
Navigate to backend directory:
cd backend
Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install dependencies:
pip install -r requirements.txt
Run the backend:
python main.py
Navigate to frontend directory:
cd frontend
Install dependencies:
npm install
Start development server:
npm run dev
type Mutation {
convertImageToSvg(file: Upload!): ConversionResult!
}
type ConversionResult {
success: Boolean!
svgContent: String
error: String
}
type Query {
hello: String!
}
GET / - API informationGET /health - Health checkPOST /upload - File upload endpointGET /graphql - GraphQL playgroundThe application currently uses a mock conversion function that creates an SVG representation of the uploaded image. To integrate the StarVector model or any other ML model:
Replace the mock function in backend/main.py:
def convert_image_to_svg_mock(image_data: bytes, filename: str) -> str:
# Replace this with actual ML model integration
# Example: StarVector model integration
pass
Add model dependencies to requirements.txt:
transformers==4.35.0
torch==2.1.0
# Add other ML dependencies
Create .env files in both frontend and backend directories:
Frontend (.env):
VITE_API_URL=http://localhost:8000/graphql
Backend (.env):
ENVIRONMENT=development
CORS_ORIGINS=["http://localhost:3000"]
The docker-compose.yml file configures:
Backend Deployment:
pip install -r requirements.txtuvicorn main:app --host 0.0.0.0 --port $PORTFrontend Deployment:
cd frontend && npm install && npm run buildfrontend/distBuild the frontend:
cd frontend && npm run build
Deploy to Netlify:
dist folder to Netlifycd backend
python -m pytest
cd frontend
npm test
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ using React, FastAPI, and GraphQL
TypeScript
56.2%
Python
20.4%
JavaScript
11.1%
Dockerfile
4.7%
HTML
4.0%
CSS
3.6%