An efficient REST API designed to manage mechanical keyboard inventory with integrated Python data intelligence for automatic report generation.
- Interactive Dashboard: Modern web interface to manage stock visually.
- Inventory Management: Full CRUD for keyboard stocks.
- Data Intelligence: Python script for stock analysis.
- PDF Reporting: Automatic PDF reports for low-stock items.
- Auto-Setup: Automatic MySQL table initialization on startup.
- Frontend: HTML5, CSS3, and JavaScript (Vanilla).
- Backend: Node.js & Express.js.
- Data Intelligence: Python 3 (FPDF & mysql-connector).
- Database: MySQL.
| Method | Endpoint | Description |
|---|---|---|
GET |
/estoque |
Returns all items from the database |
POST |
/estoque |
Adds a new product |
PATCH |
/estoque/vender/:id |
Decreases quantity by 1 |
DELETE |
/estoque/:id |
Removes a product |
GET |
/analise/gerar-pdf |
[NEW] Triggers Python script to generate/view PDF report |
- Clone the repository:
git clone https://github.com/LeonardoCides/KeyboardStack-API
- Install Dependencies:
npm install- Install Python Dependencies::
source venv/bin/activate # Linux/Mac .\venv\Scripts\activate # Windows pip install -r requirements.txt
- Setup Environment Variables:
Create a .env file in the root directory:
DB_HOST=localhost DB_USER=root DB_PASS=your_password DB_NAME=sistema_estoque PORT=3000
- Start the server:
npm start
