WIP: new updates #48

Closed
S4NKALP wants to merge 32 commits from dev into main
pull from: dev
32 Commits
Author SHA1 Message Date
sankalp 0baf9908b5 feat(src/djinit/core): replace unsafe eval with safe expression evaluator
- New Features: Introduced safe `_eval_expr` for boolean expressions.
- Enhancements: Refactored conditional and loop parsing logic.
- Bug Fixes: Fixed variable lookup defaults and loop body capture.
2026-05-11 17:05:58 +05:45
sankalp 9fe48a5692 feat(src/djinit/templates/project/frontend): use .jsx entry point in frontend template
The templates now reference a React entry script; switching from .js to .jsx ensures the compiled asset is correctly loaded and improves template fidelity, preventing missing script errors.

Enhancements
- Updated index.html‑tpl to reference `/src/main.jsx` instead of `/src/main.js`
- Normalized line endings for both index‑vue.html‑tpl and index.html‑tpl
2026-05-11 01:06:13 +05:45
sankalp e33bf9474f chore(src/djinit/templates/project): Clean up trailing whitespace and newline formatting in templates
- Remove stray backslashes and extra whitespace in Dockerfile, conftest, docker-compose, dockerignore, and Vue package templates
- Ensure consistent line endings and proper formatting across all generated template files
2026-05-11 01:06:07 +05:45
sankalp 0765f8d1c2 refactor(examples): add noqa comment to silence import-order lint warnings
- Bug Fixes:
  - Silence flake8 E402 import-order warnings in example scripts
2026-05-11 01:06:00 +05:45
sankalp 553376770f chore(src/djinit/templates/project/frontend/src): normalize newline handling in frontend templates
Bug Fixes
- Remove erroneous '\ No newline at end of file' markers from template files
- Ensure each template ends with a proper newline
2026-05-11 01:05:58 +05:45
sankalp 2b219d39b0 feat(root): Add comprehensive Django project template with modern scaffoldingNew Features
- Modern project structure with environment‑specific settings
- Pre‑configured REST API with JWT authentication
- Split settings for development and production
- API documentation via Swagger UI- CORS configured for local development
- WhiteNoise for static files
- Modern admin interface (django‑jazzmin)
- Docker support (Dockerfile, docker‑compose.yml)
- Frontend integration with Vite + React/Vue via django‑vite
- Testing framework (pytest, pytest‑django, pytest‑cov)
- Async task queues: Django‑Q2 and Celery with Redis
- Production‑ready configuration (Procfile, runtime.txt)
- Development tools via Justfile
- Environment template (.env.sample) and Git‑ready .gitignore

Enhancements
- Refactored layout with separate config modules (base, development, production)
- Organized API endpoints by model under `api/` directory
- Updated README with detailed setup instructions and command shortcuts
- Added Justfile with common development commands

Bug Fixes
- (none)
2026-05-11 00:57:37 +05:45
sankalp 937a9cbc3e feat(root): enrich README with optional featuresand modern stack options
Update the configuration wizard to expose a broader set of optional integrations, reflect the latest project scaffolding capabilities, and clarify deployment components.

Details:
- New Features:
  - Docker support (Dockerfile, docker-compose.yml)
  - Frontend integration via Vite + React or Vue (django‑vite)
  - Optional testing stack (pytest, pytest‑django, pytest‑cov)
  - Optional async task handlers (django‑q2, Celery with Redis)
  - Additional database driver (psycopg for PostgreSQL/MySQL)
  - Modern admin UI (django‑jazzmin)
- Enhancements:
  - Expanded list of optional CLI options (HTMX, Tailwind, etc.)
  - Updated roadmap and TODO references
  - Improved clarity of PostgreSQL/MySQL support statement- Bug Fixes: none
2026-05-11 00:57:32 +05:45
sankalp 605ef9a82e feat(src/djinit): add Django‑Q and Celery configuration options to scaffolding
- New Features
  - Introduce `use_django_q` and `use_celery` boolean flags in the project metadata
  - Add UI prompts to confirm inclusion of Django‑Q2 and Celery when generating a project
  - Expose these flags to all file templates and context processing
- Enhancements
  - Update context dictionaries and file generation to respect the new flags  - Extend required files handling for unified and single project structures
  - Display Django‑Q2 and Celery choices in the final project summary output
2026-05-11 00:51:14 +05:45
sankalp 7281336bf3 feat(src/djinit/templates):add conditional django_q and celery applications and configurationAdd django_q and celery to project settings when feature flags are enabled, and provide default configuration values for both. Extend requirements template with corresponding dependencies. 2026-05-11 00:51:11 +05:45
sankalp fbb9a2b614 feat(src/djinit/utils): add use_django_q and use_celery to metadata dictionary
Add configurable flags for enabling Django Q and Celery in generated projects.

New Features:
- Introduce `use_django_q` and `use_celery` entries in the metadata dictionary, defaulting to False when unspecified.
- Allow downstream code to conditionally activate these features based on user configuration.

Enhancements:
- Extend the metadata schema to support additional Django ecosystem integrations.
2026-05-11 00:51:05 +05:45
sankalp d3c5c6a69c chore(root): finalizetask checklist for Celery and Django‑Q2This update marks the Celery integration as completed and adds Django‑Q2 as an optional async task queue with Redis broker. The checklist now reflects the current state of optional async task queue integrations.
- New Features
  - Added Django‑Q2 optional async task queue (default disabled)
- Enhancements
  - Completed Celery integration tasks
- Bug Fixes
  - None
2026-05-11 00:51:01 +05:45
sankalp b8564f7780 feat(examples): expand test suiteand improve error handling
New Features
- Added extensive test configurations for Docker, React, Vue, Tailwind, pytest, and various combinations.
- Introduced new scenarios such as docker_react, docker_vue, docker_react_htmx, all_postgres, all_mysql, and unified structures.

Enhancements
- Added missing comma in metadata dictionary for valid syntax.
- Enhanced exception handling to print traceback on errors.
- Updated path formatting to use consistent double‑quoted strings.
- Improved cleanup of test directories and imports.

Bug Fixes
- Fixed syntax error in metadata dict that caused runtime failure.
- Corrected path construction to use forward slashes for cross‑platform compatibility.
2026-05-11 00:50:56 +05:45
sankalp b1c1ea9b15 feat(src/djinit): add Vue scaffolding supportNew Features
- Added `use_vue` flag to enable Vue generation and introduced `create_vue_files()` method that scaffolds Vite/Vue frontend files (vite.config.js, package.json, index.html, App.vue, style.css, main.js).
- Extended context dictionaries in `FileCreator`, utility classes, and Django helper to include `use_vue`.

Enhancements
- Integrated Vue file creation into the setup pipeline via `_create_vue_files()` with success messaging.
- Propagated `use_vue` configuration through serialization and UI feedback.

Bug Fixes
- (none)
2026-05-11 00:30:19 +05:45
sankalp 6baa751543 feat(templates): add Vue.js scaffolding and related template files
Add Vue.js frontend scaffolding to djinit, generating necessary Vue/Vite templates and updating conditionals for use_vue support.

- New Features
  - Add Vue.js template files: index-vue.html-tpl, App.vue-tpl, main.js-tpl, style.css-tpl.
  - Generate package-vue.json-tpl with Vite + Vue dependencies.
  - Create vite-vue.config.js-tpl for Vite configuration.
- Enhancements
  - Update base.py-tpl to conditionally load django-vite when use_vite | use_vue.
  - Add django-vite dependency in requirements-tpl under use_vue.
- Bug Fixes  - None.
2026-05-11 00:30:11 +05:45
sankalp 81830d981b feat(ui): add Vue selection support
Add Vue integration via Vite and update UI prompts and metadata- New Features
  - Introduce `use_vue` flag and corresponding UI confirmation
  - Expose `get_vue_choice()` method and propagate selection through metadata
  - Add console output for Vue confirmation in final summary

- Enhancements
  - Update step ordering and comments to reflect Vue/Vite handling
  - Adjust data flow in code to include Vue option consistently

- Bug Fixes
  - None
2026-05-11 00:30:04 +05:45
sankalp 8e0c014953 feat(root): extend frontendintegration with Vue and add testing framework
Add pytest testing framework and update checklist to include Vue.

New Features
- Add pytest, pytest-django, pytest-cov as testing framework
- Include Vue in Frontend Integration description

Enhancements
- Update checklist entry to reflect Vue inclusion

Bug Fixes
- None
2026-05-11 00:30:01 +05:45
sankalp 2d1b292991 feat(examples): add comprehensive test suite covering all djinit features
New Features
- Added extensive test file examples/test_all.py with full coverage of setup creator scenarios

Enhancements
- None

Bug Fixes
- None
2026-05-11 00:29:56 +05:45
sankalp 500d7469db feat(src/djinit): add pytest integration support
New Features:
- Generate pytest configuration files (pytest.ini, conftest.py) when `use_pytest` is enabled.
- Introduce UI prompt to optionally include pytest.

Enhancements:
- Update metadata and context dictionaries to propagate `use_pytest`.
- Register pytest file creation in the project setup pipeline.
- Reflect pytest inclusion in UI success messages.

Bug Fixes: None.
2026-05-11 00:17:40 +05:45
sankalp 1bb3443237 feat(src/djinit/templates): scaffold pytest fixtures and configuration templates- New Features
- Added conftest.py template with Django test database, API client, and test user fixtures.
  - Added pytest.ini template configuring settings, test discovery, and custom markers.
  - Integrated pytest and coverage requirements into the project requirements template.

- Enhancements
  - None

- Bug Fixes
  - None
2026-05-11 00:17:32 +05:45
sankalp 37d53e7737 feat(src/djinit/utils): add use_pytest flag to DjangoHelper context
Add a boolean `use_pytest` option that is populated from the project metadata and included in the generated Django assistant context. This allows projects to explicitly opt‑in to pytest integration when using djinitx.

- New Feature: Introduce `use_pytest` configuration key in the Django helper metadata dictionary.
- Enhancement: Expand context preparation to support additional project preferences.
2026-05-11 00:17:29 +05:45
sankalp 1b1d038ccd feat(examples): enhance bug_checkand full_test with detailed verification and summary
- New Features:
  - Added comprehensive test runner that cleans up temporary directories, verifies generated files, and prints a pass/fail summary.
  - Introduced specific validation for pytest configuration, Vite integration, and Dockerfile dependencies based on selected metadata.
  - Implemented clear pass/fail reporting with overall success metrics.

- Enhancements:
  - Refactored bug_check.py to use explicit data structures and consistent double‑quote quoting for path construction.
  - Improved formatting and readability of metadata definitions and context preparation.
  - Fixed Windows‑specific path handling regression by switching to double‑quoted string interpolation.

- Bug Fixes:
  - Corrected path building to use double‑quoted strings, preventing potential path parsing issues on Windows.
2026-05-11 00:17:26 +05:45
sankalp 5c05f246b1 feat(root): add Vite+React frontend integration, Vue.js option, and full testing setup
- New Features
  - Add Vite + React frontend integration (updates TODO checklist)
  - Introduce Vue.js as an optional frontend template
  - Enable complete testing framework with pytest, pytest-django, and pytest-cov
- Enhancements
  - Expand project structure templates (Standard, Predefined, Unified, Single)
  - Add interactive configuration wizard
  - Strengthen structure detection and bug fixes
- Bug Fixes
  - Resolve incomplete testing dependencies to ensure full coverage integration
2026-05-11 00:17:20 +05:45
sankalp 16cd1ed510 feat(src/djinit): add Vite and React front‑end scaffolding
The CLI now scaffolds a Vite‑powered frontend when the `use_vite` flag is enabled, providing React entry files, configuration, and basic styling.

- New Features  - Create `vite.config.js`, `package.json`, and core React source files (`main.jsx`, `App.jsx`, `index.jsx`, `index.css`).
  - Add helper methods `_create_vite_files` and `create_vite_files` integrated into project setup.
  - Generate frontend directories and `__init__.py` placeholders automatically.
- Enhancements
  - Propagate `use_vite` context to templates for `requirements.txt`, CI/CD pipelines, and Docker files.
  - Emit success message after Vite files are created.
  - Include Vite‑related checks in setup step list.
- Bug Fixes
  - None reported.
2026-05-10 23:58:28 +05:45
sankalp ad58694206 feat(src/djinit/templates): introduceVite‑powered React frontend scaffold and django‑vite integration
Add a minimal React frontend template (index.html, App.jsx, index.css, main.jsx) and configure static asset handling.
Update Docker Compose to populate DATABASE_URL according to the selected database type.
Include django‑vite in the template requirements and settings.

- New Features
  - Scaffold `frontend` directory with React components and Vite entry point.
  - Configure static URLs, root, and alias via `STATIC_URL`, `STATIC_ROOT`, and `DJANGO_VITE_ASSET_SRC`.
- Enhancements
  - Dynamically set `DATABASE_URL` in `docker-compose.yml` for PostgreSQL or MySQL.
  - Add `django-vite` to `THIRD_PARTY_APPS` and `requirements-tpl`.
- Bug Fixes
  - None.
2026-05-10 23:58:24 +05:45
sankalp 9104b1bd79 feat(root): add new project structures and enhance Docker/frontend support
Summary: Introduced additional project structure templates and expanded Docker, frontend, and Tailwind integrations while fixing bugs.

New Features:
- Docker Support: Auto‑generates Dockerfile, docker-compose.yml, and .dockerignore
- Frontend Integration: Vite/React scaffold via django‑vite (frontend/, vite.config.js, package.json)
- Tailwind CSS: Integrated via django‑tailwind-cli
- HTMX: Integrated via django‑htmx

Enhancements:
- Added more project structure templates (Standard, Predefined, Unified, Single)
- Added interactive configuration wizard
- Improved structure detection
- Fixed bugs (all tests passing, verified issue‑free)
2026-05-10 23:58:17 +05:45
sankalp 0032934ace feat(src/djinit/ui): add Vite/React selection support
- Add `UIFormatter.get_vite_choice()` to prompt inclusion of Vite/React via django‑vite
- Introduce `use_vite` flag in `StructureOptions`, store it in metadata, and propagate to scaffolding templates
- Update CLI prompts and final project summary to display Vite/React confirmation
- Extend usage of the flag throughout app generation to honor the selected frontend stack
2026-05-10 23:58:14 +05:45
sankalp a43e35e925 feat(examples): add bug detection script for djinit templates
This script validates template consistency and metadata usage, ensuring generated configurations are correct across all use‑case combinations. It provides automated checks to catch missing variable replacements, unused metadata fields, and mis‑configured requirements.

- New Features
  - Introduce `check_template_consistency` to detect unreplaced `[[` variables in all templates.
  - Implement `check_metadata_usage` to verify that all metadata flags are correctly applied.
  - Iterate through all feature combinations to test requirements and settings rendering.

- Enhancements  - Added structured console output sections for each generated example file.
  - Integrated explicit error reporting for template rendering failures.

- Bug Fixes
  - (none)
2026-05-10 23:58:12 +05:45
sankalp 8f47506ead feat(src/djinit/core): adduse_docker and use_vite configuration flags
Add `use_docker` and `use_vite` boolean fields to `ProjectMetadata` and include them in the metadata dictionary serialization.

- New feature: expose Docker and Vite enable flags.
- Enhancement: extend metadata output to reflect the new configuration options.
2026-05-10 23:26:43 +05:45
sankalp 6e41e121f0 feat(src/djinit/ui): add docker and vite selection options
This release extends the UI to let users opt‑in to Docker support and Vite integration when generating a Django project.

- New Features
  - Add `use_docker` and `use_vite` fields to `StructureOptions`
  - Implement `get_docker_choice` method with a confirmation prompt- Enhancements
  - Propagate Docker and Vite selections through metadata and CLI prompts  - Include Dockerfile and docker‑compose when Docker is enabled
- Bug Fixes  - (none)
2026-05-10 23:26:41 +05:45
sankalp 7b8d7422a5 feat(root):finalize Docker Support implementation 2026-05-10 23:26:36 +05:45
sankalp 6726298fd8 feat(src/djinit/templates/project): add Dockerfile, docker-compose.yml, and .dockerignore templates
The new templates provide a ready‑to‑use Docker environment for Django projects, including system dependencies, container orchestration, and build‑context exclusions.

New Features
- Dockerfile template with Python 3.13‑slim base, environment variables, apt dependencies, and Gunicorn command.
- docker-compose.yml template with web service and conditional database services (PostgreSQL or MySQL).
- .dockerignore template to exclude irrelevant files and speed up Docker builds.

Enhancements
- Updated .gitignore with Docker‑specific entries to keep repositories clean.

No Bug Fixes.
2026-05-10 23:26:30 +05:45
sankalp 98fe8c7987 feat(src/djinit/creators): add conditional Docker file generation to project scaffolding
Adds creation of Dockerfile, docker-compose.yml, and .dockerignore when `use_docker` metadata is true, integrates the step into the setup pipeline, and registers the task in `SetupCreator`. Enables out‑of‑the‑box Docker support for generated Django projects.

New Features
- Generate Dockerfile, docker-compose.yml, and .dockerignore from templates upon project creation.
- Register Docker file creation step in the setup pipeline and execute only when `use_docker=True`.
- Extend metadata config with `use_docker` flag to control Docker file inclusion.

Enhancements
- Streamline Docker file generation through templated rendering, ensuring a consistent project structure.

Bug Fixes
- None.
2026-05-10 23:26:24 +05:45