{"id":30145133,"url":"https://github.com/ryu-ryuk/re-wear","last_synced_at":"2025-09-07T11:39:10.290Z","repository":{"id":304279006,"uuid":"1018322873","full_name":"ryu-ryuk/re-wear","owner":"ryu-ryuk","description":"odoo ahh ","archived":false,"fork":false,"pushed_at":"2025-07-12T05:03:28.000Z","size":1582,"stargazers_count":0,"open_issues_count":18,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-12T05:32:02.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryu-ryuk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-12T03:08:29.000Z","updated_at":"2025-07-12T05:03:31.000Z","dependencies_parsed_at":"2025-07-12T05:32:05.918Z","dependency_job_id":"c72d0511-605d-4c70-8fa1-abf1bfb18c37","html_url":"https://github.com/ryu-ryuk/re-wear","commit_stats":null,"previous_names":["ryu-ryuk/re-wear"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ryu-ryuk/re-wear","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryu-ryuk%2Fre-wear","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryu-ryuk%2Fre-wear/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryu-ryuk%2Fre-wear/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryu-ryuk%2Fre-wear/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryu-ryuk","download_url":"https://codeload.github.com/ryu-ryuk/re-wear/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryu-ryuk%2Fre-wear/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269850366,"owners_count":24485177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-11T08:09:29.016Z","updated_at":"2025-08-11T08:09:33.495Z","avatar_url":"https://github.com/ryu-ryuk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"backend/static/logo/logo.png\" alt=\"ReWear Logo\" width=\"300\"/\u003e\n\n# ReWear – Sustainable Fashion Exchange Platform\n\n![Django](https://img.shields.io/badge/Django-092E20?style=for-the-badge\u0026logo=django\u0026logoColor=white)\n![Next.js](https://img.shields.io/badge/Next.js-000000?style=for-the-badge\u0026logo=next.js\u0026logoColor=white)\n![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge\u0026logo=typescript\u0026logoColor=white)\n![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white)\n![License](https://img.shields.io/badge/license-MIT-a6e3a1?style=for-the-badge)\n  \n\n*A community-driven platform for sustainable fashion through clothing swaps and point-based redemption*\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \n  ## ~ Demo Video ~\n\n  https://github.com/user-attachments/assets/f52e7b41-483a-4553-9a24-7cd14b5d5e74\n\n## Problem Statement\n\nReWear addresses the growing issue of textile waste by creating a platform where users can **exchange unused clothing** through direct swaps or a point-based redemption system. The platform promotes sustainable fashion practices, reduces clothing waste, and builds a community around conscious consumption.\n\n---\n\n\n## Platform Overview\n\n```mermaid\ngraph TB\n    A[User Registration] --\u003e B[100 Welcome Points]\n    B --\u003e C[Browse Items]\n    C --\u003e D{Exchange Method}\n    D --\u003e|Direct Swap| E[Swap Request]\n    D --\u003e|Use Points| F[Point Redemption]\n    E --\u003e G[Owner Approval]\n    G --\u003e|Accepted| H[Coordinate Exchange]\n    G --\u003e|Rejected| I[Try Again]\n    F --\u003e J[Instant Acquisition]\n    H --\u003e K[Both Users Earn 5 Points]\n    J --\u003e L[Points Deducted]\n    K --\u003e M[Successful Exchange]\n    L --\u003e M\n```\n\n## Team Members\n\n- **Arjith A R** - Frontend\n- **Alok** - Backend \u0026\u0026 Frontend\n- **Darunesh** - Backend\n\n## Features Implemented\n\n### Core Features\n- **User Authentication** - JWT-based registration and login with welcome bonus\n- **Item Management** - Upload, browse, search, and manage clothing items\n- **Swap System** - Direct item-to-item exchanges with negotiation\n- **Points System** - Earn and spend points for instant redemptions\n- **Search \u0026 Filtering** - Advanced search by category, condition, size, color\n- **User Dashboard** - Comprehensive activity tracking and statistics\n- **Engagement Features** - Like items, view counters, activity feeds\n- **Reporting System** - Community-driven content moderation\n\n### Technical Features\n- **RESTful API** - Complete backend API with Django REST Framework\n- **Image Handling** - Multi-image upload with optimization\n- **Admin Panel** - Custom Django admin for platform management\n- **Responsive Design** - Modern UI with Tailwind CSS and Radix UI\n- **Real-time Updates** - Activity feeds and notification system\n- **Data Validation** - Comprehensive input validation and error handling\n\n## Tech Stack\n\n### Backend\n- **Django 5.2.4** - Web framework\n- **Django REST Framework** - API development\n- **PostgreSQL** - Primary database\n- **JWT Authentication** - Secure token-based auth\n- **Pillow** - Image processing\n- **Docker** - Containerization\n\n### Frontend\n- **Next.js 15** - React framework with App Router\n- **TypeScript** - Type-safe development\n- **Tailwind CSS** - Utility-first styling\n- **Radix UI** - Accessible component library\n- **React Hook Form** - Form management\n- **Zod** - Schema validation\n\n## Quick Start\n\n### Using Docker (Recommended)\n```bash\n# Clone the repository\ngit clone https://github.com/ryu-ryuk/re-wear.git\ncd re-wear\n\n# Start the backend services\ncd backend\nmake build\nmake up\n\n# Start the frontend\ncd ../frontend\nbun install\nbun dev\n```\n\n### Manual Setup\n\n#### Backend\n```bash\ncd backend\n# Install dependencies with uv\nuv sync\n\n# Run migrations\npython manage.py migrate\n\n# Create superuser\nmake createsuperuser\n\n# Start development server\nmake build \u0026\u0026 make up\n```\n\n#### Frontend\n```bash\ncd frontend\n# Install dependencies\nbun i\n\n# Start development server\nbun dev\n```\n\n## API Documentation\n\nComplete API documentation is available at:\n\n- **Interactive Docs**: [API.md](./API.md)\n- **Swagger UI**: http://localhost:8000/swagger/\n- **ReDoc**: http://localhost:8000/redoc/\n\n### Key Endpoints\n\n#### Authentication\n- `POST /api/users/register/` - Register with welcome bonus\n- `POST /api/users/login/` - JWT token authentication\n\n#### Items\n- `GET /api/items/` - Browse items with filtering\n- `POST /api/items/` - Upload new items\n- `GET /api/items/featured/` - Featured items carousel\n- `POST /api/items/{id}/like/` - Like/unlike items\n\n#### Swaps\n- `POST /api/swaps/` - Create swap requests\n- `POST /api/swaps/{id}/accept/` - Accept swap requests\n- `POST /api/swaps/redeem/` - Redeem items with points\n\n#### User Management\n- `GET /api/users/me/` - User profile\n- `GET /api/users/dashboard/` - Dashboard analytics\n- `GET /api/users/liked_items/` - User's favorite items\n\n## Application Flow\n\n```mermaid\ngraph LR\n    A[Browse Items] --\u003e B{User Action}\n    B --\u003e|Like Item| C[Add to Favorites]\n    B --\u003e|Request Swap| D[Create Swap Request]\n    B --\u003e|Redeem Points| E[Point Redemption]\n    D --\u003e F[Owner Notification]\n    F --\u003e G{Owner Decision}\n    G --\u003e|Accept| H[Arrange Exchange]\n    G --\u003e|Reject| I[Request Denied]\n    H --\u003e J[Complete Swap]\n    J --\u003e K[Both Users +5 Points]\n    E --\u003e L[Item Transferred]\n    C --\u003e M[Saved for Later]\n```\n\n## Project Structure\n\n```\nre-wear/\n├── backend/                    # Django REST API\n│   ├── rewear/                # Project settings\n│   ├── users/                 # User management \u0026 auth\n│   ├── items/                 # Item management\n│   ├── swaps/                 # Swap system\n│   ├── admin_panel/           # Custom admin interface\n│   ├── media/                 # User uploaded files\n│   ├── static/                # Static assets\n│   ├── Dockerfile             # Backend containerization\n│   ├── docker-compose.yml     # Multi-service setup\n│   ├── Makefile              # Development commands\n│   └── test_*.py             # Comprehensive test suite\n│\n├── frontend/                  # Next.js application\n│   ├── src/\n│   │   ├── app/              # App router pages\n│   │   ├── components/       # Reusable UI components\n│   │   ├── hooks/            # Custom React hooks\n│   │   └── lib/              # Utilities and config\n│   ├── public/               # Static assets\n│   └── package.json          # Dependencies\n│\n├── API.md                    # Complete API documentation\n└── README.md                 # This file\n```\n\n## Development Commands\n\n### Backend\n```bash\n# Using Makefile\nmake up          # Start all services with Docker\nmake down        # Stop all services\nmake build       # Rebuild containers\nmake logs        # View logs\nmake shell       # Access Django shell\nmake test        # Run test suite\n\n# Manual commands\npython manage.py runserver              # Start development server\npython manage.py migrate                # Apply database migrations\npython manage.py createsuperuser        # Create admin user\npython manage.py collectstatic          # Collect static files\n```\n\n### Frontend\n```bash\nbun dev          # Start development server\nbun build        # Build for production\nbun start        # Start production server\nbun lint         # Run ESLint\n```\n\n## Testing\n\nThe project includes comprehensive test suites:\n\n- `test_api.py` - Basic API functionality\n- `test_comprehensive_swaps.py` - Complete swap flow testing\n- `test_docker_image_upload.py` - Image upload functionality\n- `test_docker_redemption.py` - Points redemption system\n- `test_error_responses.py` - Error handling validation\n\nRun tests:\n```bash\ncd backend\npython test_comprehensive_swaps.py\n```\n\n## Database Schema\n\n```mermaid\nerDiagram\n    User ||--o{ Item : owns\n    User ||--o{ SwapRequest : creates\n    User ||--o{ ItemLike : likes\n    User ||--o{ ItemReport : reports\n    Item ||--o{ ItemImage : has\n    Item ||--o{ SwapRequest : \"requested_item\"\n    Item ||--o{ SwapRequest : \"offered_item\"\n    Item ||--o{ ItemLike : receives\n    Item ||--o{ ItemReport : \"reported_item\"\n    \n    User {\n        int id PK\n        string username\n        string email\n        int points\n        string location\n        bool is_private\n    }\n    \n    Item {\n        int id PK\n        int owner_id FK\n        string title\n        text description\n        string category\n        string condition\n        int point_value\n        string status\n        bool is_approved\n        bool is_featured\n    }\n    \n    SwapRequest {\n        int id PK\n        int requester_id FK\n        int requested_item_id FK\n        int offered_item_id FK\n        string status\n        text message\n    }\n```\n\n## Environment Variables\n\n### Backend (.env)\n```bash\nDEBUG=True\nSECRET_KEY=your-secret-key\nDATABASE_URL=postgresql://user:password@localhost:5432/rewear\nALLOWED_HOSTS=localhost,127.0.0.1\nCORS_ALLOWED_ORIGINS=http://localhost:3000\n```\n\n### Frontend (.env.local)\n```bash\nNEXT_PUBLIC_API_URL=http://localhost:8000/api\n```\n\n## Production Deployment\n\n### Backend (Django)\n1. Set `DEBUG=False` in production\n2. Configure proper `ALLOWED_HOSTS`\n3. Use PostgreSQL database\n4. Set up proper media file serving\n5. Configure CORS for frontend domain\n\n### Frontend (Next.js)\n1. Update `NEXT_PUBLIC_API_URL` to production API\n2. Build and deploy using Vercel, Netlify, or similar\n3. Ensure proper environment variables are set\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## Known Limitations\n\n- **Admin Panel**: Basic implementation, could use more sophisticated moderation tools\n- **Real-time Notifications**: Currently using polling, could implement WebSocket for real-time updates\n- **Payment Integration**: Points system is internal, no monetary transactions\n- **Mobile App**: Web-only platform, native mobile app not developed\n- **Advanced Search**: Basic search implemented, could add ML-based recommendations\n\n## Future Enhancements\n\n- Real-time chat between swap partners\n- Machine learning-based item recommendations\n- Integration with shipping services for remote swaps\n- Mobile application for iOS and Android\n- Advanced analytics dashboard for users\n- Social features (following users, sharing collections)\n- Integration with sustainable fashion brands\n\n## License\n\nThis project was developed for a hackathon and is available under the MIT License.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n![Made with Love](https://img.shields.io/badge/Made%20with-❤️-red.svg)\n![Sustainable Fashion](https://img.shields.io/badge/Sustainable-Fashion-green.svg)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryu-ryuk%2Fre-wear","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryu-ryuk%2Fre-wear","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryu-ryuk%2Fre-wear/lists"}