A full-stack application with Django backend and React frontend.
ProjectCare/
├── backend/ # Django backend
│ ├── projectcare/ # Django project settings
│ ├── api/ # API app
│ ├── customer/ # Customer app
│ └── manage.py
└── frontend/ # React + Vite frontend
└── src/
├── components/
└── pages/
- Navigate to the backend directory:
cd backend- Create a virtual environment (recommended):
python -m venv venv-
Activate the virtual environment:
- Windows:
venv\Scripts\activate - Linux/Mac:
source venv/bin/activate
- Windows:
-
Install dependencies:
pip install -r requirements.txt- Run migrations:
python manage.py migrate- Create admin superuser:
python create_admin.pyThis creates an admin user with:
- Username:
admin - Password:
admin123 - Email:
admin@projectcare.com
- Start the Django development server:
python manage.py runserverThe backend will be available at: http://localhost:8000
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm run devThe frontend will be available at: http://localhost:5173
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- Django Admin: http://localhost:8000/admin
- API Health Check: http://localhost:8000/api/health/
- Sample Data API: http://localhost:8000/api/sample/
- Django REST Framework
- CORS enabled for local development
- Sample API endpoints
- SQLite database (for local testing)
- Customer app with PhoneNumberField support
- Pillow for image handling
- Customized admin interface (Customer Administration)
- React 18 with Hooks (useState, useEffect)
- React Router for navigation
- Vite for fast development
- 3 sample pages/templates:
- Home (with counter example)
- About (with toggle example)
- Sample Data (fetches from Django API)
GET /api/health/- Health check endpointGET /api/sample/- Returns sample data
- Both servers need to be running simultaneously for full functionality
- The frontend is configured to proxy API requests to the backend
- CORS is configured to allow requests from
localhost:5173