mirror of
https://github.com/Pythagora-io/gpt-pilot.git
synced 2026-01-09 21:27:53 -05:00
@@ -24,7 +24,7 @@ Each epic must be related to one or more API endpoints that are called from the
|
||||
This rule applies to order of epics.
|
||||
Epics will be executed in same order that you output them. You must order them in a logical way so that epics that depend on other functionalities are implemented in later stage. The general order should be as follows:
|
||||
{% if task_type == 'app' %}
|
||||
- If the app uses authentication, the first epic **MUST** be to implement authentication. In this case, first task **MUST** be to remove the mocked data for making a register and login API requests from the frontend (in the client/src/api/auth.js file) - do **NOT** split this task into multiple tasks. Next task, if needed, should be to update the User model with more required parameters like different roles, different user data, etc. In the second task, make sure to add all necessary fields to the User model in the backend.
|
||||
- The first epic **MUST** be to implement authentication. In the first epic, the first task **MUST** be to remove the mocked data for making a register and login API requests from the frontend (in the client/src/api/auth.js file) - do **NOT** split this task into multiple tasks. Next task, if needed, should be to update the User model with more required parameters like different roles, different user data, etc. In the second task, make sure to add all necessary fields to the User model in the backend.
|
||||
{% endif %}
|
||||
- The {% if task_type == 'app' %}second{% else %}first{% endif %} epic **MUST** be to create any necessary scripts (if there are any). For example, a script to create an admin user, a script to seed the database, etc.
|
||||
- {% if task_type == 'app' %}Finally{% else %}Then{% endif %}, all other epics must be about creating database models and CRUD operations (each epic must contain CRUD operations only for one single model - never for multiple). Pay attention to the API requests inside files in `client/api/` folder because they are currently using mocked data and whenever you implement an API endpoint, you just need to replace the mocked data with the real API request to the backend.
|
||||
|
||||
@@ -13,7 +13,7 @@ When thinking about the scope of a single task, here are the components that nee
|
||||
**IMPORTANT: order of tasks**
|
||||
The tasks you create **MUST** be in the order that they should be implemented. When CRUD operations need to be implemented, first implement the Create operation, then Read, Update, and Delete.
|
||||
|
||||
{% if state.has_frontend() and not state.is_feature() and (state.user_options|default({})).get('auth', True) %}
|
||||
{% if state.has_frontend() and not state.is_feature() and (state.options|default({})).get('auth', True) %}
|
||||
**IMPORTANT**
|
||||
If you are working on the Epic #1 that needs to implement the authentication system. The first task **MUST** be to remove the mocked data for authentication (register and login). After that, add any custom authentication requirements like different roles, different user data, etc.
|
||||
{% endif %}
|
||||
|
||||
@@ -25,7 +25,7 @@ Before we go into the coding part, your job is to split the development process
|
||||
Now, based on the project details provided{% if task_type == 'feature' %} and new feature description{% endif %}, think epic by epic and create the entire development plan{% if task_type == 'feature' %} for new feature{% elif task_type == 'app' %}. {% if state.files %}Continue from the existing code listed above{% else %}Start from the project setup{% endif %} and specify each epic until the moment when the entire app should be fully working{% if state.files %}. IMPORTANT: You should not reimplement what's already done - just continue from the implementation already there.{% endif %}{% endif %}
|
||||
|
||||
IMPORTANT!
|
||||
Frontend is already built and you don't need to create epics for it. You only need to create epics for backend implementation and connect it to existing frontend. Keep in mind that some backend functionality is already implemented.{% if task_type == 'app' and (state.user_options|default({})).get('auth', True) %} The first epic **MUST** be to implement the authentication system if it's required.{% endif %}
|
||||
Frontend is already built and you don't need to create epics for it. You only need to create epics for backend implementation and connect it to existing frontend. Keep in mind that some backend functionality is already implemented.{% if task_type == 'app' and (state.options|default({})).get('auth', True) %} The first epic **MUST** be to implement the authentication system.{% endif %}
|
||||
|
||||
Strictly follow these rules:
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class StateManager:
|
||||
self.blockDb = False
|
||||
self.git_available = False
|
||||
self.git_used = False
|
||||
self.user_options = {}
|
||||
self.options = {}
|
||||
|
||||
@asynccontextmanager
|
||||
async def db_blocker(self):
|
||||
|
||||
@@ -20,6 +20,9 @@ class NoOptions(BaseModel):
|
||||
Options class for templates that do not require any options.
|
||||
"""
|
||||
|
||||
class Config:
|
||||
extra = "allow"
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -12,10 +12,8 @@ function App() {
|
||||
<ThemeProvider defaultTheme="light" storageKey="ui-theme">
|
||||
<Router>
|
||||
<Routes>
|
||||
{% if options.auth %}
|
||||
<Route path="/login" element={<Login />} />
|
||||
<Route path="/register" element={<Register />} />
|
||||
{% endif %}
|
||||
<Route path="/" element={<ProtectedRoute> <Layout /> </ProtectedRoute>} />
|
||||
</Routes>
|
||||
</Router>
|
||||
|
||||
@@ -1,30 +1,35 @@
|
||||
{% raw %}
|
||||
import { Bell{% if options.auth %}, LogOut{% endif %} } from "lucide-react"
|
||||
import { Bell{% endraw %}{% if options.auth %}, LogOut{% endif %}{% raw %} } from "lucide-react"
|
||||
import { Button } from "./ui/button"
|
||||
import { ThemeToggle } from "./ui/theme-toggle"
|
||||
import { useAuth } from "@/contexts/AuthContext"
|
||||
import { useNavigate } from "react-router-dom"
|
||||
|
||||
export function Header() {{% if options.auth %}
|
||||
const { logout } = useAuth(){% endif %}
|
||||
export function Header() {
|
||||
{% endraw %}
|
||||
{% if options.auth %}
|
||||
const { logout } = useAuth()
|
||||
{% endif %}
|
||||
const navigate = useNavigate()
|
||||
{% if options.auth %}
|
||||
const handleLogout = () => {
|
||||
logout()
|
||||
navigate("/login")
|
||||
}{% endif %}
|
||||
}
|
||||
{% endif %}
|
||||
return (
|
||||
<header className="fixed top-0 z-50 w-full border-b bg-background/80 backdrop-blur-sm">
|
||||
<div className="flex h-16 items-center justify-between px-6">
|
||||
<div className="text-xl font-bold">Home</div>
|
||||
<div className="flex items-center gap-4">
|
||||
<ThemeToggle />{% if options.auth %}
|
||||
<ThemeToggle />
|
||||
{% if options.auth %}
|
||||
<Button variant="ghost" size="icon" onClick={handleLogout}>
|
||||
<LogOut className="h-5 w-5" />
|
||||
</Button>{% endif %}
|
||||
</Button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
)
|
||||
}
|
||||
{% endraw %}
|
||||
|
||||
Reference in New Issue
Block a user