136<div>
137<h3 class="text-xl font-medium text-blue-300">4. Storage</h3>
138<p class="mt-1">The generated blog is saved in a database so you can access it later using the same link.</p>
139</div>
140</div>
11});
1213// Sample data - in a real app, this would come from a database
14const sampleGalleryItems: GalleryItem[] = [
15{
sqliteExplorerAppREADME.md1 match
30- [ ] add triggers to sidebar
31- [ ] add upload from SQL, CSV and JSON
32- [ ] add ability to connect to a non-val town Turso database
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
vibeCoding_PLPapi.py2 matches
5from datetime import datetime, timedelta
67from database.connection import get_db_connection, prepare_json_field, parse_json_field
8from database.models import (
9Store, StoreCreate, Product, ProductCreate, Transaction, TransactionCreate,
10Category, CategoryCreate, FinancialHealth, DashboardData, ApiResponse,
vibeCoding_PLPconnection.py13 matches
6from datetime import datetime
78# Database configuration
9DB_CONFIG = {
10'host': os.getenv('MYSQL_HOST', 'localhost'),
12'user': os.getenv('MYSQL_USER', 'root'),
13'password': os.getenv('MYSQL_PASSWORD', ''),
14'database': os.getenv('MYSQL_DATABASE', 'storefront_builder'),
15'charset': 'utf8mb4',
16'collation': 'utf8mb4_unicode_ci'
17}
1819class DatabaseConnection:
20def __init__(self):
21self.connection = None
71return False
7273# Global database connection instance
74db = DatabaseConnection()
7576async def get_db_connection():
79return db
8081async def init_database():
82"""Initialize database and create tables if they don't exist"""
83try:
84# First, create database if it doesn't exist
85temp_config = DB_CONFIG.copy()
86temp_config.pop('database', None)
87
88temp_connection = mysql.connector.connect(**temp_config)
89temp_cursor = temp_connection.cursor()
90
91temp_cursor.execute(f"CREATE DATABASE IF NOT EXISTS {DB_CONFIG['database']} CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci")
92temp_cursor.close()
93temp_connection.close()
94
95# Now connect to the database and create tables
96await db.connect()
97
99await create_tables()
100
101print("Database initialized successfully!")
102
103except Error as e:
104print(f"Error initializing database: {e}")
105raise e
106
vibeCoding_PLPmain.py3 matches
6import json
7from pathlib import Path
8from database.connection import get_db_connection, init_database
9from routes.api import router as api_router
1020)
2122# Initialize database on startup
23@app.on_event("startup")
24async def startup_event():
25await init_database()
2627# Include API routes
vibeCoding_PLPREADME.md3 matches
22- **Frontend:** HTML5, CSS3, Vanilla JavaScript
23- **Backend:** Python with FastAPI framework
24- **Database:** MySQL with real-time updates
25- **Animations:** GSAP, Three.js, Matter.js
26- **Styling:** TailwindCSS with custom animations
31```
32โโโ backend/
33โ โโโ database/
34โ โ โโโ models.py # Database models
35โ โ โโโ connection.py # MySQL connection
36โ โ โโโ migrations.py # Schema definitions
untitled-2866main.tsx1 match
186
187try {
188// Initialize database table
189await sqlite.execute(`CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
190id INTEGER PRIMARY KEY AUTOINCREMENT,
170
171try {
172// Initialize database table
173await sqlite.execute(`CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
174id INTEGER PRIMARY KEY AUTOINCREMENT,
670
671try {
672// Initialize database table
673await sqlite.execute(`CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
674id INTEGER PRIMARY KEY AUTOINCREMENT,
untitled-928README.md2 matches
31### Backend
32- Hono framework for API routes
33- SQLite database for data persistence
34- RESTful API design
35- File handling for document uploads
36- Session management
3738### Database Schema
39- Applications table for PAN applications
40- Documents table for uploaded files