cking!M
cking!M
WWasp-lang
Created by cking!M on 11/14/2024 in #đŸ™‹questions
Uploading files to server
I want to upload files from the frontend to my server as opposed to AWS S3. I have implemented the code below in my operations.ts file which is in my module's subdirectory under /src: personita/app/src/personita/operations.ts import { fileURLToPath } from 'url' import path from 'path' // Get the current file's directory const __filename = fileURLToPath(import.meta.url) const __dirname = path.dirname(__filename) // Navigate to project root (app directory) and create uploads folder there // From: src/personita/operations.ts // Up to: src/personita/ // Up to: src/ // Up to: app/ const UPLOAD_DIR = path.join(__dirname, '..', '..', '..', 'uploads') // Log the path to verify console.log('Upload directory path:', UPLOAD_DIR) // Ensure upload directory exists if (!fs.existsSync(UPLOAD_DIR)) { fs.mkdirSync(UPLOAD_DIR, { recursive: true }) console.log('Created upload directory:', UPLOAD_DIR) } According to the code above, I expect the files to be uploaded to personita/app/uploads however they are being saved in the .wasp directory instead personita/app/.wasp/. How do I fix this?
7 replies
WWasp-lang
Created by cking!M on 8/28/2024 in #đŸ™‹questions
Added a new page, can't get it to load
Hi I am new here so please bear with the newbie question! I am using the default saas template [option 3 when running wasp new]. In the main.wasp file I have created a new route and page, and also created the tsx file for the page and referenced it's location correctly. However the page is blank when I navigate to it in my browser. Note sure what I am doing wrongly main.wasp code //#region Client route ClientRoute { path: "/client", to: ClientPage } page ClientPage { authRequired: true, component: import ClientPage from "@src/client-page/ClientPage" } //#endregion ClientPage.tsx in src/client-page/ import React, { useState } from 'react'; import { useAuth } from 'wasp/client/auth'; function ClientPage() { const [clientName, setClientName] = useState(''); const [clientDescription, setClientDescription] = useState(''); const { data: user, isLoading, error } = useAuth(); if (isLoading) return <div>Loading...</div>; if (error) return <div>Error: {error.message}</div>; const handleClientSubmit = async (event) => { event.preventDefault(); // Add your API call to save the client's company name and description here console.log('Submitting:', { clientName, clientDescription }); }; return ( <div> <h1>Client Page</h1> <p>Welcome, {user?.email}</p> <form onSubmit={handleClientSubmit}> <label>Company Name:</label> <input type="text" value={clientName} onChange={(e) => setClientName(e.target.value)} /> <br /> <label>Description:</label> <textarea value={clientDescription} onChange={(e) => setClientDescription(e.target.value)} /> <br /> <button type="submit">Submit</button> </form> </div> ); } export default ClientPage;
9 replies
WWasp-lang
Created by cking!M on 8/26/2024 in #đŸ™‹questions
Update Wasp AI to use latest GPT model
I would like to ge use the WASP AI feature however it is very expensive as it is still using the gpt-4-0613 model. Would it be possible to update this to use gpt-4o which is a lot cheaper?
7 replies
WWasp-lang
Created by cking!M on 8/26/2024 in #đŸ™‹questions
Render for deployment a good choice?
I am looking to build a web app and trying to decide which provider to deploy on. I like Render very much from a dev experience perspective. I notice it is not on the list of supported providers for Wasp. Is it going to be a blocker? Or is there a standardised deployment method regardless of provider?
6 replies
WWasp-lang
Created by cking!M on 5/6/2024 in #đŸ™‹questions
WASP AI feature - still using old OpenAI models?
I am trying to use the WASP AI feature to generate an app with the OpenSaaS template. It appears the WASP AI still uses the old models gpt-4-0613. How can I update this with the latest one: gpt-4-turbo?
10 replies
WWasp-lang
Created by cking!M on 5/5/2024 in #đŸ™‹questions
Trying to clone ChatGPT's UI for an multi-AI agent app powered by AutoGen
I just found opensaas and I'm excited at it's seemingly endless potential. I am building a chat app that will offer autonomous multi agent automation with AutoGen via a ChatGPT-like UI. Originally I looked at using the Chainlit framework for the front end but it doesn't seem to offer the flexibility to clone the UI of ChatGPT. Is this achievable with OpenSaas? Are there any templates available that are clones of ChatGPT?
6 replies