A React-Native mobile app designed to facilitate Electronic Device Trading.
Evan O'Shea
Aristotle Jalalianfard
Erin Antoine
Kyle Robers
- Firebase Authentication used in tandem with MySql DB in order to login and retrieve user information
- React Native's Stack and Tab navigators implemented to manage user navigation
- Google Places API used to autocomplete user input (for Address) while registering
- AWS Amplify & S3 integrated to work with Expo-client ImagePicker component, so user can upload/take an image from their phone
Author: Evan O'Shea
Global Context isReady
was made to keep track of when user updates one of 3 lists (Items, Trades, Bookmarks).
This limits when AJAX requests are made to only occur when inputs from the user are detected.
Object:
const [isReady, setIsReady] = useState({
yourItems: true,
trades: true,
bookmarks: true
})
Examples:
- User adds a new device, hence new GET req for yourItems permitted.
- User Bookmarks another item, hence new GET req for yourBookmarks permitted
- Displays User's added devices
- Global Context
isReady
used to limits pull requests only when list changes (mentioned above)
- 3-stage trading process. Status is either Proposed, Approved, or Completed. This allows a proposer to Accept the trade, hence Confirming it once the recipient of the trade proposition Approves it.
- Global Context only pulls from trades if trade is proposed by user or refresh button is clicked
- Toggle Button allows user to change views, between trades they Proposed and trades they are Offered
- Uses Global context to ONLY pull from bookmarks after each time an item is bookmarked (reduces unnecessary AJAX requests)
- Items that are Yours cannot be bookmarked (bookmark button doesn't display)
- Items that are already bookmarked by you displays a disabled grey button
Author: Erin Antoine
- View item details/current owner information
- Ability to bookmark items for later viewing/trading
- React Native's Stack and Tab navigators implemented to manage user navigation
- Ability to propose a trade from your devices (items that have been previously added to the account via "Add Items" screen)
- All information about a device is presented upon navigation to the Item Details screen (item name, description, condition) along with a clear image of the item available for trade
- Information about the current owner is also available upon navigation to the Item Details screen (name, location, short owner tagline) along with an avatar of the user (if they uploaded to their account)
- Items will be added to bookmarks table of database, which can later be accessed via the Home screen
- Items that are Yours cannot be bookmarked (bookmark button doesn't display)
- Items that are already bookmarked by you displays a disabled grey button
- From the Item Details screen, one can navigate to the previous page (where item image was originally clicked-Home or Search screens) by clicking "Back"
- Users may navigate to the Propose Trade screen via the button at the bottom of the Item Details screen (unless it is the user's item)
- From the Propose Trade screen, one can navigate to the previous page by clicking "Item Details", and any changes to the propose trade form will not be saved
- Users will select from their devices to trade (represented by round avatars in the first section of the screen)
- On press, your selected device will be highlighted in blue
- You can preview the trade before submission in the second section of the screen (images of both devices will be displayed)
- Submit your proposal by clicking on the "Propose Trade" button at the bottom of the screen
- View trade progress via the Home screen
Author: Aristotle Jalalianfard
- fill in
- notes
- notes
- notes
- notes
Author: Kyle Robers
- fill in
- notes
- notes
- notes
- notes
Login | Register (with Google Places Address AutoComplete) | Trade Process |
---|---|---|
![]() |
![]() |
![]() |
- Clone repo
- run
npm install
- Open terminal for expo client. Run
npm start
- Open terminal for node server (to communicate wit your db). Run
npm run server
To test with dummy data
- First, you must have mysql downloaded and running on your local machine
- Open a new terminal and run
cd server/db
- Run following commands:
mysql -u [yourSqlUserName] -p [yourPassword] < schema.sql
mysql -u [yourSqlUserName] -p [yourPassword] < seed.sql
Firebase
- Create a firebase account
- Add project > add Authentication > enable email-password login/signup > get web config file
- Create a
.env
file and paste in your firebase values. Use the example config in repo Google Places - Create a google cloud account and add billing
- Get API for google places. Input into your config file
Amplify is Amazon's full stack project manager. It will make it easier to add and connect to an S3 bucket for image storage
- Run
npm install -g @aws-amplify/cli
to install Amplify CLI - Run
amplify configure
(will prompt you to create an AWS iam user in the browswer)
- sign into aws account in browser
- once signed in, return to terminal and press enter to finish config
- Run
amplify init
to initilise a new Amplify project in your app
- choose profile to connect to the local IAM User you just made
- an amplify folder in your project will appear
- Run
amplify add storage
(IMPORTANT: make sure to setup with "Auth + Guests" when asked; won't work otherwise) - Run
amplify push
to deploy the Storage and Auth resources in Aws Amplify project - You should see a
src
directory appear with file namedaws-exports.js
. Is should display your s3 bucket information if done correctly.
If done correctly you can start the app and add/take pictures from your local device.