This is the backend of the Document Management Portal, built with Django and Django REST Framework. It provides APIs for user authentication, document management, and AI-powered question answering.
- JWT-based user authentication
- Document upload, retrieval & deletion
- Serve document content
- AI Q&A via OpenAI API
- Django & DRF
- Simple JWT
- CORS Headers
- Huggingface API
- SQLite (or any DB)
-
Clone the repository: git clone https://github.com/your-username/document-manager-backend.git cd document-manager-backend
-
Create and activate a virtual environment: python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate
-
Install requirements: pip install -r requirements.txt
-
Apply migrations: python manage.py migrate
-
Run the server: python manage.py runserver
-
Add your Huggingface API key or any API key you want in the view where AI Q&A is handled.
POST /api/auth/register/– Register userPOST /api/auth/login/– Login and get JWTGET /api/profile/– Get user profileGET/POST /api/documents/– List or upload documentsDELETE /api/documents/<id>/– Delete a documentGET /api/documents/<id>/content/– Get document contentPOST /ask-ai/– Ask question to AI
Backend can be deployed on platforms like Render, Railway, or Heroku.