Development guidelines for the YAH social enterprise website project. Enforces security-first approach, test-driven development, UX consistency, and performance standards for youth event registration features.
Development guidelines for building secure, performant, and user-friendly features for the YAH social enterprise website, with focus on youth event registration systems.
When working on this project, follow these constitutional principles and technical standards:
Before writing any code, ensure your approach adheres to:
Use these technologies for implementation:
Organize code into:
```
backend/ # Server-side logic, APIs, database operations
frontend/ # HTML, CSS, client-side JavaScript
tests/ # Test suites (write first!)
```
For any security-sensitive feature:
Optimize for these targets:
For every feature:
1. Write unit tests first (test forms, validation, database operations)
2. Run `npm test` to verify tests fail
3. Implement the feature
4. Run `npm test` to verify tests pass
5. Run `npm run lint` to check code style
```bash
npm test # Run test suite
npm run lint # Check code style
npm start # Start development server
```
When implementing a new feature:
1. Review the constitutional principles above
2. Write tests covering happy path and edge cases
3. Implement security measures appropriate to the feature
4. Ensure mobile-responsive UI with Bootstrap
5. Optimize database queries with proper indexing
6. Validate performance against targets
7. Document any new schemas or APIs
For event registration features:
```javascript
const crypto = require('crypto');
function generateAccessCode() {
return crypto.randomBytes(16).toString('hex');
}
```
```javascript
async function redeemAccessCode(code) {
const session = await db.startSession();
session.startTransaction();
try {
const registration = await db.collection('registrations')
.findOneAndUpdate(
{ accessCode: code, used: false },
{ $set: { used: true, usedAt: new Date() } },
{ session }
);
await session.commitTransaction();
return registration;
} catch (error) {
await session.abortTransaction();
throw error;
} finally {
session.endSession();
}
}
```
```javascript
// Write test first
describe('Access Code Generation', () => {
it('should generate unique 32-character codes', () => {
const code1 = generateAccessCode();
const code2 = generateAccessCode();
expect(code1).toHaveLength(32);
expect(code1).not.toEqual(code2);
});
});
// Then implement to pass the test
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/yah-social-enterprise-development/raw