A website where users can find medicines and hospital beds from the nearest locations. Medical stores can manage their inventory and track the sold/available medicines. Hospitals can track allocated and free beds as well as add new beds.
- Medical Store
- Hospital
- making an account is not required
- can search for a particular medicine by brand/generic name
- can search for a bed of particular specification
A Medical Store can
- register themselves on the website
- create their profile with details such as their email, contact number
- add items to their inventory by specifying medicine name, generic name , quantity and price
- bill items that have been sold out by specifying the medicine name , patient name and quantity
- view transaction history
- view inventory
A Hospital can
- register themselves on the website
- create their profile with details such as their email, contact number
- add beds with particular specifications and quantity
- allocate bed by specifying patient name and price
- view allocated beds and free them if required
- view available beds
- User/Medical Store/Hospital location is detected using reverse geocoding api(MapMyIndia) by fetching their coordinates.
- Medical Store/Hospital profile shows the name, contect info, email , address and coordinates
- An autocomplete search bar to search for medicines and beds
- Inventory Management features such as adding , removing items and keeping track of transactions
- A User has to ask for the required item and quantity and a list of locations having sufficient resources in the same city is shown in distance-sorted order.
Hosted at https://fastmeds.herokuapp.com/
- MongoDB - Document database - to store data as JSON
- Express.js - Back-end web application framework running on top of Node.js
- React - Front-end web app framework used
- Node.js - JavaScript runtime environment
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Your machine should have npm and node.js installed to use it locally.
- First fork the repo to your account.
Go to the forked repo and clone it to your local machine:
git clone https://github.com/Your_Username/charityplus.git
This will make a copy of the code to your local machine.
- Now move to the
fastmeds
directory.
cd fastmeds
- Now check the remote of your local code by:
git remote -v
The response should look like:
origin https://github.com/Your_Username/fastmeds.git (fetch)
origin https://github.com/Your_Username/fastmeds.git (push)
To add upstream to remote, run:
git remote add upstream https://github.com/milan0027/fastmeds.git
Again run git remote -v
, the response should look like:
origin https://github.com/Your_Username/fastmeds.git (fetch)
origin https://github.com/Your_Username/fastmeds.git (push)
upstream https://github.com/milan0027/fastmeds (fetch)
upstream https://github.com/milan0027/fastmeds (push)
- Once the remote is set, install all the necessary dependencies by the following command:
npm install
- Move to
client
folder and install all the necessary dependencies by the following command:
cd client
npm install
cd ..
- Create a
.env
file in thefastmeds
directory and add the following
MONGODB_URL=YOUR_MONGODB_URL
Run the below command to start the app:
npm run dev
- The server runs on port 5000
- The client side runs on port 3000
- Both client and server must run concurrently. Go to: http://localhost:3000
- Add the following lines to server.js :
// Serve static assets if in production
if (process.env.NODE_ENV === 'production') {
// Set static folder
app.use(express.static('client/build'));
app.get('*', (req, res) => {
res.sendFile(path.resolve(__dirname, 'client', 'build', 'index.html'));
});
}
- Add the following script to the package.json of server
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
- Install Heroku CLI and make sure you have intialised a git repository in the project directory. Enter the following commands in the terminal :
heroku login
heroku create
git add .
git commit -am "Deployed to Heroku"
git push heroku master
- Open your heroku account and in settings configure MongoURI variable.
- Open your heroku account and click on Open App option in the dashboard.