Skip to content

Login api for frontend, and docker containerized deployment#3

Merged
MaxWutw merged 6 commits intomainfrom
login
Apr 2, 2026
Merged

Login api for frontend, and docker containerized deployment#3
MaxWutw merged 6 commits intomainfrom
login

Conversation

@MaxWutw
Copy link
Copy Markdown
Contributor

@MaxWutw MaxWutw commented Mar 28, 2026

This pull request introduces a complete Docker-based setup for the QuestFantasy backend, along with a token-authenticated user registration and login API. It includes Docker configuration, environment variable management, a custom authentication system with token expiration, and API endpoints for user registration, login, logout, and profile retrieval. The changes also update project documentation with detailed setup and usage instructions.

Dockerization and Deployment:

  • Added a Dockerfile for building the backend image, an entrypoint.sh script to manage migrations and server startup, and a docker-compose.yml file to orchestrate the Django app and PostgreSQL database, enabling easy local development and deployment. (Dockerfile, entrypoint.sh, docker-compose.yml) [1] [2] [3]
  • Updated .dockerignore to exclude unnecessary files from Docker builds. (.dockerignore)

Environment and Settings Management:

  • Updated .env.example with safer defaults, added TOKEN_TTL_SECONDS for token expiration, and changed the default database host for Docker compatibility. (.env.example)
  • Modified config/settings.py to support both PostgreSQL and fallback to SQLite, added Django and DRF settings for authentication, and configured token expiration. (config/settings.py) [1] [2] [3] [4]

Authentication and User API:

  • Implemented a custom ExpiringTokenAuthentication class to enforce server-side token expiration. (accounts/authentication.py)
  • Added serializers for user registration and login, enforcing password validation and unique email checks. (accounts/serializers.py)
  • Created API views for registration, login, logout, and profile retrieval, with endpoints exposed under /api/auth/. (accounts/views.py, accounts/urls.py, config/urls.py) [1] [2] [3]
  • Registered the accounts app in Django and added its configuration. (accounts/apps.py, config/settings.py) [1] [2]

Documentation:

  • Added a comprehensive README.md with setup, Docker installation, environment configuration, and usage instructions. (README.md)

Copy link
Copy Markdown
Member

@NaoCoding NaoCoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait for others review

Copy link
Copy Markdown

@whyer123 whyer123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MaxWutw MaxWutw merged commit 337ad68 into main Apr 2, 2026
@MaxWutw
Copy link
Copy Markdown
Contributor Author

MaxWutw commented Apr 2, 2026

Merge to main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants