Spaces:
Running
Running
Delete QUICKSTART.md
Browse files- QUICKSTART.md +0 -182
QUICKSTART.md
DELETED
|
@@ -1,182 +0,0 @@
|
|
| 1 |
-
# DocVault Quick Start Guide
|
| 2 |
-
|
| 3 |
-
Get up and running with DocVault in 5 minutes!
|
| 4 |
-
|
| 5 |
-
## Step 1: Install Dependencies
|
| 6 |
-
|
| 7 |
-
```bash
|
| 8 |
-
cd server
|
| 9 |
-
pip install -r requirements.txt
|
| 10 |
-
```
|
| 11 |
-
|
| 12 |
-
## Step 2: Start the Server
|
| 13 |
-
|
| 14 |
-
```bash
|
| 15 |
-
python app.py
|
| 16 |
-
```
|
| 17 |
-
|
| 18 |
-
You should see:
|
| 19 |
-
```
|
| 20 |
-
Starting DocVault on http://localhost:5000 (DEBUG: True)
|
| 21 |
-
```
|
| 22 |
-
|
| 23 |
-
## Step 3: Test the API
|
| 24 |
-
|
| 25 |
-
Open a new terminal and run these curl commands:
|
| 26 |
-
|
| 27 |
-
### Create a folder
|
| 28 |
-
```bash
|
| 29 |
-
curl -X POST http://localhost:5000/api/create-folder \
|
| 30 |
-
-H "Content-Type: application/json" \
|
| 31 |
-
-H "X-User-ID: test_user" \
|
| 32 |
-
-d '{"folder_path": "MyDocuments"}'
|
| 33 |
-
```
|
| 34 |
-
|
| 35 |
-
### Upload a file
|
| 36 |
-
```bash
|
| 37 |
-
curl -X POST http://localhost:5000/api/upload-file \
|
| 38 |
-
-H "X-User-ID: test_user" \
|
| 39 |
-
-F "folder_path=MyDocuments" \
|
| 40 |
-
-F "file=@tests/test_file.txt"
|
| 41 |
-
```
|
| 42 |
-
|
| 43 |
-
### List contents
|
| 44 |
-
```bash
|
| 45 |
-
curl -X GET http://localhost:5000/api/list \
|
| 46 |
-
-H "X-User-ID: test_user"
|
| 47 |
-
```
|
| 48 |
-
|
| 49 |
-
### Check storage stats
|
| 50 |
-
```bash
|
| 51 |
-
curl -X GET http://localhost:5000/api/storage-stats \
|
| 52 |
-
-H "X-User-ID: test_user"
|
| 53 |
-
```
|
| 54 |
-
|
| 55 |
-
## Step 4: Using Python Requests
|
| 56 |
-
|
| 57 |
-
```python
|
| 58 |
-
import requests
|
| 59 |
-
import json
|
| 60 |
-
|
| 61 |
-
BASE_URL = "http://localhost:5000/api"
|
| 62 |
-
HEADERS = {"X-User-ID": "test_user"}
|
| 63 |
-
|
| 64 |
-
# Create folder
|
| 65 |
-
response = requests.post(
|
| 66 |
-
f"{BASE_URL}/create-folder",
|
| 67 |
-
json={"folder_path": "Projects"},
|
| 68 |
-
headers=HEADERS
|
| 69 |
-
)
|
| 70 |
-
print(response.json())
|
| 71 |
-
|
| 72 |
-
# Upload file
|
| 73 |
-
with open("tests/test_document.md", "rb") as f:
|
| 74 |
-
files = {"file": f}
|
| 75 |
-
data = {"folder_path": "Projects"}
|
| 76 |
-
response = requests.post(
|
| 77 |
-
f"{BASE_URL}/upload-file",
|
| 78 |
-
files=files,
|
| 79 |
-
data=data,
|
| 80 |
-
headers=HEADERS
|
| 81 |
-
)
|
| 82 |
-
print(response.json())
|
| 83 |
-
|
| 84 |
-
# List contents
|
| 85 |
-
response = requests.get(
|
| 86 |
-
f"{BASE_URL}/list?folder_path=Projects",
|
| 87 |
-
headers=HEADERS
|
| 88 |
-
)
|
| 89 |
-
print(json.dumps(response.json(), indent=2))
|
| 90 |
-
|
| 91 |
-
# Storage stats
|
| 92 |
-
response = requests.get(
|
| 93 |
-
f"{BASE_URL}/storage-stats",
|
| 94 |
-
headers=HEADERS
|
| 95 |
-
)
|
| 96 |
-
print(response.json())
|
| 97 |
-
```
|
| 98 |
-
|
| 99 |
-
## Step 5: Using Postman
|
| 100 |
-
|
| 101 |
-
1. Import `tests/DocVault.postman_collection.json` into Postman
|
| 102 |
-
2. Set the `X-User-ID` header for each request
|
| 103 |
-
3. Test all endpoints
|
| 104 |
-
|
| 105 |
-
## File Structure
|
| 106 |
-
|
| 107 |
-
After running some operations, your file structure will look like:
|
| 108 |
-
|
| 109 |
-
```
|
| 110 |
-
data/
|
| 111 |
-
└── test_user/
|
| 112 |
-
├── MyDocuments/
|
| 113 |
-
│ ├── test_file.txt
|
| 114 |
-
│ └── .gitkeep
|
| 115 |
-
├── Projects/
|
| 116 |
-
│ ├── test_document.md
|
| 117 |
-
│ └── .gitkeep
|
| 118 |
-
└── .gitkeep
|
| 119 |
-
```
|
| 120 |
-
|
| 121 |
-
## Directory Size
|
| 122 |
-
|
| 123 |
-
Check storage usage:
|
| 124 |
-
```bash
|
| 125 |
-
# Windows
|
| 126 |
-
dir /s /b data\
|
| 127 |
-
|
| 128 |
-
# Linux/Mac
|
| 129 |
-
du -sh data/
|
| 130 |
-
```
|
| 131 |
-
|
| 132 |
-
## Troubleshooting
|
| 133 |
-
|
| 134 |
-
### Port 5000 Already in Use
|
| 135 |
-
```bash
|
| 136 |
-
# Find process using port 5000
|
| 137 |
-
netstat -ano | findstr :5000 # Windows
|
| 138 |
-
lsof -i :5000 # Mac/Linux
|
| 139 |
-
|
| 140 |
-
# Kill process
|
| 141 |
-
taskkill /PID <PID> /F # Windows
|
| 142 |
-
kill -9 <PID> # Mac/Linux
|
| 143 |
-
|
| 144 |
-
# Or use different port (modify app.py)
|
| 145 |
-
```
|
| 146 |
-
|
| 147 |
-
### Module Import Errors
|
| 148 |
-
Ensure you're in the correct directory:
|
| 149 |
-
```bash
|
| 150 |
-
cd /path/to/DocVault
|
| 151 |
-
python server/app.py
|
| 152 |
-
```
|
| 153 |
-
|
| 154 |
-
### Permission Denied
|
| 155 |
-
Ensure write permissions:
|
| 156 |
-
```bash
|
| 157 |
-
chmod 755 data logs # Mac/Linux
|
| 158 |
-
# Windows should work automatically
|
| 159 |
-
```
|
| 160 |
-
|
| 161 |
-
## Next Steps
|
| 162 |
-
|
| 163 |
-
1. **Explore the API** - Try all endpoints with different user IDs
|
| 164 |
-
2. **Test with files** - Upload various file types
|
| 165 |
-
3. **Integrate** - Embed DocVault into your application
|
| 166 |
-
4. **Scale** - Plan for database backend or cloud storage
|
| 167 |
-
|
| 168 |
-
## API Reference
|
| 169 |
-
|
| 170 |
-
See [README.md](../README.md) for complete API documentation.
|
| 171 |
-
|
| 172 |
-
## Support
|
| 173 |
-
|
| 174 |
-
For issues:
|
| 175 |
-
1. Check logs in `logs/` directory
|
| 176 |
-
2. Review error messages in response
|
| 177 |
-
3. Verify file/folder names are valid
|
| 178 |
-
4. Ensure user ID is consistent across requests
|
| 179 |
-
|
| 180 |
-
---
|
| 181 |
-
|
| 182 |
-
**Happy documenting with DocVault!** 📂✨
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|