This project is a management system and blog for displaying and managing information of various regions such as counties, cities, districts, and villages. For each region, information such as opportunities, threats, weaknesses, and capacities are recorded and managed.
This backend project is synchronized and connected to a website developed with Vue.js. The website allows users to interact with the backend and receive the necessary information and services. For more information about the Vue.js website, please visit Demand Tracking.
- Region Categorization: Includes counties, cities, districts, villages, etc.
- Key Features: Each section has features like opportunities, threats, weaknesses, and capacities, each with its sub-features.
- Connecting Sub-features to Regions: Each sub-feature is linked to a section of the region (e.g., village or city) and includes information such as title, description, photos, etc.
- Response by Organizations: It can be determined which organization or authority is responsible for responding to each feature, and their responses are stored as well.
- Neighborhood Information: Includes the name, photos, and notable people of that neighborhood.
- Information Transparency: All information, including features and responses, is publicly viewable in the blog section to ensure transparency in presenting information.
This model is used to manage API keys, specifying whether the key is for the admin panel or the blog.
This model defines different roles with access levels (chief admin, representative, and manager). Each role has an access level that determines their access to different system sections.
The Manager model stores personal and professional information of managers responsible for each region. This includes name, contact number, national ID, password, and character (role) of the manager. Managers can be edited or removed.
This model links managers to the regions they manage. The connection between a manager and the regions they oversee is managed through this model.
These models store information about various places, from large cities to villages. Each model includes information such as code, name, population, household count, images, and descriptions of the area. Connections between different areas are also managed through these models.
This model defines additional or "special" features related to places and people. These features can include properties, infrastructure, etc., which can be linked to different areas.
This model stores information about people related to a specific area, including name, family, special feature (Proper), and an attached file if available. It can also identify notable people associated with that region.
These models define general features and sub-features. Features like opportunities, threats, weaknesses, and capacities are managed through these models and are linked to specific places (like villages, cities, or districts).
This model links specific features (like infrastructure, economic opportunities, etc.) to particular places. This model includes information such as the feature's title, description, images, and whether the feature is private or public.
This model stores responses given by organizations or managers to each feature. Responses include content, attached files, and the last edited time.
This model stores additional and unnecessary information related to various places, which may not seem essential initially but may become useful in the future.
This model stores values related to the additional information from the "RedundantInformation" model. Each additional value is tied to a specific place and stored as textual data.
This model defines different sections of the system. Each role can have access to specific sections through this model.
This model determines which sections of the system each role has access to. For example, a chief admin may have access to all sections, while a manager might only have access to a specific section.
This model manages the export list of features related to places and can export them in various formats.
This model stores information about organizations or agencies that are connected to the project and may be responsible for responding to the features.
This model stores solutions provided by organizations for various features. Each solution is tied to a specific feature and organization.
This model stores images related to the slider on the blog or admin panel page, including information like the image and the time it was uploaded.
To run this project, you need to have the following software and tools installed:
The following packages are used in this project:
-
Django==5.0.1
-
django-cors-headers==4.3.0
-
django-jalali==6.0.1
-
djangorestframework==3.14.0
-
jdatetime==5.0.0
Follow these steps to set up the project:
-
Clone the repository:
git clone https://github.com/Bestsenator/DemandTracking.git
-
Navigate to the project directory:
cd DemandTracking
-
Create a Python virtual environment:
python -m venv venv
-
Activate the virtual environment:
-
On Windows:
venv\Scripts\activate
-
On macOS or Linux:
source venv/bin/activate
-
-
Install the project dependencies:
pip install -r req.txt
-
Configure the
.env
file based on the.env.example
template. -
Apply the database migrations:
python manage.py migrate
-
Run the server:
python manage.py runserver
-
The project is now available at
http://localhost:8000
.
The following APIs are provided for interacting with data and managing various sections of the project:
POST /loginCheck/
: Check login status.GET /checkSession/
: Check user session status.
GET /getLocationListByFilter/
: Get a list of locations with filters.GET /getRedundantLocation/
: Get redundant locations.GET /getAllRedundant/
: Get all redundant locations.POST /addRedundantForLocation/
: Add a redundant location for a place.POST /editRedundantForLocation/
: Edit a redundant location for a place.POST /deleteRedundantForLocation/
: Delete a redundant location for a place.POST /addPlace/
: Add a new place.GET /getCityList/
: Get a list of cities.GET /getBigCityList/
: Get a list of major cities.GET /getCityPartList/
: Get a list of city parts.GET /getBigVillageList/
: Get a list of major villages.GET /getVillageList/
: Get a list of villages.POST /deletePlace/
: Delete a place.POST /editPlace/
: Edit a place.GET /getInfoPlace/
: Get information about a place.
GET /getPropertyListByFilter/
: Get a list of properties with filters.GET /getInfoPropertyBToPlace/
: Get property information related to a place.POST /deletePropertyBelongToPlace/
: Delete a property related to a place.GET /getPropertyNameList/
: Get a list of property names.GET /getAllSubPropertyNameList/
: Get a list of all sub-property names.GET /getSubPropertyNameList/
: Get a list of sub-property names.POST /addPropertyToPlace/
: Add a property to a place.POST /editPropertyToPlace/
: Edit a property related to a place.POST /addSubProperty/
: Add a sub-property.POST /editSubProperty/
: Edit a sub-property.POST /deleteSubProperty/
: Delete a sub-property.
GET /getProperList/
: Get a list of people.GET /getPeopleBelongToPlaceList/
: Get a list of people related to a place.GET /getInfoPeopleBelongToPlace/
: Get information about a person related to a place.POST /addPeopleBelongToPlace/
: Add a person to a place.POST /editPeopleBelongToPlace/
: Edit a person related to a place.POST /deletePeopleBelongToPlace/
: Delete a person from a place.
GET /getAnswerPropertyBToPlaceList/
: Get a list of answers for properties related to a place.POST /addAnswerToProperty/
: Add an answer to a property.POST /editAnswerProperty/
: Edit an answer for a property.POST /deleteAnswerProperty/
: Delete an answer for a property.GET /getFullInfoPropertyBToPlace/
: Get complete information about a property related to a place.GET /getSolutionToProperty/
: Get solutions related to a property.POST /addSolutionToProperty/
: Add a solution to a property.POST /editSolutionToProperty/
: Edit a solution related to a property.POST /deleteSolutionToProperty/
: Delete a solution related to a property.
GET /getAccessListManager/
: Get a list of manager access permissions.GET /getCharacterList/
: Get a list of roles.POST /addManager/
: Add a manager.POST /editManager/
: Edit a manager.POST /deleteManager/
: Delete a manager.POST /addLocationToManager/
: Add a location to a manager.POST /deleteLocationToManager/
: Remove a location from a manager.GET /getLocationListByPhrase/
: Get a list of locations based on a phrase.GET /getInfoPropertyLocation/
: Get information about property related to a location.GET /getManagerList/
: Get a list of managers.GET /getManagerInfo/
: Get information about a manager.
GET /exportToDatabase/
: Export data to the database.GET /getSlider/
: Get a list of sliders.POST /addSlider/
: Add a slider.POST /deleteSlider/
: Delete a slider.
GET /getAccessLocationList/
: Get a list of location access permissions.GET /getLocationListBlog/
: Get a list of locations for the blog.
Note: The APIs are written using Postman, and the collections are available at postmanCollection.
DemandTracking/
├── config/
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── api/
│ ├── migrations/
│ ├── models.py
│ ├── serializers.py
│ ├── views.py
│ └── urls.py
├── index/
│ ├── migrations/
│ ├── models.py
│ ├── serializers.py
│ ├── views.py
│ └── urls.py
├── funcs/
│ ├── check.py
│ └── verify.py
├── media/
│ ├── locationImage
│ ├── peopleBelongToPlace
│ ├── propertyBelongToPlace
│ └── slider
├── static/
├── manage.py
├── db.sqlite3
├── README.md
├── README_fa.md
├── README_en.md
└── req.txt
If you would like to contribute to this project, you can:
- Fork this repository.
- Create a new branch for your feature or bug fix (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -m 'Add some AmazingFeature'
). - Push your branch (
git push origin feature/AmazingFeature
). - Open a Pull Request.
Special thanks to the Vue.js front-end developer who skillfully developed this website and integrated it with the back-end system. Without his efforts, creating this integrated system would not have been possible.