Get the complete MedSecure application (Backend + Frontend + Database) running in 5 minutes.
- Python 3.12+
- Node.js 16+
- Docker (for MongoDB)
- Git
# Navigate to project
cd c:\Users\DELL\Medsecure
# Install Python dependencies
pip install -r requirements.txt
# Start MongoDB (runs in background)
docker-compose up -d mongo
# Start FastAPI server
uvicorn app.main:app --reload --port 8000✓ Backend running at: http://localhost:8000 ✓ API docs at: http://localhost:8000/docs
# Navigate to frontend
cd c:\Users\DELL\Medsecure\frontend
# Install dependencies (first time only - takes ~1 min)
npm install
# Copy environment config
cp .env.local.example .env.local
# Start development server
npm run dev✓ Frontend running at: http://localhost:3000
# Optional: Run backend tests
cd c:\Users\DELL\Medsecure
pytest -v tests/| Component | URL | Purpose |
|---|---|---|
| Frontend | http://localhost:3000 | Upload UI |
| API Docs | http://localhost:8000/docs | Interactive API |
| Database | mongodb://localhost:27017 | MongoDB |
Visit http://localhost:3000 in your browser
Create test_document.txt:
Patient: John Doe
DOB: 01/15/1975
SSN: 123-45-6789
Email: john.doe@example.com
Phone: (555) 123-4567
Chief Complaint: Diabetes management
History of Present Illness:
Patient is a 45-year-old male with a history of Type 2 Diabetes Mellitus.
He has been on Metformin 500mg BID for the past 3 years.
Last HbA1c was 7.2% three months ago.
Physical Examination:
Blood Pressure: 135/85 mmHg
Heart Rate: 72 bpm
Weight: 180 lbs
Assessment:
Well-controlled Type 2 Diabetes. Continue current medications.
Plan:
- Follow-up in 3 months
- Recheck HbA1c
- Continue Metformin 500mg BID
- Click "Select Text File" on the frontend
- Choose
test_document.txt - Click "Summarize"
- Wait for processing (1-3 seconds)
- View results:
- ✓ Masked document (PII removed)
- ✓ Generated summary
- ✓ Extracted medical entities
- ✓ Verification status
Masked Document:
Patient: [NAME]
DOB: [DOB]
SSN: [SSN]
Email: [EMAIL]
Phone: [PHONE]
...
Generated Summary:
Patient with Type 2 Diabetes on Metformin management...
Extracted Entities:
- diabetes
- Metformin
- Type 2 Diabetes Mellitus
Verification: ✓ Passed
# Terminal 1: Backend
Ctrl+C
# Terminal 2: Frontend
Ctrl+C
# Stop MongoDB
docker-compose downSolution:
# Ensure backend is running
curl http://localhost:8000/docs
# Check .env.local in frontend
cat frontend/.env.localSolution:
# Start MongoDB
docker-compose up -d mongo
# Verify connection
mongoshSolution:
# Install Node.js from https://nodejs.org/
# Then verify:
node --version
npm --versionSolution:
cd frontend
npm run dev -- -p 3001Solution:
uvicorn app.main:app --reload --port 8001- Read PORTFOLIO_SETUP.md for full overview
- Follow EXECUTION_PIPELINE.md for development phases
- Start Phase 1: Enhanced PII Masking
- Implement phases incrementally
Browser → Next.js (3000) → FastAPI (8000) → MongoDB (27017)
MedSecure/
├── app/ # Backend (FastAPI)
│ ├── main.py
│ ├── api/routes.py # API endpoints
│ ├── services/ # Pipeline services
│ └── core/ # Security & config
├── frontend/ # Frontend (Next.js)
│ ├── pages/
│ │ └── index.js # Main upload page
│ ├── components/ # React components
│ ├── lib/api.js # API client
│ └── package.json
├── docker-compose.yml # MongoDB setup
├── requirements.txt # Python deps
└── README.md
| File | Purpose |
|---|---|
| README.md | Full project overview |
| FULL_STACK.md | Architecture & deployment |
| frontend/README.md | Frontend-only setup |
| EXECUTION_PIPELINE.md | Development roadmap |
# Start API
uvicorn app.main:app --reload
# Run tests
pytest -v tests/
# Security scan
bandit -r app# Development
npm run dev
# Production build
npm run build
npm start
# Linting
npm run lint# Start MongoDB
docker-compose up -d mongo
# Connect to MongoDB
mongosh
# Stop MongoDB
docker-compose down| Service | URL | Status |
|---|---|---|
| Next.js Frontend | http://localhost:3000 | 🟢 Running |
| FastAPI Backend | http://localhost:8000 | 🟢 Running |
| API Docs | http://localhost:8000/docs | 🟢 Interactive |
| MongoDB | mongodb://localhost:27017 | 🟢 Running |
- File upload interface
- Results display
- PII masking preview
- Medical entities visualization
- Verification status
- RBAC security layer
- PII masking engine
- Medical NER service
- LLM summarizer (placeholder)
- Hallucination verification
- MongoDB storage layer
- Document storage
- Summary caching
- User access logs
All three components are running and ready to process medical documents.
Test it now at: http://localhost:3000
Questions? Check FULL_STACK.md or PORTFOLIO_SETUP.md
Ready to build? See EXECUTION_PIPELINE.md