Inspiration
In the UK, the average person owns 115 items of clothing, 30 of which have never been worn. Many of these end up in countries like India, where they pollute our local environment. These clothes would do so much more if they went to a better home. The world is in the middle of an ecological crisis and a cost-of-living meltdown, and yet there is an increasing obsession with "fast fashion" and always having the latest clothes. Recycling and reusing clothes is an easy way to save money and save the planet, within your normal routine.
The concept of second-hand clothes is not new; for instance Vinted is a popular app which allows users to sell their old clothes and it is doing well, while websites like freecycle allow you to give away unwanted items for free, though they specialise in furniture rather than clothes.
What it does
We saw a gap in the market for an app which enables users to trade old clothes for other ones. Users can add the clothes they have to the app, and add the clothes they want. The app automatically finds cycles within its users which enable many users to trade clothes in large "n-way swaps" where users can receive clothes from someone and send their clothes to someone else, a unique feature of the app which increases the chance of finding a swap. There's a leaderboard and participants can collect points based on the amount of air miles and water saved in swapping old clothes rather than buying new ones, while the swap map helps users to imagine the new life their clothes will lead when donated, and get excited about those they will receive from afar.
How we built it
We wrote a Python Flask backend which interfaces with the Cockroach DB PostgreSQL server, wherein the users' information is stored, a lightweight frontend with HTML and CSS. The matching is done through a cycle-finding algorithm on a directed unweighted graph. First, Quentin setup the Flask backend while Tom built some of the frontend structure and Hamish worked on the DB schema as well as the graph model. The frontend and backend were then combined with the database, which was first tested using an offline database on Quentin's server. We then ported to Cockroach DB. The pages were created with static data and then finally updated to include data from the database.
Challenges we ran into
- Coming up with an idea which was simultaneously feasible and sufficiently original (ours is, by our own admission, not necessarily that original).
- Completing the project in the time available, which was limited.
- Testing effectively when everything was on our own separate computers and avoiding merge conflicts with git --> this was especially an issue due to working remotely.
Accomplishments that we're proud of
- Building a substantial project in a short space of time, even if it wasn't quite finished.
- Structuring our code effectively to minimise wastage and reflect software engineering best practices /where possible/
What we learned
Tom:
I had limited knowledge of Jinja2 and thus learnt a lot as I very quickly had to learn how to use it and have it work in tandem with both Flask and the stylised front end. I had limited experience with anything other than python so pushed myself out of my comfort zone by participating in this Hackathon! It was a very worthwhile and fun experience. : )
Quentin:
In this project I learnt a lot more about SQL, using more advanced operations such as inner joins. I also learnt more about graph theory, and how to apply it in the context of N-way swapping. I also learnt how to create a docker image using a dockerfile, and deploying it to a remote server.
Hamish:
I learnt new ways of using Python Flask; while I had some experience with it I mostly used PHP before. I gained a new experience of using cloud databases and the PostgreSQL variant (having previously used MySQL), and most of all, I learnt to work effectively in a team to complete a software development project, seeing as this was my first Major League Hackathon.
Some ideas for how we could extend Swapify
- Introduce one-way giving transactions where users give old clothes to clothing banks, charity shops or refugees (e.g. Ukraine) and don't expect anything in return.
- Add tags to the items so that users can see the brands and sizes of the items they are receiving
- Get users to video themselves opening the clothes they receive and feature them on the website and social media to generate more hype around the brand.
Use of MLH Sponsored Technology
We are grateful to the sponsors of MLH hackathons for providing their technology free of charge to participants, so that we could have an effective development experience.
- GitHub:
- We used the GitHub Projects / Todo List feature for the first time to organise our project and tasks
- We used a Github Actions workflow to generate a Docker image for deployment of the website to a server.
- We used Git, branches and merges to collaborate effectively remotely without overwriting each others' work, and to track changes.
- We made use of the README to display our project.
- CockroachDB
- We used CockroachDB for the first time and we were extremely impressed with how seamless and easy it was to set up a database server and push data to it
- The cloud based nature made for a much less frustrating debugging and testing experience.
- It was easy to connect to the DB both from the client and programmatically, and easy to add data and run all sorts of SQL commands.
To Conclude
This was an awesome opportunity for us; the entire team had a great deal of fun and thoroughly enjoyed the challenge of working as a remote team.
Log in or sign up for Devpost to join the conversation.