Spaces:
Running
Running
DocVault Quick Start Guide
Get up and running with DocVault in 5 minutes!
Step 1: Install Dependencies
cd server
pip install -r requirements.txt
Step 2: Start the Server
python app.py
You should see:
Starting DocVault on http://localhost:5000 (DEBUG: True)
Step 3: Test the API
Open a new terminal and run these curl commands:
Create a folder
curl -X POST http://localhost:5000/api/create-folder \
-H "Content-Type: application/json" \
-H "X-User-ID: test_user" \
-d '{"folder_path": "MyDocuments"}'
Upload a file
curl -X POST http://localhost:5000/api/upload-file \
-H "X-User-ID: test_user" \
-F "folder_path=MyDocuments" \
-F "file=@tests/test_file.txt"
List contents
curl -X GET http://localhost:5000/api/list \
-H "X-User-ID: test_user"
Check storage stats
curl -X GET http://localhost:5000/api/storage-stats \
-H "X-User-ID: test_user"
Step 4: Using Python Requests
import requests
import json
BASE_URL = "http://localhost:5000/api"
HEADERS = {"X-User-ID": "test_user"}
# Create folder
response = requests.post(
f"{BASE_URL}/create-folder",
json={"folder_path": "Projects"},
headers=HEADERS
)
print(response.json())
# Upload file
with open("tests/test_document.md", "rb") as f:
files = {"file": f}
data = {"folder_path": "Projects"}
response = requests.post(
f"{BASE_URL}/upload-file",
files=files,
data=data,
headers=HEADERS
)
print(response.json())
# List contents
response = requests.get(
f"{BASE_URL}/list?folder_path=Projects",
headers=HEADERS
)
print(json.dumps(response.json(), indent=2))
# Storage stats
response = requests.get(
f"{BASE_URL}/storage-stats",
headers=HEADERS
)
print(response.json())
Step 5: Using Postman
- Import
tests/DocVault.postman_collection.jsoninto Postman - Set the
X-User-IDheader for each request - Test all endpoints
File Structure
After running some operations, your file structure will look like:
data/
βββ test_user/
βββ MyDocuments/
β βββ test_file.txt
β βββ .gitkeep
βββ Projects/
β βββ test_document.md
β βββ .gitkeep
βββ .gitkeep
Directory Size
Check storage usage:
# Windows
dir /s /b data\
# Linux/Mac
du -sh data/
Troubleshooting
Port 5000 Already in Use
# Find process using port 5000
netstat -ano | findstr :5000 # Windows
lsof -i :5000 # Mac/Linux
# Kill process
taskkill /PID <PID> /F # Windows
kill -9 <PID> # Mac/Linux
# Or use different port (modify app.py)
Module Import Errors
Ensure you're in the correct directory:
cd /path/to/DocVault
python server/app.py
Permission Denied
Ensure write permissions:
chmod 755 data logs # Mac/Linux
# Windows should work automatically
Next Steps
- Explore the API - Try all endpoints with different user IDs
- Test with files - Upload various file types
- Integrate - Embed DocVault into your application
- Scale - Plan for database backend or cloud storage
API Reference
See README.md for complete API documentation.
Support
For issues:
- Check logs in
logs/directory - Review error messages in response
- Verify file/folder names are valid
- Ensure user ID is consistent across requests
Happy documenting with DocVault! πβ¨