Implement Django backend and Vue frontend structure
- Django backend with projects, templates, exports apps - SQLite database models for Project, Asset, CardLayer - REST API endpoints for project management - Vue frontend with Vite, Element Plus, Fabric.js - Home page for project selection - Editor page with Fabric.js canvas integration
This commit is contained in:
15
frontend/src/api/export.js
Normal file
15
frontend/src/api/export.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import axios from 'axios'
|
||||
|
||||
const API_BASE = '/api'
|
||||
|
||||
export async function exportProject(projectId, resolution = 'standard', cards = 'all') {
|
||||
const response = await axios.post(`${API_BASE}/projects/${projectId}/export/`, {
|
||||
resolution,
|
||||
cards
|
||||
})
|
||||
return response.data
|
||||
}
|
||||
|
||||
export function getExportUrl(projectId, cardKey, resolution = 'standard') {
|
||||
return `${API_BASE}/projects/${projectId}/export/${cardKey}/?resolution=${resolution}`
|
||||
}
|
||||
27
frontend/src/api/project.js
Normal file
27
frontend/src/api/project.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import axios from 'axios'
|
||||
|
||||
const API_BASE = '/api'
|
||||
|
||||
export async function getProjects() {
|
||||
const response = await axios.get(`${API_BASE}/projects/`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function createProject(data) {
|
||||
const response = await axios.post(`${API_BASE}/projects/`, data)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function getProject(id) {
|
||||
const response = await axios.get(`${API_BASE}/projects/${id}/`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function updateProject(id, data) {
|
||||
const response = await axios.put(`${API_BASE}/projects/${id}/`, data)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function deleteProject(id) {
|
||||
await axios.delete(`${API_BASE}/projects/${id}/`)
|
||||
}
|
||||
13
frontend/src/api/template.js
Normal file
13
frontend/src/api/template.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import axios from 'axios'
|
||||
|
||||
const API_BASE = '/api'
|
||||
|
||||
export async function getTemplates() {
|
||||
const response = await axios.get(`${API_BASE}/templates/`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function getTemplate(id) {
|
||||
const response = await axios.get(`${API_BASE}/templates/${id}/`)
|
||||
return response.data
|
||||
}
|
||||
Reference in New Issue
Block a user