forked from zopiolabs/zopio
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
π Task Overview
Sprint Day: Day 1 - Morning Session
Time Slot: 11:00 - 12:00 (1 hour)
Task Type: Collaborative Project Setup (All Team Members)
Estimated Duration: 1 hour
Dependencies: Database Schema (Issue #3)
π― Objectives
Create the escrow application structure within the Zopio monorepo, set up API routes skeleton, configure Next.js with internationalization support, and prepare the shadcn/ui component library for development.
π Detailed Requirements
1. Create Escrow App Structure
- Create new app in
apps/escrow
directory - Set up Next.js 14+ app structure with:
app/
directory for App Routercomponents/
for React componentslib/
for utilities and helpersservices/
for business logichooks/
for custom React hookstypes/
for TypeScript definitionsconstants/
for app constants
- Configure
next.config.js
with proper settings - Set up
tsconfig.json
with path aliases - Create base layout structure in
app/layout.tsx
2. API Routes Skeleton
- Create API route structure under
app/api/
:/api/escrow/
- Escrow transaction endpointscreate/route.ts
- Create new escrow[id]/route.ts
- Get/update specific escrow[id]/status/route.ts
- Update escrow status
/api/payment/
- Payment processing endpointscreate/route.ts
- Initialize paymentwebhook/route.ts
- Payment gateway webhooksverify/route.ts
- Verify payment status
/api/user/
- User management endpointsprofile/route.ts
- User profile managementverify/route.ts
- User verification
/api/otp/
- OTP verification endpointssend/route.ts
- Send OTPverify/route.ts
- Verify OTP code
/api/document/
- Document management endpointsupload/route.ts
- File upload[id]/route.ts
- Get/delete document
/api/admin/
- Admin endpointstransactions/route.ts
- List all transactionsdisputes/route.ts
- Manage disputes
- Add placeholder handlers with proper TypeScript types
- Implement basic error handling structure
3. Internationalization Setup
- Install and configure
next-intl
for i18n support - Create locale structure:
/locales/tr/
- Turkish translations/locales/en/
- English translations
- Set up translation files for:
common.json
- Common UI elementsforms.json
- Form labels and validation messagesescrow.json
- Escrow-specific termserrors.json
- Error messages
- Configure middleware for locale detection
- Implement language switcher component
- Set up locale routing (/tr, /en)
4. shadcn/ui Component Setup
- Initialize shadcn/ui with
pnpm dlx shadcn-ui@latest init
- Configure theme with brand colors
- Install essential components:
- Button, Input, Label, Textarea
- Select, Checkbox, Radio Group
- Card, Dialog, Alert, Toast
- Form (with react-hook-form integration)
- Tabs, Accordion, Progress
- Table, Badge, Avatar
- Skeleton (for loading states)
- Create
components.json
configuration - Set up dark mode support with next-themes
- Create base component exports in
components/ui/index.ts
π§ Technical Context
Project Structure Best Practices
- Separation of Concerns: Clear separation between UI, business logic, and data access
- Type Safety: Full TypeScript coverage with strict mode
- Code Organization: Feature-based organization within components
- Reusability: Shared components in the monorepo packages
- Testing Structure: Parallel test files for easy testing
API Design Principles
- RESTful conventions for resource endpoints
- Consistent error responses with proper HTTP status codes
- Request validation using Zod schemas
- Rate limiting preparation for production
- CORS configuration for frontend-backend communication
Internationalization Requirements
- RTL Support: Prepare for potential Arabic language addition
- Number Formatting: Turkish and English number formats
- Date Formatting: Locale-specific date displays
- Currency Display: TRY and USD support
- Dynamic Loading: Lazy load translations for performance
β Acceptance Criteria
- Escrow app runs independently with
pnpm dev --filter escrow
- All API route placeholders return proper responses
- Language switching works between Turkish and English
- All shadcn/ui components are properly styled
- TypeScript compilation passes without errors
- Project structure follows Zopio conventions
- Hot reload works for all file types
π₯ Team Assignments
All Team Members:
- @uozopio (Umut) - API routes structure and service layer setup
- @mbyzopio (Burak) - Page structure and form component scaffolding
- @teczopio (Enes) - UI components installation and theming
This task is part of the 2-day MVP sprint for the Paylox Escrow System