Compare commits
No commits in common. "7084794c671e98ae9fad46dfa80769fbd793917a" and "6cd3aff350013be88f401c66996d8963d58d5a30" have entirely different histories.
7084794c67
...
6cd3aff350
6 changed files with 0 additions and 97 deletions
|
|
@ -1,43 +0,0 @@
|
||||||
# Frontend Prompt Template
|
|
||||||
|
|
||||||
Follow the existing patterns in this codebase to:
|
|
||||||
- xxxxxxxx
|
|
||||||
|
|
||||||
Requirements:
|
|
||||||
- xxxxx
|
|
||||||
|
|
||||||
Process (TDD - Test Driven Development):
|
|
||||||
1. Write a test first
|
|
||||||
2. Run the test to confirm it fails
|
|
||||||
3. Implement the code to make the test pass
|
|
||||||
4. Run the test to confirm it passes
|
|
||||||
5. Repeat for each new behavior
|
|
||||||
|
|
||||||
Code patterns to follow:
|
|
||||||
- First, explore the codebase to understand existing entity patterns
|
|
||||||
- Look at similar pages for reference
|
|
||||||
- Tests: follow existing patterns in cypress/e2e/
|
|
||||||
- Lines should not exceed 80 columns, but should use up to 80 columns when possible — do not split lines unnecessarily
|
|
||||||
- Imports: always put imports at the top of the file
|
|
||||||
- Variable names: use explicit, descriptive names — never single-letter or abbreviated variables (e.g., use sponsorship not s, event not e)
|
|
||||||
|
|
||||||
Git commit style:
|
|
||||||
- Present tense, imperative mood (add, create, test, fix)
|
|
||||||
- Lowercase
|
|
||||||
- Short (3-6 words)
|
|
||||||
- Match patterns found in git history
|
|
||||||
|
|
||||||
Git commits:
|
|
||||||
- Tests should be committed first, before implementation
|
|
||||||
- One commit per file - each new file gets its own commit
|
|
||||||
- Make commits SMALL and FREQUENT - every meaningful change should be a commit
|
|
||||||
- Commits are for reviewing and documenting the development of code
|
|
||||||
- A commit can be as simple as adding one import, one getter, one property, etc.
|
|
||||||
- Don't wait to commit - commit as you go
|
|
||||||
|
|
||||||
Branch naming:
|
|
||||||
- Use kebab-case (e.g., node-page text-page)
|
|
||||||
- Use descriptive feature names
|
|
||||||
- NEVER work directly on master - always create and work on a branch
|
|
||||||
|
|
||||||
Do not push anything. Make commits as you go.
|
|
||||||
|
|
@ -29,12 +29,4 @@ class ViewController
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function home(Response $response): Response
|
|
||||||
{
|
|
||||||
$html = file_get_contents(__DIR__ . '/../../views/templates/home.php', true);
|
|
||||||
$response->getBody()->write($html);
|
|
||||||
|
|
||||||
return $response;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ $app = Bridge::create($container);
|
||||||
// change first param to false for production
|
// change first param to false for production
|
||||||
$app->addErrorMiddleware(true, true, true);
|
$app->addErrorMiddleware(true, true, true);
|
||||||
|
|
||||||
$app->get('/home', [ViewController::class, 'home']);
|
|
||||||
$app->get('/admin', [ViewController::class, 'admin']);
|
$app->get('/admin', [ViewController::class, 'admin']);
|
||||||
$app->get('/admin/texts', [ViewController::class, 'texts']);
|
$app->get('/admin/texts', [ViewController::class, 'texts']);
|
||||||
$app->get('/admin/texts/{textId}', [ViewController::class, 'text']);
|
$app->get('/admin/texts/{textId}', [ViewController::class, 'text']);
|
||||||
|
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
describe('The home page', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
cy.exec('npm run db:seed')
|
|
||||||
})
|
|
||||||
afterEach(() => {
|
|
||||||
cy.exec('npm run db:wipe')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('displays heading', () => {
|
|
||||||
cy.visit('/home')
|
|
||||||
cy.get('h1').should('contain', 'Home')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('displays texts from api', () => {
|
|
||||||
cy.intercept('GET', '/api/texts').as('getTexts')
|
|
||||||
cy.visit('/home')
|
|
||||||
cy.wait('@getTexts')
|
|
||||||
cy.get('#texts-list').should('contain', 'Tanach')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
|
||||||
const textsList = document.getElementById('texts-list');
|
|
||||||
|
|
||||||
async function loadTexts() {
|
|
||||||
const response = await fetch('/api/texts');
|
|
||||||
const texts = await response.json();
|
|
||||||
textsList.innerHTML = texts
|
|
||||||
.map(text => '<li>' + text.name + '</li>')
|
|
||||||
.join('');
|
|
||||||
}
|
|
||||||
|
|
||||||
loadTexts();
|
|
||||||
});
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Daily Goals - Home</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Home</h1>
|
|
||||||
<ul id="texts-list">
|
|
||||||
</ul>
|
|
||||||
<script src="/js/home.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue