Commit Graph

87 Commits

Author SHA1 Message Date
1ca8624f8d Merge pull request 'refactor(meetings): increase encrypted field lengths and add ID to admin' (#41) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/41
2025-11-27 14:44:42 +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
ab61b35913 Merge pull request 'docs(api): refactor appointments endpoint documentation structure' (#40) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/40
2025-11-26 19:41:57 +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
45f49544c2 Merge pull request 'feat(api): change user appointment stats endpoint to POST method' (#39) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/39
2025-11-26 16:21:17 +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
577e87d8db Merge pull request 'refactor(meetings): change UserAppointmentStatsView from GET to POST' (#38) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/38
2025-11-26 16:18:25 +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
1a84b8eb99 Merge pull request 'config: add CSRF trusted origins for production domains' (#37) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/37
2025-11-25 18:28:53 +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
01c5efe746 Merge pull request 'build: update project dependencies in requirements.txt' (#36) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/36
2025-11-25 18:18:54 +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
8ddf14a276 Merge pull request 'feat(config): improve security and add WhiteNoise static file serving' (#35) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/35
2025-11-25 18:15:18 +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
199a7ef403 Merge pull request 'fix(settings): remove line break in CORS_ALLOWED_ORIGINS string' (#34) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/34
2025-11-25 17:42:12 +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
3da92fa221 Merge pull request 'config: add production domain to CORS allowed origins' (#33) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/33
2025-11-25 17:38:17 +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
445b7c1774 Merge pull request 'feature/meetings' (#32) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/32
2025-11-24 18:31:24 +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
4b86761ddc Merge pull request 'feat: add API documentation with drf-spectacular and refactor views' (#31) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/31
2025-11-24 13:31:17 +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
61a703c7c2 Merge pull request 'feat: add user appointment stats endpoint to API root documentation' (#30) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/30
2025-11-24 11:57:40 +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
045b56d8f8 Merge pull request 'refactor(config): use dj-database-url for flexible database configuration' (#29) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/29
2025-11-24 00:02:03 +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
f8542a6d7a Merge pull request 'chore: switch database backend from SQLite to PostgreSQL' (#28) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/28
2025-11-23 23:48:51 +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
35f364263f Merge pull request 'refactor(docker): streamline Dockerfile and add gunicorn workers' (#27) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/27
2025-11-23 23:35:30 +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
f7b0be924d Merge pull request 'added dockerfile' (#26) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/26
2025-11-23 23:30:40 +00:00
187bce97e7 added dockerfile 2025-11-23 23:29:50 +00:00
c0d3e4da99 Merge pull request 'RR%%' (#25) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/25
2025-11-23 23:25:34 +00:00
de9f58a7d0 RR%% 2025-11-23 23:24:57 +00:00
f023a94893 Merge pull request '# Commit Message' (#24) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/24
2025-11-23 23:07:03 +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
340c478f26 Merge pull request 'refactor(docker): convert CMD instruction to exec form' (#23) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/23
2025-11-23 19:28:25 +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
cfed3ebaa7 Merge pull request 'refactor(docker): clean up dockerfile and improve CMD syntax' (#22) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/22
2025-11-23 19:24:31 +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
fdb8dde94f Merge pull request 'chore: switch from gunicorn to Django development server in dockerfile' (#21) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/21
2025-11-23 19:19:59 +00:00
c2d6ea04bc chore: switch from gunicorn to Django development server in dockerfile
Replace gunicorn production server with Django's development server
(manage.py runserver) for easier debugging. The gunicorn configuration
has been commented out rather than removed for easy restoration.

**Warning:** This change makes the application unsuitable for production
deployment as runserver is not designed for production use.
2025-11-23 19:19:29 +00:00
ceca8895e2 Merge pull request 'refactor(docker): replace uv with pip and move Django commands to runtime' (#20) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/20
2025-11-23 19:12:56 +00:00
e722cbe311 refactor(docker): replace uv with pip and move Django commands to runtime
Replace uv package manager with standard pip for dependency management.
Switch base image from debian:bookworm-slim to python:3.12-slim to include
Python runtime by default.

Key changes:
- Remove uv installation and configuration
- Use requirements.txt instead of pyproject.toml/uv.lock
- Install dependencies with pip instead of uv sync
- Move collectstatic and migrate from build-time to runtime in CMD
- Simplify gunicorn command invocation

This simplifies the build process and makes the image more portable by
using standard Python tooling. Running migrations and collectstatic at
container startup ensures they execute against the correct database and
storage backend.
2025-11-23 19:12:27 +00:00
7dfcb19547 Merge pull request 'feat: migrate to UV package manager and enhance production config' (#19) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/19
2025-11-23 18:37:06 +00:00
0a02f1db14 feat: migrate to UV package manager and enhance production config
- Replace pip with UV for faster dependency installation
- Switch base image from python:3.11-slim to debian:bookworm-slim
- Add SECURE_PROXY_SSL_HEADER for production SSL proxy support
- Optimize Docker layer caching by copying dependency files first
- Move database migration to build time for faster container startup
- Enhance Gunicorn logging with access and error log streams
- Update dependency management from requirements.txt to pyproject.toml

These changes improve build performance, production security, and
container startup time while modernizing the dependency management
workflow.
2025-11-23 18:36:23 +00:00
fb54b4e120 Merge pull request 'chore: configure for local development environment' (#18) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/18
2025-11-23 18:27:22 +00:00
98962caafb chore: configure for local development environment
- Set ALLOWED_HOSTS to accept all hosts for easier local testing
- Update Docker port from 8080 to 8000 (Django default)
- Adjust Gunicorn binding to match new port configuration

This simplifies local development setup by using standard Django
conventions and removing host restrictions. The previous specific
host configuration can be restored for production deployment.
2025-11-23 18:26:44 +00:00
4bdfbcc089 Merge pull request 'chore(config): update ALLOWED_HOSTS with new sslip.io domain' (#17) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/17
2025-11-23 17:12:08 +00:00