A pharmacy management system built with Django REST Framework and React.
- Docker
- Docker Compose
Pyramids-Pharmacy/ ├── backend/ # Django REST API │ ├── Dockerfile │ ├── pyproject.toml # Poetry dependencies │ └── poetry.lock ├── frontend/ # React Application │ └── Dockerfile └── docker-compose.yml
- Clone the repository:
git clone cd Pyramids-Pharmacy
- Start the services:
docker-compose up --build
The services will be available at:
- Frontend: http://localhost:5173
- Backend: http://localhost:8000
- Admin Panel: http://localhost:8000/admin
- Create superuser:
docker-compose exec backend python manage.py createsuperuser
To run migrations:
docker-compose exec backend python manage.py makemigrations docker-compose exec backend python manage.py migrate
To create test data:
docker-compose exec backend python manage.py shell
from medications.models import Medication
medications = [ { 'name': 'Aspirin', 'description': 'Pain reliever', 'dosage': '325mg', 'quantity': 100 }, { 'name': 'Ibuprofen', 'description': 'Anti-inflammatory', 'dosage': '200mg', 'quantity': 50 } ]
for med in medications: Medication.objects.get_or_create(**med)
- POST /api/token/ - Get JWT tokens
- POST /api/token/refresh/ - Refresh JWT token
- GET /api/medications/ - List all medications
- POST /api/medications/ - Create new medication
- GET /api/medications// - Get medication details
- PUT /api/medications// - Update medication
- DELETE /api/medications// - Delete medication
- GET /api/refill-requests/ - List all refill requests
- POST /api/refill-requests/ - Create new refill request
- GET /api/refill-requests// - Get refill request details
- PUT /api/refill-requests// - Update refill request
- DELETE /api/refill-requests// - Delete refill request
- Manage medications (add, edit, delete)
- View and process refill requests
- Track medication inventory
- Manage user accounts
- View available medications
- Request medication refills
- Track refill request status
- View refill history
- name (CharField)
- description (TextField)
- dosage (CharField)
- available (BooleanField)
- quantity (IntegerField)
- created_at (DateTimeField)
- user (ForeignKey to User)
- medication (ForeignKey to Medication)
- amount (IntegerField)
- status (CharField: PENDING/APPROVED/DENIED)
- created_at (DateTimeField)
- updated_at (DateTimeField)
- notes (TextField)
- Django
- Django REST Framework
- PostgreSQL
- JWT Authentication
- Poetry
- Docker
- React
- Vite
- Tailwind CSS
- Axios
- Docker
- Database Connection:
- Check if PostgreSQL container is running: docker-compose ps
- Check logs: docker-compose logs db
- CORS Issues:
- Check CORS settings in backend/settings.py
- Verify API URL in frontend .env file
- Container Issues:
- Rebuild containers: docker-compose up --build
- Check logs: docker-compose logs [service_name]
docker-compose logs -f [service_name]
docker-compose restart [service_name]
docker-compose down