diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..9ee86c5 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,260 @@ +# GitQuest Agent Development Guide + +This guide provides essential information for AI agents working on the GitQuest codebase - a full-stack GitHub-integrated platform with Next.js frontend and ASP.NET Core backend. + +## Project Architecture + +### Frontend (Next.js 16 + TypeScript) +- **Location**: `/frontend` +- **Framework**: Next.js with App Router +- **Styling**: Tailwind CSS + Shadcn/ui components +- **State**: React hooks + HTTP-only cookies for auth +- **API Client**: Custom wrapper in `lib/api.ts` + +### Backend (ASP.NET Core 8) +- **Location**: `/Backend/Backend` +- **Database**: SQL Server with Entity Framework Core +- **Authentication**: GitHub OAuth + JWT Bearer tokens +- **API**: RESTful endpoints with Swagger documentation + +## Build/Lint/Test Commands + +### Frontend Development +```bash +cd frontend +npm install # Install dependencies +npm run dev # Start dev server (http://localhost:3000) +npm run build # Production build +npm run start # Run production build +npm run lint # Run ESLint +``` + +### Backend Development +```bash +cd Backend/Backend +dotnet restore # Restore NuGet packages +dotnet build # Compile application +dotnet run # Start dev server (http://localhost:5198) +dotnet watch run # Run with hot reload +``` + +### Running Both Services +```powershell +# Use the provided startup script +.\start-gitquest.ps1 +``` + +### Testing +```bash +# No formal testing framework currently implemented +# Use .http files for API testing: +# - Backend/Backend/test-login.http +# - Manual OAuth flow testing via browser + +# For single endpoint testing: +# Use VS Code REST Client with .http files +``` + +## Code Style Guidelines + +### TypeScript/Frontend Conventions + +**Imports and Path Mapping**: +```typescript +// Use absolute imports with @ alias +import { Component } from "@/components/ui/component" +import { api } from "@/lib/api" + +// Type-only imports +import type { ApiResponse, GitHubIssue } from "@/lib/api" + +// External dependencies +import { Analytics } from '@vercel/analytics/next' +``` + +**Component Structure**: +```typescript +// Use function components with TypeScript +interface ComponentProps { + id: string; + isActive?: boolean; +} + +export function Component({ id, isActive = false }: ComponentProps) { + return
Failed to load issues: {error}
+Loading issues...
+ {issue.description.slice(0, 100)}... +
+ )} +{user.username}
++ @{user.username} +
+Failed to load leaderboard: {error}
+ +Loading leaderboard...
+@{user.username}
+ +@{user.gitHubUsername}
@{user.username}
+ +@{user.gitHubUsername}
@{profile.username}
+Open Source Contributor
{100 - xpInCurrentLevel} XP Remaining
+- {(profile.nextLevelXp - profile.xp).toLocaleString()} XP to next level -
+{profile.stats.issuesResolved}
-Issues Resolved
-{profile.stats.pullRequests}
-Pull Requests
-{profile.stats.projectsContributed}
-Projects
-{(profile.stats.linesOfCode / 1000).toFixed(1)}k
-Lines of Code
-{badge.name}
-- {project.contributions} contributions -
-Showing your latest verified quests
Member since
-{profile.joinedDate}
-Longest Streak
-{profile.longestStreak} days
-Member Since
+March 2026
+{contribution.title}
-{contribution.date}
+{label}
{repo}
+