AI GUIDE to Kangalos Frontend
Guides AI agents through a Next.js project management platform's structure, conventions, and contribution workflow.
What this file does
Guides AI agents through a Next.js project management platform's structure, conventions, and contribution workflow.
When to use it
- Onboarding a new AI agent to contribute to the Kangalos frontend
- Setting up a Next.js project with i18n and feature folders
- Defining AI-friendly coding and PR guidelines for a team
Assumes this stack
AI GUIDE to Kangalos Frontend
Welcome to the Kangalos Frontend Codebase! This file is designed to help AI agents understand, navigate, and contribute to this project efficiently and in line with our standards.
Project Overview
Kangalos is a modern, full-featured project management platform built with Next.js (App Router, TypeScript), React 19, and Tailwind CSS. It serves as a unified hub for managing research projects, student theses, community innovations, and externally funded initiatives at the University of Rwanda and its partner institutions.
Key Technologies
- Next.js 15+ (App Router, SSR, API routes)
- TypeScript (strict mode)
- React 19 (functional components, hooks)
- Tailwind CSS (utility-first styling)
- Radix UI (accessible UI primitives)
- Zod (schema validation)
- React Hook Form (forms)
- next-intl (i18n, translations)
- TanStack React Query (data fetching and caching)
Folder Structure
/src/app– Next.js app directory (routing, layouts, pages)/src/components– Reusable UI components (atomic design)/src/features– Domain-driven feature modules (auth, users, reports, projects etc.)/src/messages– Translation files (JSON, one per locale)/src/i18n– Internationalization logic (routing, helpers)/public– Static assets (images, favicons)
Internationalization
- Uses
next-intlfor translations and locale routing. - Supported locales:
en,fr,ko(see/src/messages). - All user-facing text must be translatable using the translation system.
Coding Conventions
- All code must be written in TypeScript.
- Use functional React components and hooks.
- Follow the existing code style (see
.eslintrc, Prettier if present). - Use Tailwind CSS for all styling; avoid custom CSS unless necessary.
- Name files and components using PascalCase for components, kebab-case for folders.
- Add JSDoc comments for complex logic and exported functions.
Features Folder
- Each domain (e.g., auth, users, reports) has its own folder in
/src/features. - Feature folders contain components, hooks, services, schemas, and types related to that domain.
Translations
- All strings must be placed in the appropriate JSON file in
/src/messages. - Use the
useTranslationshook fromnext-intlin components. - use the file at src\app[locale]\test\page.tsx as an example to see how translations was made
Testing & Verification
- Always run
npm run lintand thennpm run buildafter each task to verify code quality and build integrity. - If tests are present, run
npm testbefore submitting code.
Pull Request Guidelines
When creating a PR (or when you change features locally):
- if they are related to one feature maintain a markdown file in the pr directory
- Include a clear, descriptive title and summary of changes.
- Reference any related issues.
- Ensure all code passes lint and build checks.
- Add screenshots for UI changes.
- Keep PRs focused on a single concern or feature.
- Ensure all user-facing text is translatable.
Best Practices for AI
- Analyze the
/src/featuresand/src/messagesfolders for context before generating code. - Use existing patterns for API calls, error handling, and state management.
- Prefer composition over inheritance in React components.
- Keep components small and focused; split logic into hooks/services as needed.
- Use Zod for schema validation and React Hook Form for forms.
- Document any new utilities or helpers.
Implementing components and adding them to pages
- use the file located in tasks\ui-components-tasks.md to implement all tasks
- after implementing a task please mark it as completes in that file and how you did it please
Example: Adding a New Feature
- Create a new folder in
/src/features(e.g.,/src/features/projects). - Add components, hooks, and services as needed.
- Add translation keys to all
/src/messages/*.jsonfiles. - Use the translation system for all UI text.
- Run
npm run lintandnpm run buildto verify.
Example: Adding a Translation
- Add the new key to all locale files in
/src/messages. - Use the
useTranslationshook to access the key in your component.
Additional Notes
- Do not modify files in
/publicdirectly except for static assets. - Do not hardcode any user-facing text; always use translations.
- Use environment variables for secrets and API endpoints.
What's inside
14 sections covering project overview, tech stack, folder structure, i18n, coding conventions, features, translations, testing, PR guidelines, and examples.
Change this for your project
- Replace
eric2003tu/Kangalos-fewith your own repository name - Replace
University of Rwandawith your own organization or context - Replace supported locales
en,fr,kowith your own set - Replace
tasks/ui-components-tasks.mdwith your own task file path
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Feature folder per domain under
/src/featureswith components, hooks, services, schemas, and types - Mandatory translation key addition to all locale files before using any user-facing text
- PR checklist that includes lint, build, and screenshots for UI changes
Related Documents
System Prompt
Defines the identity, capabilities, response style, and spec workflow for an AI assistant named Kiro that helps developers build features incrementally.
World Engine AI Coding Instructions
Defines game scope, architecture, ESLint rules, git workflow, and open-source research policy for a strategic fantasy RPG project.
GitHub Copilot Instructions
Defines coding standards, architecture rules, PR expectations, and output format for a Laravel + Inertia + Vue 3 project.
Business Intelligence Dashboard - Comprehensive GitHub Copilot Instructions
Defines the full stack, setup commands, security rules, and testing strategy for a Next.js SaaS analytics platform with multi-tenant isolation.