Commit Graph

83 Commits

Author SHA1 Message Date
6311a737eb feat: update timezone handling in api_root to use current timezone dynamically 2025-12-05 10:43:20 +00:00
eb54d1784c feat: enhance appointment scheduling with user timezone support and email reminders 2025-12-05 10:34:19 +00:00
6fe52b4998 feat: remove initial migrations for meetings and users models 2025-12-04 12:35:50 +00:00
912b7ed2a2 feat: add max_length to jitsi_meet_url field and include debug prints for field lengths in AppointmentRequest 2025-12-04 12:30:32 +00:00
cd5fd63399 feat: add debug prints for field lengths in AppointmentRequest before saving 2025-12-04 12:25:35 +00:00
596188144b feat: add max_length to jitsi_meeting_password field in AppointmentRequest model 2025-12-04 12:10:27 +00:00
1480049f3c feat: refactor AppointmentRequest model to use standard fields instead of encrypted fields 2025-12-04 12:09:46 +00:00
2dc08aeded feat: update AppointmentRequest model fields and adjust migration files 2025-12-04 12:01:34 +00:00
ddab7313ee feat: remove obsolete migration files for meetings and users 2025-12-04 11:34:49 +00:00
a2243046e9 feat: increase max_length for EncryptedEmailField to 2000 2025-12-04 11:21:33 +00:00
b434858faf feat: increase max_length for fields in AppointmentRequest model 2025-12-04 11:07:54 +00:00
82af34c2e4 feat: add start and end meeting endpoints for scheduled appointments 2025-12-04 10:57:19 +00:00
31a1f56fc9 feat: increase max_length for encrypted fields in AppointmentRequest model 2025-12-04 10:49:27 +00:00
875a284893 feat: refactor AppointmentRequest methods and update serializers to include selected_slots field 2025-12-03 20:10:15 +00:00
53aac43289 feat: add selected_slots field to AppointmentRequest model and update serializers 2025-12-03 15:44:56 +00:00
99f9dac965 Refactor code structure for improved readability and maintainability 2025-12-02 19:32:51 +00:00
d5c3f12dbb feat: refactor contact message handling and update appointment request model 2025-12-01 18:40:56 +00:00
cd5ad1d753 feat: add contact form functionality with admin management
Add a complete contact form system with the following changes:
- Create ContactMessage model to store form submissions with tracking fields (is_read, is_responded)
- Implement ContactMessage admin interface with custom actions, filters, and bulk operations
- Add contact endpoint documentation to API root view
- Update email configuration to use admin@attunehearttherapy.com as sender address

This enables users to submit contact inquiries and allows administrators to track and manage these messages efficiently through the Django admin panel.
2025-11-28 15:52:06 +00:00
23c185c93d refactor(meetings): standardize null handling for Jitsi fields and enhance emails
- Set explicit default=None for jitsi_room_id field to ensure consistent null handling
- Update rejection logic to use None instead of empty strings for Jitsi fields, maintaining database consistency with nullable field definitions
- Add login instructions to appointment confirmation email directing users to join 15 minutes early
- Remove outdated "self-guided resources" option from rejection email
- Add styling for new login-info section in scheduled appointment template

This ensures proper null value handling in the database and improves user communication for appointment workflows.
2025-11-28 12:50:33 +00:00
027d216fcb security: remove localhost origins from CORS allowed list
Remove local development URLs (localhost:3000 and 127.0.0.1:3000) from
CORS_ALLOWED_ORIGINS configuration. This restricts CORS to only allow
requests from the production domain (attunehearttherapy.com), improving
security by preventing unauthorized cross-origin requests from
development environments.
2025-11-28 10:50:43 +00:00
b43ead53c6 fix(email): hardcode admin dashboard URL and open in new tab
- Replace dynamic admin_dashboard_url construction with hardcoded production URL (https://attunehearttherapy.com/admin/dashboard)
- Add target="_blank" to admin notification email button to open dashboard in new tab
- Improves user experience by preventing email client navigation disruption
2025-11-27 21:09:52 +00:00
bc001074b1 style: add blank lines for improved code readability
Add extra blank lines in booking_system and meetings views to improve
code structure and visual separation between logical sections. This
enhances code readability without affecting functionality.

Changes:
- booking_system/views.py: added blank line after availability_system section
- meetings/views.py: added blank line after get_queryset method
2025-11-27 19:54:03 +00:00
774ac584b4 refactor: convert user appointment endpoints from POST to GET
Changes:
- Refactored UserAppointmentsView and UserAppointmentStatsView to use GET instead of POST
- Removed email parameter
2025-11-27 19:51:55 +00:00
98b9274e03 docs: update API documentation with example data and user appointments endpoint
- Replace generic placeholder data with specific examples in API root documentation
- Update example email from 'user@example.com' to 'saanii929@gmail'
- Update example names from 'John Doe' to 'Saani Iddi'
- Update example phone number to '+233552732025'
- Add POST method support to user_appointments endpoint
- Add request_fields and example_request to user_appointments documentation

Note: Consider using generic placeholder data instead of real personal information in API documentation examples.
2025-11-27 18:43:51 +00:00
20b7455eb7 refactor(emails): update support email to admin address
- Change support email from hello@attunehearttherapy.com to admin@attunehearttherapy.com across all email templates
- Remove support contact section from admin notification template
- Standardize email addresses by hardcoding admin email in templates
- Remove unused CSS comment from base email template

This ensures consistent support contact information across the application and directs user inquiries to the appropriate admin channel.
2025-11-27 18:30:23 +00:00
9ebfa76d6a fix: update default admin email fallback address
Changed the fallback admin email from 'hello@' to 'admin@attunehearttherapy.com' in the email service. This ensures admin notifications are sent to the correct administrative email address when ADMIN_EMAIL setting is not configured.
2025-11-27 17:31:16 +00:00
e66352e9ad Adding migrations 2025-11-27 15:18:56 +00:00
0e7e51dc7d Deleting migrations 2025-11-27 15:00:16 +00:00
7d5d3217a0 fix: allow null values for Jitsi fields in AppointmentRequest
Add `null=True` to `jitsi_meet_url` and `jitsi_room_id` fields in the AppointmentRequest model. This allows these optional fields to be NULL at the database level in addition to accepting blank values, which is the proper Django pattern for optional string-based fields.

This change requires a database migration to be generated and applied.
2025-11-27 14:56:37 +00:00
b58338db2f refactor(meetings): increase encrypted field lengths and add ID to admin
- Increase max_length from 100 to 255 for first_name and last_name encrypted fields
- Increase phone field max_length from 20 to 255 to accommodate encryption overhead
- Add 'id' field to AppointmentRequest admin list_display for easier reference
- Remove redundant docstring from _convert_to_datetime method

The increased field lengths ensure adequate storage for encrypted data, which typically requires more space than plaintext values.
2025-11-27 14:43:50 +00:00
a7d451702f docs(api): refactor appointments endpoint documentation structure
Enhanced the API root documentation for the appointments system with improved formatting and updated description to include "flexible availability" feature. Restructured the endpoint documentation for better readability and maintainability while preserving all endpoint information including Jitsi meeting integration details.
2025-11-26 19:30:26 +00:00
ce3b0b77f5 feat(api): change user appointment stats endpoint to POST method
Changed the user_appointment_stats endpoint from GET to POST method
and added email as a required field. This change allows for more
flexible querying of appointment statistics by requiring user email
in the request body rather than URL parameters.

BREAKING CHANGE: The /api/meetings/user/appointments/stats/ endpoint
now accepts POST requests instead of GET and requires an email field
in the request body.
2025-11-26 16:20:40 +00:00
ea99552d95 refactor(meetings): change UserAppointmentStatsView from GET to POST
Modified UserAppointmentStatsView to accept POST requests instead of GET
and retrieve email from request body rather than from authenticated user.
This allows querying appointment statistics for any email address instead
of being limited to the current user's email.

Changes:
- Changed HTTP method from GET to POST
- Added email parameter extraction from request.data
- Updated filter to use provided email instead of request.user.email
2025-11-26 16:03:09 +00:00
4f07d854e1 config: add CSRF trusted origins for production domains
Add CSRF_TRUSTED_ORIGINS setting to whitelist the production domains
(attunehearttherapy.com and its api subdomain) for CSRF verification.
This ensures secure cross-origin POST requests from the frontend.

Also add documentation comment for CORS configuration section.
2025-11-25 18:27:57 +00:00
4b75d38713 build: update project dependencies in requirements.txt
Modified requirements.txt to update project dependencies. The file
appears to have encoding changes or significant content modifications.
Unable to display specific package changes due to binary diff format.
2025-11-25 18:18:27 +00:00
d0dcfccb7f feat(config): improve security and add WhiteNoise static file serving
**Security Improvements:**
- Fix DEBUG setting to properly parse boolean from environment variable
- Remove hardcoded SMTP password fallback, rely solely on env var
- Update Celery to use REDIS_URL environment variable instead of hardcoded localhost

**Static File Serving:**
- Add WhiteNoise middleware for production-grade static file serving
- Configure CompressedManifestStaticFilesStorage for optimized delivery

**Configuration Updates:**
- Enable CORS credentials support
- Remove duplicate CORS_ALLOWED_ORIGINS configuration
- Update API documentation title from "Blog API" to "Attune Heart Therapy API"
- Clean up code formatting and remove unnecessary comments

These changes make the application more secure by eliminating hardcoded
credentials and more deployment-ready by properly handling environment
variables and serving static files efficiently in production.
2025-11-25 18:14:40 +00:00
d1a8f4403a fix(settings): remove line break in CORS_ALLOWED_ORIGINS string
Consolidate CORS_ALLOWED_ORIGINS default value onto a single line
to fix formatting issue. Removes unnecessary line break and trailing
whitespace that was splitting the URL string across multiple lines.
2025-11-25 17:41:43 +00:00
7ee3663ffa config: add production domain to CORS allowed origins
Add attunehearttherapy.com to the CORS_ALLOWED_ORIGINS setting to enable cross-origin requests from the production domain. This allows the frontend application hosted at the production URL to communicate with the backend API.
2025-11-25 17:37:06 +00:00
aa0ac8c1c8 #$ 2025-11-24 18:30:43 +00:00
16c4afdce5 config: make ALLOWED_HOSTS configurable via environment variable
Change ALLOWED_HOSTS from a hardcoded list to be read from environment
variable with comma-separated values support. Maintains '*' as default
fallback for backward compatibility. This allows more restrictive host
configuration in production environments while improving security posture.
2025-11-24 13:36:11 +00:00
1ffbfa5692 feat: add API documentation with drf-spectacular and refactor views
- Install and configure drf-spectacular for OpenAPI/Swagger documentation
- Add Swagger UI endpoints at /api/schema/ and /api/docs/
- Configure SPECTACULAR_SETTINGS with API metadata
- Refactor meetings views from function-based to class-based views
  (ScheduleAppointmentView, RejectAppointmentView, AvailableDatesView,
  UserAppointmentsView, AppointmentStatsView, UserAppointmentStatsView)
- Update URL patterns to use new class-based views
- Simplify ALLOWED_HOSTS configuration to accept all hosts

This improves API discoverability through interactive documentation
and modernizes the codebase by using class-based views for better
code organization and reusability.
2025-11-24 13:29:07 +00:00
9aef796fc7 feat: add user appointment stats endpoint to API root documentation
Add documentation for the new user-specific appointment statistics endpoint
to the API root view. This endpoint provides authenticated users with their
appointment analytics including total requests, pending reviews, scheduled,
rejected, and completed appointments along with completion rate.

The endpoint is available at /api/meetings/user/appointments/stats/ and
requires authentication via GET request.
2025-11-24 11:55:42 +00:00
b7a4e73d93 refactor(config): use dj-database-url for flexible database configuration
- Add dj-database-url package for parsing DATABASE_URL
- Replace hardcoded PostgreSQL config with DATABASE_URL environment variable
- Add connection pooling with conn_max_age and health checks
- Fallback to SQLite for local development when DATABASE_URL is not set
- Remove obsolete production config comments
- Update requirements.txt with new dependency

This change improves deployment flexibility by supporting standard DATABASE_URL format commonly used in cloud platforms (Heroku, Railway, etc.) while maintaining backward compatibility with local development using SQLite.
2025-11-24 00:01:30 +00:00
0a5a5fa800 chore: switch database backend from SQLite to PostgreSQL
Replace SQLite database configuration with PostgreSQL to improve
scalability and production readiness. PostgreSQL configuration uses
environment variables (POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD,
POSTGRES_HOST, POSTGRES_PORT) for flexible deployment across different
environments.
2025-11-23 23:47:53 +00:00
570f5d8fc8 refactor(docker): streamline Dockerfile and add gunicorn workers
- Remove redundant comments for cleaner readability
- Simplify COPY commands using relative paths
- Condense pip installation RUN command to single line
- Add 3 workers to gunicorn for improved concurrent request handling
- Remove accidentally included .dockerignore content from Dockerfile

This improves Dockerfile maintainability and production performance
by configuring multiple gunicorn workers for better throughput.
2025-11-23 23:34:59 +00:00
187bce97e7 added dockerfile 2025-11-23 23:29:50 +00:00
de9f58a7d0 RR%% 2025-11-23 23:24:57 +00:00
d736c1681c # Commit Message
```
refactor: update settings and Docker config for production

- Configure ALLOWED_HOSTS and CORS from environment variables for better security
- Switch default database from PostgreSQL to SQLite3 (PostgreSQL config commented)
- Simplify DEBUG environment variable handling
- Update Dockerfile to use Python 3.11 and gunicorn for production
- Add static file collection in Docker build process
- Add user appointment statistics endpoint (user_apointment_stats)
- Add .dockerignore to exclude unnecessary files from build

These changes improve production readiness by making critical settings
configurable via environment variables and using production-grade WSGI
server (gunicorn) instead of Django development server.
2025-11-23 23:06:17 +00:00
e38c451cff refactor(docker): convert CMD instruction to exec form
Change CMD from multi-line shell form to JSON array exec form for better
signal handling and to follow Docker best practices. Consolidate the command
chain into a single line while maintaining the same functionality (migrate,
collectstatic, runserver).
2025-11-23 19:26:56 +00:00
c5cdc5d774 refactor(docker): clean up dockerfile and improve CMD syntax
- Remove redundant inline comments for better readability
- Replace backslash line continuation with bash -c for CMD instruction
- Remove commented out gunicorn configuration line
- Improve CMD formatting using proper bash string syntax

These changes make the dockerfile cleaner and more maintainable while
preserving the same functionality (migrate, collectstatic, runserver).
2025-11-23 19:23:58 +00:00