Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

35 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Clothes Swapper

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.

License GitHub stars GitHub forks GitHub issues GitHub pull requests GitHub last commit

JavaScript React NodeJS Express MongoDB MUI

πŸ“‹ Table of Contents

About

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.

✨ Features

  • 🎯 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 start

Open http://localhost:3000 to view it in your browser.

πŸ“¦ Installation

Prerequisites

  • Node.js 18+ and npm
  • Git
  • MongoDB account and connection string

Option 1: From Source

# Clone repository
git clone https://github.com/MokshShahh/clothes-swapper.git
cd clothes-swapper

# Install dependencies
npm install

# Start development server
npm run dev

πŸ’» Usage

Basic Usage

  1. Register an account or log in.
  2. Browse existing swapping events or create your own.
  3. List the clothes you want to swap with descriptions and images.
  4. Communicate with other participants through the messaging system.

Creating an Event

// 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));

Adding an Item

// 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));

βš™οΈ Configuration

Environment Variables

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_key

πŸ“ Project Structure

clothes-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

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Quick Contribution Steps

  1. 🍴 Fork the repository
  2. 🌟 Create your feature branch (git checkout -b feature/AmazingFeature)
  3. βœ… Commit your changes (git commit -m 'Add some AmazingFeature')
  4. πŸ“€ Push to the branch (git push origin feature/AmazingFeature)
  5. πŸ”ƒ Open a Pull Request

Development Setup

# 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

Code Style

  • Follow existing code conventions
  • Run npm run lint before committing
  • Add tests for new features
  • Update documentation as needed

Testing

To run the tests, execute the following command:

npm test

This will run all tests defined in the tests directory.

Deployment

Vercel

The client application can be easily deployed to Vercel.

  1. Create a Vercel account and install the Vercel CLI.
  2. Run vercel in the client directory.
  3. Follow the prompts to link your project and deploy.

Heroku

The server application can be deployed to Heroku.

  1. Create a Heroku account and install the Heroku CLI.
  2. Create a new Heroku app.
  3. Set the necessary environment variables in the Heroku app settings.
  4. Push the server code to the Heroku app.
# Deploy the server to Heroku
git push heroku main

FAQ

Q: 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.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

License Summary

  • βœ… Commercial use
  • βœ… Modification
  • βœ… Distribution
  • βœ… Private use
  • ❌ Liability
  • ❌ Warranty

πŸ’¬ Support

πŸ™ Acknowledgments

  • 🎨 Design inspiration: Material UI
  • πŸ“š Libraries used:
  • πŸ‘₯ Contributors: Thanks to all contributors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages