Spaces:
Runtime error
Runtime error
Create README.md
Browse files---
title: HiTech API
emoji: π
colorFrom: blue
colorTo: indigo
sdk: docker
sdk_version: "1.0"
app_port: 7860
pinned: false
---
# HiTech MongoDB API
## π API Endpoints
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/health` | GET | Check server and database status |
| `/api/products` | GET | Get all products |
| `/api/products` | POST | Create new product |
| `/api/users` | GET | Get all users |
| `/api/dashboard/stats` | GET | Get dashboard statistics |
## π Database
- MongoDB Atlas connected
- Collections: products, users, orders
## π Live API
- Health check: `/api/health`
- Products: `/api/products`
README.md
CHANGED
|
@@ -1,58 +0,0 @@
|
|
| 1 |
-
# HiTech Technologies
|
| 2 |
-
|
| 3 |
-
Full-stack company website with a public site and admin panel.
|
| 4 |
-
|
| 5 |
-
## Tech Stack
|
| 6 |
-
|
| 7 |
-
- Node.js
|
| 8 |
-
- Express
|
| 9 |
-
- NeDB
|
| 10 |
-
- JWT auth
|
| 11 |
-
- Multer file uploads
|
| 12 |
-
- Static frontend in `public/`
|
| 13 |
-
|
| 14 |
-
## Run Locally
|
| 15 |
-
|
| 16 |
-
From the project root:
|
| 17 |
-
|
| 18 |
-
```bash
|
| 19 |
-
npm install
|
| 20 |
-
npm start
|
| 21 |
-
```
|
| 22 |
-
|
| 23 |
-
If you want auto-reload during development:
|
| 24 |
-
|
| 25 |
-
```bash
|
| 26 |
-
npm run dev
|
| 27 |
-
```
|
| 28 |
-
|
| 29 |
-
## Local URLs
|
| 30 |
-
|
| 31 |
-
The default port is set in `.env`.
|
| 32 |
-
|
| 33 |
-
- `http://localhost:3001` - Public website
|
| 34 |
-
- `http://localhost:3001/admin` - Admin panel
|
| 35 |
-
|
| 36 |
-
If you change `PORT` in `.env`, use that port in the URLs above.
|
| 37 |
-
|
| 38 |
-
## Default Admin Login
|
| 39 |
-
|
| 40 |
-
- Username: `Huzaifa`
|
| 41 |
-
- Password: `12345`
|
| 42 |
-
|
| 43 |
-
## What Gets Created Automatically
|
| 44 |
-
|
| 45 |
-
- `data/` for NeDB files
|
| 46 |
-
- `uploads/` for uploaded images
|
| 47 |
-
- seed data for settings, services, and products
|
| 48 |
-
|
| 49 |
-
## Notes
|
| 50 |
-
|
| 51 |
-
- The site serves the frontend from `public/`.
|
| 52 |
-
- API routes are under `/api/...`.
|
| 53 |
-
- Uploaded images are available under `/uploads/...`.
|
| 54 |
-
|
| 55 |
-
## Troubleshooting
|
| 56 |
-
|
| 57 |
-
If port `3001` is already in use, change `PORT` in `.env` and restart the app.
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|