diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..71da7d5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.env +.env.local +*.log diff --git a/README.md b/README.md index 645ce5d..83d15cd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,31 @@ -# hot-repo +# Hot Repo +A sample project demonstrating Lubes platform features. + +## Quick Start + +```bash +# Install dependencies +npm install + +# Set environment variables +export LUBES_PROJECT_ID="your-project-id" +export LUBES_API_KEY="your-api-key" + +# Run the application +npm start +``` + +## Features + +- Database queries via Lubes SDK +- File storage with S3-compatible API +- Serverless functions + +## Deploy + +```bash +git push lubes main +``` + +Pushing to the Lubes remote triggers automatic deployment. diff --git a/index.ts b/index.ts new file mode 100644 index 0000000..1ce3b72 --- /dev/null +++ b/index.ts @@ -0,0 +1,22 @@ +// Lubes Hot Repo - Main Entry Point +import { Lubes } from '@lubes/sdk' + +const client = new Lubes({ + projectId: process.env.LUBES_PROJECT_ID!, + apiKey: process.env.LUBES_API_KEY!, +}) + +async function main() { + // Query the database + const users = await client.db.query('SELECT * FROM users LIMIT 10') + console.log('Users:', users) + + // Upload a file to storage + await client.storage.upload('avatars', 'example.png', Buffer.from('...')) + + // Call a serverless function + const result = await client.functions.invoke('hello-world', { name: 'Lubes' }) + console.log('Function result:', result) +} + +main().catch(console.error) diff --git a/package.json b/package.json new file mode 100644 index 0000000..45646a3 --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "name": "hot-repo", + "version": "1.0.0", + "description": "Lubes Hot Repo - Example Project", + "main": "index.ts", + "scripts": { + "start": "ts-node index.ts", + "build": "tsc", + "deploy": "lubes deploy" + }, + "dependencies": { + "@lubes/sdk": "^0.1.0" + }, + "devDependencies": { + "typescript": "^5.0.0", + "ts-node": "^10.0.0" + } +}