This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a neighbor-to-neighbor delivery management system for condominiums with a Django REST API backend and Next.js React frontend. The system enables residents within the same condominium to act as delivery persons (repartidevs) for their neighbors, creating a community-based delivery network where residents can help each other by delivering items within the building.
cd backend-api
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Or using pyenv: pyenv activate ican_project
# Install dependencies
pip install -r requirements.txt
# Run migrations
python manage.py migrate
# Create superuser
python manage.py createsuperuser
# Run development server
python manage.py runserver
# Run tests
python manage.py test
# Run specific app tests
python manage.py test users
python manage.py test services
python manage.py test condominiumscd frontend
# Install dependencies
npm install
# Run development server
npm run dev
# Build for production
npm run build
# Start production server
npm run start
# Run linting
npm run lintRequired environment variables:
SECRET_KEY: Django secret keyDEBUG: Debug mode (True/False)DJANGO_ALLOWED_HOSTS: Comma-separated allowed hostsDB_NAME,DB_USER,DB_PASSWORD,DB_HOST,DB_PORT: PostgreSQL configurationEMAIL_HOST_USER,EMAIL_HOST_PASSWORD: Gmail SMTP credentialsDOMAIN: Domain for activation emailsAUTH_COOKIE_SECURE: HTTPS cookie setting (True/False)GOOGLE_AUTH_KEY,GOOGLE_AUTH_SECRET_KEY: Google OAuth2 credentialsCORS_ALLOWED_ORIGINS: Comma-separated frontend URLsREDIRECT_URLS: Comma-separated OAuth redirect URLs
NEXT_PUBLIC_HOST: Backend API URL (e.g., http://localhost:8000)
- JWT tokens stored in HTTP-only cookies (backend-api/users/authentication.py:4-21)
- Frontend uses RTK Query with automatic token refresh (frontend/src/redux/services/apiSlice.js:13-48)
- Supports both email/password and Google OAuth2 authentication
- Users App: Authentication, user management, and roles (Receiver, Deliverer, Both)
- Condominiums App: Buildings and departments management
- Services App: Orders, payments, reviews, and service types
- Redux Toolkit with RTK Query for API calls
- Authentication state managed in authSlice
- API endpoints extended from base apiSlice
- API-First Design: All frontend features consume REST APIs
- Cookie-Based Auth: Secure HTTP-only cookies for JWT storage
- Internationalization: Built-in i18n support (EN/ES) in Next.js
- Role-Based Access: Residents can be receivers, deliverers (repartidevs), or both
- Community-Based Model: Deliverers are neighbors within the same condominium, not external delivery services
- UserAccount: Custom user model with role field
- Condominium: Buildings with related departments
- Department: Tower/floor organization within condominiums
- ServiceType: Types of services (currently delivery)
- Order: Full order lifecycle with status tracking
- Payment: Cash and card payment support
- Review: Service and order rating system
- Authentication:
/api/auth/(Djoser endpoints) - JWT:
/api/jwt/create/,/api/jwt/refresh/,/api/jwt/verify/ - Condominiums:
/api/condominiums/ - Services:
/api/services/ - Orders:
/api/orders/ - Payments:
/api/payments/
- Django unit tests in each app's tests.py
- Frontend testing setup pending (no test files found)
- Run Django tests with
python manage.py testfrom backend-api/
- Create serializer in app's serializers.py
- Create viewset in app's views.py
- Register in app's urls.py
- Update backend/urls.py if new app
- Create API endpoint in Redux slice
- Add component in src/components/
- Create page in src/app/[locale]/
- Update translations in public/locales/
- Modify models in app's models.py
- Run
python manage.py makemigrations - Run
python manage.py migrate