Swap clothes with your friends and community!
A web application to easily organize and manage clothes swapping events built for the odoo hackathon round 1.
- About
- Features
- Demo
- Quick Start
- Installation
- Usage
- Configuration
- Project Structure
- Contributing
- Testing
- Deployment
- FAQ
- License
- Support
- Acknowledgments
Clothes Swapper is a web application designed to facilitate clothes swapping events within communities. It addresses the challenge of decluttering wardrobes sustainably and affordably by connecting individuals who wish to exchange clothing items. The application aims to reduce textile waste, promote eco-conscious consumption, and foster community engagement through organized swapping events.
The target audience includes environmentally conscious individuals, fashion enthusiasts looking for affordable alternatives, and community organizers seeking to host sustainable events. Clothes Swapper utilizes a MERN (MongoDB, Express.js, React.js, Node.js) stack architecture, providing a robust and scalable platform for managing user accounts, event listings, and item details.
The unique selling point lies in its user-friendly interface, comprehensive event management features, and focus on promoting sustainable practices within the fashion industry. It provides a space for users to connect, share their style, and contribute to a more circular economy.
- π― User Authentication: Secure registration, login, and profile management.
- π Item Listing: Ability to list clothes with descriptions, sizes, and images.
- π Search and Filtering: Robust search functionality to find events or items based on location, category, and keywords.
- π¨ UI/UX: Intuitive and responsive design using Material UI for a seamless user experience.
- π± Responsive: Cross-platform compatibility accessible on desktops, tablets, and mobile devices.
Clone and run in 3 steps:
git clone https://github.com/MokshShahh/clothes-swapper.git
cd clothes-swapper
npm install && npm startOpen http://localhost:3000 to view it in your browser.
- Node.js 18+ and npm
- Git
- MongoDB account and connection string
# Clone repository
git clone https://github.com/MokshShahh/clothes-swapper.git
cd clothes-swapper
# Install dependencies
npm install
# Start development server
npm run dev- Register an account or log in.
- Browse existing swapping events or create your own.
- List the clothes you want to swap with descriptions and images.
- Communicate with other participants through the messaging system.
// Example event object
const event = {
title: 'Summer Clothes Swap',
date: '2024-07-20',
location: 'Community Center',
description: 'Swap your summer clothes with others!',
organizer: 'user123'
};
// Send to the backend API
fetch('/api/events', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(event)
}).then(response => response.json())
.then(data => console.log(data));// Example item object
const item = {
name: 'Summer Dress',
size: 'M',
description: 'Light and airy summer dress.',
imageUrl: 'https://example.com/dress.jpg',
owner: 'user123'
};
// Send to the backend API
fetch('/api/items', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(item)
}).then(response => response.json())
.then(data => console.log(data));Create a .env file in the root directory:
# Database
MONGODB_URI=mongodb+srv://<username>:<password>@cluster0.mongodb.net/clothes-swapper
# Server
PORT=3000
NODE_ENV=development
# JWT Secret
JWT_SECRET=your_jwt_secret_keyclothes-swapper/
βββ π client/
β βββ π src/
β β βββ π components/ # Reusable UI components
β β βββ π pages/ # Application pages
β β βββ π context/ # React Contexts
β β βββ π styles/ # CSS/styling files
β β βββ π App.js # Application entry point
β β βββ π index.js # React DOM render
β βββ π public/ # Static assets
β βββ π package.json # Client dependencies
β βββ π README.md
βββ π server/
β βββ π models/ # Mongoose models
β βββ π routes/ # API routes
β βββ π controllers/ # Route handlers
β βββ π config/ # Configuration files
β βββ π server.js # Express server entry point
β βββ π package.json # Server dependencies
βββ π .env.example # Environment variables template
βββ π .gitignore # Git ignore rules
βββ π package.json # Project dependencies
βββ π README.md # Project documentation
βββ π LICENSE # License file
We welcome contributions! Please see our Contributing Guide for details.
- π΄ Fork the repository
- π Create your feature branch (
git checkout -b feature/AmazingFeature) - β
Commit your changes (
git commit -m 'Add some AmazingFeature') - π€ Push to the branch (
git push origin feature/AmazingFeature) - π Open a Pull Request
# Fork and clone the repo
git clone https://github.com/yourusername/clothes-swapper.git
# Install dependencies (client and server)
cd clothes-swapper/client && npm install
cd ../server && npm install
# Create a .env file in the server directory
# Start the development servers (client and server)
cd clothes-swapper/client && npm start
cd ../server && npm start- Follow existing code conventions
- Run
npm run lintbefore committing - Add tests for new features
- Update documentation as needed
To run the tests, execute the following command:
npm testThis will run all tests defined in the tests directory.
The client application can be easily deployed to Vercel.
- Create a Vercel account and install the Vercel CLI.
- Run
vercelin theclientdirectory. - Follow the prompts to link your project and deploy.
The server application can be deployed to Heroku.
- Create a Heroku account and install the Heroku CLI.
- Create a new Heroku app.
- Set the necessary environment variables in the Heroku app settings.
- Push the server code to the Heroku app.
# Deploy the server to Heroku
git push heroku mainQ: How do I create a new event? A: Log in to your account and click on the "Create Event" button. Fill in the event details and submit the form.
Q: How do I list an item for swapping? A: Go to your profile page and click on the "Add Item" button. Provide the item details, upload an image, and submit the form.
Q: How do I contact other participants? A: Use the built-in messaging system to communicate with other event attendees.
This project is licensed under the MIT License - see the LICENSE file for details.
- β Commercial use
- β Modification
- β Distribution
- β Private use
- β Liability
- β Warranty
- π§ Email: moksh.shah2001@gmail.com
- π Issues: GitHub Issues
- π¨ Design inspiration: Material UI
- π Libraries used:
- π₯ Contributors: Thanks to all contributors