This application is used for appointment booking among buyers and sellers. To help buyers save their time, we decided to implement appointment booking system that will allow them to book their appointment ahead of time before going to the service provider. Hence, it is required to design and develop a solution that will allow the users to perform the action smoothly.
This is the nodejs express server application. This connects with mongodb database.
- The server uses token based authentication to authenticate users.
- Token is retrieved when the user logs in to the app
- Token needs to be added to header
x-access-token
for every API call except signin and signup (obviously ;) - Token is session based, not stored on the browser due to security concerns, if you refresh the page you need to login again (sorry!)
- Each user can have roles (buyer, seller or admin).
- Only users having buyer role can login using mobile app.
- Only users have seller role can login using web app.
- If no role is present, the user cannot login. Based on the signup on either mobile or web app, the role is assigned automatically.
- Single user can have mutiple roles. Multiple role configuration is supported from API standpoint, can be utilised from Postman.
- There is no forgot password option as of now, so try to remember the username and password.
If you do not have mongodb service running locally, follow this here.
- Mac - https://zellwk.com/blog/install-mongodb/
- Windows - https://treehouse.github.io/installation-guides/windows/mongo-windows.html
The API exposes the following end points
- /api/auth/signin - For signing in with a username and password
- /api/auth/signup - For signing up with username, email and password
- /api/appointment/schedule - For a buyer scheduling an appointment to seller
- /api/appointment/pending - For a seller retrieving all pending appointments
- /api/appointment/:id/approve - For a seller, approving an appointment request
- /api/appointment/:id/cancel - For a seller, cancelling an appointment request
- /api/seller/all - Get all sellers
- /api/seller - Get the current seller information
cd product-server
npm install
npm start
This is a vanilla react native application which is used by buyers to schedule appointments with sellers. A buyer can login with username and password, view all sellers, search for seller and book appointment with a seller.
The appointment can only be booked within the time range the seller is available.
- Change the
API_URL
inreact-buyer-app/src/helpers/constants.js
to 'http://:/api/'
cd react-buyer-app
npm install
npm start
npm run ios # or npm run android
You can also run ios command from xcode by opening the react-buyer-app/ios/SimpleLoginTemplate.xcworkspace in xcode and hitting the run icon on top left.
This is a react web application which is used by sellers to view the appointments requested by the buyers. The sellers have an option to accept or cancel the appointment request. The seller can also change their available from/to time based on their convenience
cd seller-web-app
npm install
npm start