Players - local = game:GetService() local TweenService = game:GetService("TweenService") local LocalPlayer = .LocalPlayer
Generated Prompt
PROJECT SETUP
Create a new project in Cursor for the messaging application. The project structure should include the following files:
```
/MessagingApp
├── main.lua -- Main script containing the UI and logic
├── themes.lua -- Separate file for theme definitions
├── utils.lua -- Utility functions for common tasks
├── README.md -- Documentation for the project
```
The `main.lua` file will be the entry point of the application, while `themes.lua` will contain the theme configurations. `utils.lua` will store any utility functions required throughout the application.
DESIGN REQUIREMENTS
- Visual Style: minimalist - Clean, simple design with plenty of white space, minimal color palette, and focus on typography
- Color Mode: Light theme with dark text on light backgrounds
- Primary Color: #1978E5 (accent for buttons, links, highlights)
- Typography: Use Inter from Google Fonts for headings, Inter for body text and UI elements
- Border Radius: 8px (moderately rounded) for buttons, cards, and inputs
CORE COMPONENTS
1. **Main Frame**: The primary container for the UI, which includes the header, inputs, and send button.
2. **Header**: Displays the title and the theme toggle button.
3. **Recipient Input**: A text box for entering the recipient's username.
4. **Message Input**: A text box for entering the message content.
5. **Send Button**: A button to send the message.
6. **Theme Switcher**: A toggle button to switch between dark and light modes.
IMPLEMENTATION APPROACH
1. **main.lua**: Set up the main UI elements using the Roblox API.
2. **themes.lua**: Define the light and dark themes as Lua tables.
3. **utils.lua**: Implement utility functions for common tasks, such as resetting input fields or validating inputs.
Example snippet for `main.lua`:
```lua
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local LocalPlayer = Players.LocalPlayer
local THEMES = require(script.Parent.themes)
local gui = Instance.new("ScreenGui")
gui.Name = "SendWindowGui"
gui.Parent = LocalPlayer:WaitForChild("PlayerGui")
local mainFrame = Instance.new("Frame")
mainFrame.Size = UDim2.new(0, 360, 0, 240)
mainFrame.Position = UDim2.new(0.5, -180, 0.5, -120)
mainFrame.BackgroundColor3 = THEMES.Light.FrameBg
mainFrame.BorderSizePixel = 0
mainFrame.Parent = gui
-- Further code to create header, inputs, buttons...
```
ARCHITECTURE CONSIDERATIONS
The application will use a modular architecture where each UI component is defined in its own section for clarity and reusability. The theme handling will be encapsulated in a separate module to allow easy updates in the future.
ERROR HANDLING
Implement basic error handling strategies, such as checking if the recipient and message inputs are empty before sending. Use print statements or warnings to alert the user if an error occurs.
Example error handling:
```lua
sendButton.MouseButton1Click:Connect(function()
if recipientInput.Text == "" then
print("Please enter a recipient.")
elseif messageInput.Text == "" then
print("Please enter a message.")
else
-- Proceed to send the message
end
end)
```
TESTING STRATEGY
Testing should include:
- Unit tests for utility functions in `utils.lua`.
- Manual testing of the UI components to ensure they function correctly when interacted with.
- Verify the theme switching functionality works and that all components update their styles accordingly.
By structuring your code this way and following best practices, you will ensure maintainability and clarity in your messaging application.Loved by thousands of makers from
From early prototypes to real products, they started here.







































Generate optimized prompts for your vibe coding projects
Generate prompt
Enter a brief description of the app you want to build and get an optimized prompt
Review and use your prompt
Review (and edit if necessary) the generated prompt, then copy it or open it directly in your chosen platform
Get inspired with new ideas
Get AI-generated suggestions to expand your product with features that will surprise your users
Frequently Asked Questions
Everything you need to know about creating better prompts for your Lovable projects
Still have questions?
Can't find what you're looking for? We're here to help!
