Health facilities is a full-stack web application that leverages GeoDjango, Nginx, Node, and React to visualize the health facilities located in Kenya. The goal of this project is to showcase, to especially beginners and mid-level web developers, the use of backend and frontend technologies in crafting an interactive web application.
- Interactive map
- Spatial database
- Scalable frontend and backend apps
- Reverse proxy server
- Containerized services
- Node
- React
- Leaflet
- Bootstrap5
- Python
- Django
- GeoDjango
- PostGIS
Note: Data used in this project has been sourced from The Humanitarian Data Exchange Find data repository.
- Nginx proxy server
-
Clone the repository:
git clone https://github.com/jkariukidev/health-facilities.git cd health-facilities
-
Install Docker with these instructions.
-
Rename the .env_sample file to .env
-
Populate the .env file with respective values.
-
Build images
make build
-
Start Postgis, nginx, Django, and client services
make start services
-
Create tables in the PostGIS database via Django's migrate command.
make migrate
-
Populate tables with health facilities data
make load-facilities-data
-
Navigate to http://127.0.0.1/ to view the client app and http://127.0.0.1:8000/api/v1/healthfacilites to view the API.
-
Django Backend
- Access the Django admin panel at: http://127.0.0.1:8000/admin/ Create a superuser account to manage the backend:
python manage.py createsuperuser
- Explore the API endpoints. Data API endpoint: http://127.0.0.1:8000/api/v1/healthfacilities/
- Customize and add your own API endpoints as defined in the Django backend.
- Access the Django admin panel at: http://127.0.0.1:8000/admin/ Create a superuser account to manage the backend:
-
React Frontend
- Access the React frontend at: http://127.0.0.1/
- Navigate through the user interface to interact with the app's features.
- Make HTTP requests to the Django API using libraries like axios or fetch from the frontend code.
Interacting with Both:
- Use the React frontend to send requests to the Django backend's API endpoints.
- Fetch data from the Django backend and display it in the React components.
This project's API documentation has been generated using:
- Swagger UI which can be accessed at http://127.0.0.1:8000/api/v1/schema/swagger-ui/
- Redoc which is accessed at http://127.0.0.1:8000/api/v1/schema/redoc/
Contributions are welcome! Here's how you can get involved:
- Fork the repository and create a new branch.
- Make your changes and test thoroughly.
- Open a pull request with a clear description of your changes.
This project is licensed under the MIT License.