This project is a Django-based web application with a MySQL database, utilizing Celery for asynchronous task processing and Gunicorn for serving the application in a production environment. The project is containerized using Docker and has a frontend built with React and TypeScript using Vite and Yarn for production builds.
.
βββ exam_django
βΒ Β βββ ai
βΒ Β βΒ Β βββ clients
βΒ Β βΒ Β βΒ Β βββ gemini_client
βΒ Β βΒ Β βββ config
βΒ Β βΒ Β βββ migrations
βΒ Β βΒ Β βββ service
βΒ Β βΒ Β βββ database_service
βΒ Β βββ asset
βΒ Β βΒ Β βββ migrations
βΒ Β βΒ Β βββ models
βΒ Β βΒ Β βββ serializers
βΒ Β βΒ Β βββ service
βΒ Β βΒ Β βΒ Β βββ asset_approve_service
βΒ Β βΒ Β βΒ Β βΒ Β βββ lead_role_service
βΒ Β βΒ Β βΒ Β βββ asset_assign_service
βΒ Β βΒ Β βΒ Β βββ asset_count_service
βΒ Β βΒ Β βΒ Β βββ asset_crud_service
βΒ Β βΒ Β βΒ Β βββ asset_lifecycle_crud_service
βΒ Β βΒ Β βΒ Β βββ asset_log_crud_service
βΒ Β βΒ Β βΒ Β βββ asset_type_crud_service
βΒ Β βΒ Β βΒ Β βββ asset_unassign_service
βΒ Β βΒ Β βΒ Β βββ business_unit_crud_service
βΒ Β βΒ Β βΒ Β βββ data_import_service
βΒ Β βΒ Β βΒ Β βββ employee_crud_service
βΒ Β βΒ Β βΒ Β βββ export_service
βΒ Β βΒ Β βΒ Β βββ location_crud_service
βΒ Β βΒ Β βΒ Β βββ memory_crud_service
βΒ Β βΒ Β βββ tests
βΒ Β βΒ Β βββ views
βΒ Β βββ exam_django
βΒ Β βββ notification
βΒ Β βΒ Β βββ client
βΒ Β βΒ Β βββ config
βΒ Β βΒ Β βββ migrations
βΒ Β βΒ Β βββ service
βΒ Β βΒ Β βββ utils
βΒ Β βΒ Β βββ email_body_contents
βΒ Β βββ static
βΒ Β βββ user_auth
βΒ Β βΒ Β βββ migrations
βΒ Β βΒ Β βββ tests
βΒ Β βββ utils
βββ exam_frontend
βββ public
βΒ Β βββ images
βΒ Β βΒ Β βββ authentication
βΒ Β βΒ Β βββ products
βΒ Β βΒ Β βββ users
βΒ Β βββ static
βββ src
βββ Test
βΒ Β βββ AssetTable
βΒ Β βββ Charts
βΒ Β βββ DrawerComponent
βΒ Β βββ DropDown
βΒ Β βββ Export
βΒ Β βββ GlobalSearch
βΒ Β βββ RejectedAssetPage
βββ components
βΒ Β βββ AddAsset
βΒ Β βΒ Β βββ types
βΒ Β βββ AssetTable
βΒ Β βΒ Β βββ api
βΒ Β βΒ Β βββ types
βΒ Β βββ AssignAsset
βΒ Β βΒ Β βββ AssetTable
βΒ Β βΒ Β βΒ Β βββ CardComponent
βΒ Β βΒ Β βΒ Β βΒ Β βββ types
βΒ Β βΒ Β βΒ Β βββ types
βΒ Β βΒ Β βββ Assign
βΒ Β βΒ Β βββ types
βΒ Β βββ AutocompleteBox
βΒ Β βΒ Β βββ api
βΒ Β βββ Avatar
βΒ Β βββ CardComponent
βΒ Β βΒ Β βββ types
βΒ Β βββ ChatBot
βΒ Β βββ DashBoardCardComponent
βΒ Β βΒ Β βββ types
βΒ Β βββ DashboardAssetTable
βΒ Β βΒ Β βββ types
βΒ Β βββ Deallocate
βΒ Β βΒ Β βββ AssetTable
βΒ Β βΒ Β βββ CardComponent
βΒ Β βΒ Β βΒ Β βββ types
βΒ Β βΒ Β βββ types
βΒ Β βββ DrawerComponent
βΒ Β βΒ Β βββ types
βΒ Β βββ DropDown
βΒ Β βββ Export
βΒ Β βββ GlobalSearch
βΒ Β βΒ Β βββ types
βΒ Β βββ Navbar
βΒ Β βββ NoData
βΒ Β βββ QueryBuilder
βΒ Β βΒ Β βββ api
βΒ Β βΒ Β βββ types
βΒ Β βββ SideDrawerComponent
βΒ Β βΒ Β βββ types
βΒ Β βββ TableNavBar
βΒ Β βΒ Β βββ types
βΒ Β βββ TimelineLog
βΒ Β βΒ Β βββ api
βΒ Β βββ Tooltip
βΒ Β βΒ Β βββ types
βΒ Β βββ Upload
βΒ Β βββ UserContext
βΒ Β βββ charts
βΒ Β βΒ Β βββ api
βΒ Β βΒ Β βββ chartHandlers
βΒ Β βΒ Β βΒ Β βββ PieChartHandlers
βΒ Β βΒ Β βΒ Β βββ types
βΒ Β βΒ Β βββ types
βΒ Β βββ sidebar
βΒ Β βββ types
βββ config
βββ layouts
βββ pages
βββ ApprovedRequest
βββ AssignAsset
βββ Deallocate
βββ ExpiredAssets
βββ MyApprovals
βββ PendingRequest
βββ RejectedAssetPage
βββ RequestPage
βββ UpdatableAssetPage
βββ authentication
βββ index
βββ types
- Docker and Docker Compose
- Python 3.10+
- Node.js 18.20+ and yarn
- MySQL
Profiles are used for running docker containers in different environments.
Note: Add .env in exam_django with the configurations required for deploying in development environment
Note: Add aad.config.json in exam_django with the corresponding configurations
Note: Update .env in exam_frontend with the configurations required for deploying in development environment
docker compose --profile development up
Note: Add .prod.env in exam_django with the configurations required for deploying in stage environment
Note: Add aad.config.json in exam_django with the corresponding configurations
Note: Update .env in exam_frontend with the configurations required for deploying in stage environment
docker compose --profile stage up
cd exam_django
// Create python virtual environment
pip install -r requirements.txt
// Dummy Values
DJANGO_SECRET_KEY=3r5@t!s6%j8(2)u@l*9z4&c%k1#s@9a7*
DEBUG_STATUS=True
DB_NAME=asset_management_database
DB_USER=my_user
DB_PORT=3306
DB_PASSWORD=my_password
DB_HOST=localhost
ALLOWED_HOSTS=localhost,127.0.0.1
CORS_ORIGIN_WHITELIST=http://localhost:5173
CORS_ALLOWED_ORIGINS=http://localhost:5173
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/0
EMAIL_HOST_USER=myemail@gmail.com
EMAIL_HOST_PASSWORD=abcd efgh ijk lmno
EMAIL_PORT=587
EMAIL_USE_TLS=True
SENTRY_DSN=https://72b3f8d4d2e4a2fc56d0c00e2a94b82e@r6248150176033174.ingest.us.sentry.io/234723642389
HEALTH_CHECK_APP=http://localhost:8000/health/app/
HEALTH_CHECK_EXTERNAL=http://localhost:8000/health/external/
BACKUP_PARENT_DIR=backup
FULL_BACKUP_DIR=full_backup
GOOGLE_API_KEY=your_api_key
Change values of:
- client_id
- client_credential
- authority
// Dummy values
{
"type": {
"client_type": "CONFIDENTIAL",
"authority_type": "SINGLE_TENANT",
"framework": "DJANGO"
},
"client": {
"client_id": "12312cab-2342342-df324-32434c",
"client_credential": "kasjdflasjdf3ou.asdjf~sdf23i9",
"authority": "https://login.microsoftonline.com/723ba763cdf2370238"
},
"auth_request": {
"redirect_uri": null,
"scopes": [],
"response_type": "code"
},
"flask": null,
"django": {
"id_web_configs": "MS_ID_WEB_CONFIGS",
"auth_endpoints": {
"prefix": "auth",
"sign_in": "sign_in",
"edit_profile": "edit_profile",
"redirect": "redirect",
"sign_out": "sign_out",
"post_sign_out": "post_sign_out"
}
}
}
python manage.py migrate
python manage.py runserver
The development server will be hosted on http://localhost:8000 by default.
In another terminal,
celery -A exam_django worker --pool=solo --loglevel=info
In another terminal,
celery -A exam_django beat --loglevel=info
cd exam_frontend
yarn install
// Dummy values
VITE_CONFIG_URL=http://localhost:8000/api/v1
VITE_ADD_ASSET_URL=http://localhost:8000/api/v1/asset/
VITE_LOGIN_URL=http://localhost:8000/auth/sign_in
VITE_GET_ASSET_TYPE=http://localhost:8000/api/v1/asset/asset_type
yarn dev
You should have curl
installed in your system
cd exam_django/dummy_data_scripts/
chmod +x dummy_data.sh
./dummy_data.sh 127.0.0.1
cd exam_django/dummy_data_scripts/
dummy_data.bat 127.0.0.1
- username:
getwithashish.sysadmin
- password:
getwithashish@sysadmin
- username:
getwithashish.lead
- password:
getwithashish@lead
Feel free to open issues or pull requests if you find any bugs or have improvements.