Conversation
|
@vincanger may be a good idea to include the project directory structure and where certain files should go. If the LLM doesn't know the opensaas structure it will write files where it thinks they should go; this will undoubtedly lead to problems like files/folders being created outside of the app dir or changing files which will lead to a lot of issues with rebasing with upstream. |
n0rig
left a comment
There was a problem hiding this comment.
Overall lgtm; but, probably could be enhanced in future PRs with more context for better predictability.
| - **Build/Runtime Errors:** | ||
| - Check import paths carefully (Wasp vs. relative vs. `@src/` rules, see [2-project-conventions.mdc](mdc:.cursor/rules/2-project-conventions.mdc) ). | ||
| - Ensure all dependencies are installed (`npm install`). | ||
| - Check the Wasp server console and the browser's developer console for specific error messages. No newline at end of file |
There was a problem hiding this comment.
We should have newlines at the end of files - you get nicer diffs
| middleware checkAdmin { | ||
| fn: import { checkAdminMiddleware } from "@src/server/middleware/auth.js" | ||
| } |
There was a problem hiding this comment.
Do we ever use middleware to check if someone is an admin? Will this example steer Cursur in the wrong direction?
| page AdminDashboardPage { | ||
| component: import { AdminDashboard } from "@src/features/admin/AdminDashboardPage.tsx", | ||
| auth: true, // Ensure user is logged in first | ||
| middlewares: [checkAdmin] // Apply custom admin check |
There was a problem hiding this comment.
middlewares doesn't exist as a option of the page declaration :D I see someone has been vibe coding the vibe coding instructions.
| fn: import { handleAdminAction } from "@src/server/apis/admin.js", | ||
| httpRoute: (POST, "/api/admin/action"), | ||
| auth: true, | ||
| middlewares: [checkAdmin] |
There was a problem hiding this comment.
This doesn't exist in Wasp as well, the proper key is middlewareConfigFn.
| - [Wasp Docs - LLMs.txt](https://wasp.sh/llms.txt) - Links to the raw text docs. | ||
| - [Wasp Docs - LLMs-full.txt](https://wasp.sh/llms-full.txt) - Complete docs as one text file. |
There was a problem hiding this comment.
I suppose we'll merge this first: wasp-lang/wasp#2772
There was a problem hiding this comment.
yeah that was my assumption.
| ## Wasp Auth Setup (`@main.wasp`) | ||
|
|
||
| - Wasp provides built-in authentication with minimal configuration in [main.wasp](mdc:main.wasp). | ||
| - See the general [Auth overview and available methods here](mdc:https:/raw.githubusercontent.com/wasp-lang/wasp/refs/heads/release/web/versioned_docs/version-0.16.0/auth/overview.md). |
There was a problem hiding this comment.
Do you want to link to a versioned docs version of the overview.md file? I saw that you linked to wasp.sh deployed docs in other places.
| } | ||
|
|
||
| // Define the routes needed by email auth methods | ||
| route EmailVerificationRoute { path: "/auth/verify-email/:token", to: EmailVerificationPage } |
There was a problem hiding this comment.
The route should not have :token as param in it, the token is passed in as a query value i.e. ?token=.... I believe this code will fail.
| route EmailVerificationRoute { path: "/auth/verify-email/:token", to: EmailVerificationPage } | ||
| page EmailVerificationPage { component: import { EmailVerification } from "@src/features/auth/EmailVerificationPage.tsx" } | ||
|
|
||
| route PasswordResetRoute { path: "/auth/reset-password/:token", to: PasswordResetPage } |
| ```prisma | ||
| model User { | ||
| id Int @id @default(autoincrement()) | ||
| email String? @unique // Add if needed frequently |
There was a problem hiding this comment.
Maybe we can reference the userSignupFields hook and how they can set the email on signup? You'll know better which level of details is okay :)
There was a problem hiding this comment.
yeah good idea. I added a note about that in the rule even though its present in the open saas codebase because we will probably use these rules for other projects/templates.
| } | ||
| ``` | ||
|
|
||
| </rewritten_file> No newline at end of file |
There was a problem hiding this comment.
Leftover </rewritten_file> and also, let's add a newline
Description
This adds improved
.cursor/rulesin the form of multiple .mdc files, as well as a docs section on how to use AI with Open SaaS. Fixes #428Contributor Checklist