Canva Connector
A Vue 3 application that connects to the Canva API, allowing users to create, manage, and organize their Canva designs from a centralized dashboard. This project can be used both as a standalone application and as an installable Vue component.
Features
- Connect to Canva using OAuth authentication
- View and manage all your Canva designs
- Create new designs directly from the application
- Duplicate and organize existing designs
- Responsive UI built with Tailwind CSS
Tech Stack
- Vue 3 with Composition API
- Pinia for state management
- Vue Router for navigation
- Tailwind CSS for styling
- Canva API integration
- Containerized with Podman
Project Structure
Canva-Connector/
├── frontend/ # Frontend source code and configuration
│ ├── src/ # Vue components, views, stores, etc.
│ ├── index.html # Application HTML template
│ ├── vite.config.js # Vite configuration for standalone app
│ ├── vite.lib.config.js # Vite configuration for library build
│ └── package.json # Frontend dependencies and scripts
├── Dockerfile # Production Dockerfile for standalone app
├── Dockerfile.dev # Development Dockerfile
├── podman-compose.yml # Production podman-compose configuration
├── podman-compose.dev.yml # Development podman-compose configuration
└── package.json # Root package configuration
Prerequisites
Usage Modes
Standalone Application
Running with Podman
- Copy the
.env.examplefile to.envand add your Canva API credentials:
cp .env.example .env
-
Update the
.envfile with your actual Canva API credentials -
Run the application in development mode:
# Build and run the development container
podman-compose -f podman-compose.dev.yml up --build
The application will be available at http://localhost:3000
- Or run in production mode:
# Build and run the production container
podman-compose up --build
The application will be available at http://localhost:8080
Running without containers
- Install dependencies:
pnpm install
- Run the development server:
pnpm dev
- Build for production:
pnpm build
As an Installable Vue Module
This project can also be used as an installable Vue module in other projects.
- Install the module:
npm install @canva-connector/frontend
- Use in your Vue application:
import { createApp } from 'vue'
import { CanvaConnectorPlugin } from '@canva-connector/frontend'
const app = createApp(App)
// Install the plugin
app.use(CanvaConnectorPlugin)
app.mount('#app')
Then use the component in your templates:
<template>
<CanvaConnector />
</template>
Canva API Integration
The application integrates with the Canva API using the Canva Design SDK. To use this application:
- Register for a Canva developer account
- Create a new app in the Canva Developer Portal
- Add your app's domain to the allowed domains list
- Use the Client ID and Client Secret in your environment variables
Environment Variables
VITE_CANVA_CLIENT_ID: Your Canva app's client IDVITE_CANVA_CLIENT_SECRET: Your Canva app's client secret
Development
For development of the component library:
cd frontend
pnpm build-lib # Creates a distributable library version
Troubleshooting
If you encounter issues with the Canva SDK not loading, ensure that:
- You've included the Canva SDK script in your HTML
- Your domain is added to the allowed domains in the Canva Developer Portal
- Your Client ID is correctly configured
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the MIT License.