CLAUDE.md
src/services/CLAUDE.mdCLAUDE.md
Quality
54/100
Scores the file, not the repository.Length
249 words
7 headings · 5 code blocksRepository
3
— · pushed 123 days agoLast changed
3 days ago
First indexed 3 days ago.1# Services Directory23## Structure45```6services/7├── api/8│ ├── client.ts # Axios instance setup9│ ├── interceptors.ts # Request/response interceptors10│ └── endpoints.ts # API endpoint constants11├── authService.ts # Auth-related API calls12├── userService.ts # User-related API calls13└── index.ts # Barrel exports14```1516## Factory Function Pattern1718Create service instances with configured client:1920```ts21// authService.ts22import { apiClient } from "./api/client";23import { AUTH_ENDPOINTS } from "./api/endpoints";2425interface iLoginPayload {26 email: string;27 password: string;28}2930interface iLoginResponse {31 token: string;32 user: iUser;33}3435export const authService = {36 login: async (payload: iLoginPayload): Promise<iLoginResponse> => {37 const response = await apiClient.post(AUTH_ENDPOINTS.LOGIN, payload);38 return response.data;39 },4041 logout: async (): Promise<void> => {42 await apiClient.post(AUTH_ENDPOINTS.LOGOUT);43 },4445 refreshToken: async (): Promise<string> => {46 const response = await apiClient.post(AUTH_ENDPOINTS.REFRESH);47 return response.data.token;48 },49};50```5152## Endpoint Constants5354```ts55// endpoints.ts56export const AUTH_ENDPOINTS = {57 LOGIN: "/auth/login",58 LOGOUT: "/auth/logout",59 REFRESH: "/auth/refresh",60} as const;6162export const USER_ENDPOINTS = {63 GET_PROFILE: "/users/profile",64 UPDATE_PROFILE: "/users/profile",65} as const;66```6768## Axios Client Setup6970```ts71// client.ts72import axios from "axios";73import { setupInterceptors } from "./interceptors";7475export const apiClient = axios.create({76 baseURL: process.env.NEXT_PUBLIC_API_URL,77 timeout: 10000,78 headers: {79 "Content-Type": "application/json",80 },81});8283setupInterceptors(apiClient);84```8586## Response Types8788Always type API responses:8990```ts91interface iApiResponse<T> {92 data: T;93 message: string;94 success: boolean;95}9697interface iPaginatedResponse<T> extends iApiResponse<T[]> {98 pagination: {99 page: number;100 limit: number;101 total: number;102 };103}104```105106## Error Handling107108Use async/await with try/catch in thunks, let interceptors handle common errors.109
Also in PluteoJS/next-js-typescript-starter
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| PluteoJS/next-js-typescript-starter.cursor/rules/project-structure.mdc · 3 | Cursor rules | stylearch | 33/100 | 3 days ago | |
| PluteoJS/next-js-typescript-starter.cursor/rules/project-ui-style-guide.mdc · 3 | Cursor rules | lint-formatstylearchui+1 | 77/100 | 3 days ago | |
| PluteoJS/next-js-typescript-starter.cursor/rules/react-component.mdc · 3 | Cursor rules | stylearchtypesui+1 | 66/100 | 3 days ago | |
| PluteoJS/next-js-typescript-starter.cursor/rules/react-typescript.mdc · 3 | Cursor rules | stylearchtypesui | 58/100 | 3 days ago | |
| PluteoJS/next-js-typescript-starter.cursor/rules/shadcn-usage.mdc · 3 | Cursor rules | uido-not | 40/100 | 3 days ago | |
| PluteoJS/next-js-typescript-starter.cursor/rules/typescript-coding.mdc · 3 | Cursor rules | styletypesdocs | 58/100 | 3 days ago | |
| PluteoJS/next-js-typescript-starterCLAUDE.md · 3 | CLAUDE.md | lint-formatarchtypesdo-not | 88/100 | 3 days ago | |
| PluteoJS/next-js-typescript-startersrc/components/CLAUDE.md · 3 | CLAUDE.md | archdo-not | 47/100 | 3 days ago | |
| PluteoJS/next-js-typescript-startersrc/store/CLAUDE.md · 3 | CLAUDE.md | stylearch | 58/100 | 3 days ago |
Diff against .cursor/rules/project-structure.mdc Diff against .cursor/rules/project-ui-style-guide.mdc Diff against .cursor/rules/react-component.mdc Diff against .cursor/rules/react-typescript.mdc Diff against .cursor/rules/shadcn-usage.mdc Diff against .cursor/rules/typescript-coding.mdc Diff against CLAUDE.md Diff against src/components/CLAUDE.md Diff against src/store/CLAUDE.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.4k | CLAUDE.md | setupbuildstylearch+2 | 100/100 | 3 days ago | |
| Adit-Jain-srm/NightmareNetCLAUDE.md · 45 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 3 days ago | |
| microsoft/playwrightCLAUDE.md · 94k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| dotCMS/corecore-web/CLAUDE.md · 949 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 3 days ago | |
| dotCMS/coreCLAUDE.md · 949 | CLAUDE.md | setupbuildteststyle+7 | 99/100 | today | |
| lollipopkit/flutter_server_boxCLAUDE.md · 8.3k | CLAUDE.md | buildteststylearch+2 | 98/100 | 3 days ago | |
| carrot-foundation/middle-earthCLAUDE.md · 0 | CLAUDE.md | setupbuildtestlint-format+6 | 97/100 | 3 days ago | |
| caliber-ai-org/ai-setupCLAUDE.md · 1.2k | CLAUDE.md | buildtestlint-formatstyle+1 | 97/100 | 3 days ago |
