MedicalVendorApi 0.1 is a basic API designed to manage medical vendors and products. This API is still in its early development stage and has a lot of scope for improvements and new features to be added. 😊
Short Description: This is a simple and effective API built to manage medical vendors and their products. It primarily serves as an example for performing CRUD (Create, Read, Update, Delete) operations. 💡
This API is mainly developed for healthcare businesses and medical suppliers. Its general-purpose use is limited as it is a domain-specific API focused on managing medical vendors and their inventory. However, with additional generic features, it has the potential to become multi-purpose. 💡
🔥 From an Android App Developer's Perspective: This API is developed primarily to understand basic CRUD operations and how to integrate backend services with Android apps. It serves as a great learning tool for both beginners and experienced developers.
The following functionalities are currently available in this API:
- 🔹 Vendor Management – Functionality to add, update, and delete medical vendors.
- 🔹 Product Management – A system to track and manage vendor products.
- 🔹 Database Support – Utilizes SQLite database for data storage.
- 🔹 Basic CRUD Operations – Enables create, read, update, and delete actions on data.
- 🔹 Simple Architecture – A straightforward and easy-to-understand code structure.
Before running the API, you need to initialize the database. You have two options to do this:
1️⃣ Manual Method
Run the create_db.py script once:
python create_db.py
2️⃣ Using API Endpoint
If you prefer to initialize the database through an API request, you can do so by calling the /create_db endpoint using a GET request.
Example:
GET https://adarsh2002.pythonanywhere.com/create_db
This will trigger the database creation process via the API.
This script will create all required tables. Once executed successfully, you do not need to run it again.
After that, you can directly run App.py
to start the API and perform table operations.
python App.py
This project requires the following dependencies:
Flask
sqlite3
requests
jsonify
SQLAlchemy
Install them using:
pip install -r requirements.txt
This API is still under development, and the following improvements are planned for future versions:
- ✅ More Robust & Optimized Code – To enhance performance and scalability.
- ✅ Security Enhancements – Implementation of better authentication and authorization mechanisms.
- ✅ Better Database Integration – Support for MySQL/PostgreSQL in addition to SQLite.
- ✅ Advanced API Endpoints – Addition of more detailed and useful API endpoints.
- ✅ Improved Documentation – Enhancing the API usage and integration guide.
- ✅ API Testing & Validation – Implementation of proper error handling and data validation.
#MedicalVendorAPI
#CRUD
#SQLite
#BackendDevelopment
#APIDevelopment
#PythonAPI
#MedicalVendors
If you want to contribute to this API, feel free to do so! ❤️ Pull requests and suggestions are always welcome. 😃
If you have any issues or suggestions, report them in the GitHub Issues section or contact me here: Adarsh Kumar on LinkedIn. 🚀
Let's build something amazing together! 🔥
Before developing this API, it is recommended to create a virtual environment to manage dependencies effectively. Follow these steps:
-
Install Virtual Environment (if not installed):
pip install virtualenv
-
Create a Virtual Environment:
python -m venv MedicalVendorApi_Env
-
Activate the Virtual Environment:
- On Windows:
MedicalVendorApi_Env\Scripts\activate
- On macOS/Linux:
source MedicalVendorApi_Env/bin/activate
- On Windows:
-
Install Required Dependencies:
pip install -r requirements.txt
-
Run the Database Setup (One-Time Only):
python create_db.py
-
Start Developing & Running the API:
python App.py
To use this API from GitHub, follow these steps:
-
Clone the Repository:
git clone <GitHub_Repository_URL>
-
Navigate to the Project Directory:
cd MedicalVendorApi
-
Set Up a Virtual Environment (Recommended for development):
python -m venv MedicalVendorApi_Env
-
Activate the Virtual Environment:
- On Windows:
MedicalVendorApi_Env\Scripts\activate
- On macOS/Linux:
source MedicalVendorApi_Env/bin/activate
- On Windows:
-
Install Dependencies:
pip install -r requirements.txt
-
Run the Database Setup (One-Time Only):
python create_db.py
-
Run the API:
python App.py
This API is built in a virtual environment and is meant for development purposes.
- It is not recommended to use this code in production without proper modifications.
- If you plan to deploy this API in a production environment, you must:
- Optimize
App.py
for security. - Implement better database management and authentication.
- Use proper hosting and deployment strategies.
- Optimize
🚀🌍 Deployment on PythonAnywhere
If you still wish to deploy this API on PythonAnywhere or a similar cloud platform, you can do so under the following conditions:
⚡ Lightweight Usage Only: This API is suitable for personal use, testing, or small-scale applications, but not for high-traffic or enterprise-level systems.
👥 Limited Concurrent Users: Since PythonAnywhere has execution time limits and resource constraints, it is not ideal for heavy-load applications.
🗃️ Database Optimization: SQLite is used by default, which is not recommended for high-concurrency operations. If needed, migrate to MySQL or PostgreSQL.
🔐 Security Enhancements: If handling sensitive data, ensure you secure API keys, encrypt data, and restrict public access.
📊 Regular Monitoring: Keep an eye on API logs and error reports to detect performance or security issues early.
- If you use this API without modifications in production, you do so at your own risk. ❗