This simple system helps Amazon customers improve their privacy while providing for others in need. It leverages the Amazon Locker infrastructure and allows users to anonymously request items they need to be securely sent to a locker. Other users can "purchase privacy" by anonymously fulfilling these requests while adding noise to their Amazon purchase profile.
We presented this project at the 3rd Workshop on Obfuscation (2021)
Let's extract money through Amazon affiliates links
associates ID: mutualsupply-20
Clone the repo...
$ cd backend
# Set up virtual env and download the requirements
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
# set up database -- also do this when pulling in models changes
$ flask db upgrade
Get the environment variables from someone and put them in file ./frontend/.env.
They should include
REACT_APP_GOOGLE_PLACES_API_KEY=
REACT_APP_AMAZON_ASSOCIATES_ID=mutualsupply-20
$ cd frontend
// also do yarn install when pulling in new changes
$ yarn install
Once it is set up
$ yarn start
http://127.0.0.1:3000/ shows the front end state
either from frontend directory
$ yarn start-api
or from backend directory
$ flask run
http://127.0.0.1:3000/ is the front end and tunnels to the backend. http://127.0.0.1:3000/api/asks
Useful tool when debugging:
$ flask shell
To clear out the database:
$ flask shell
>> clear_data(db.session)
Alembic is used to handle data migrations. Any update to models must go with a data migration.
When committing models change:
$ flask db migrate -m "message"
Review the automatically generated script in migrations/.
Update database to match the change (can also downgrade)
$ flask db upgrade
User makes a new ask.
client --> Google places API: search for lockers within zipcode.
Googles places API returns lockers. User selects locker.
POST ask: client --> server
ask {
- all the ask info...
- locker_place_id
}
All locker location info is wrapped up in the Google Place IDs. All location info is handled by Google Places API requests
GET asks:
-
user puts in location (zipcode) to front end
-
client --> Google Places API: get nearby places IDs for Amazon lockers
-
client --> server GET asks {
- locker_place_ids: [locker_place_id],
- limit: int }