initial commit

This commit is contained in:
2026-03-15 10:20:55 +08:00
commit ed47645fef
11 changed files with 255 additions and 0 deletions

44
backend/.env.sample Normal file
View File

@@ -0,0 +1,44 @@
# Environment
ENVIRONMENT=development
DEBUG=True
# Django Core
DJANGO_SETTINGS_MODULE=config.settings
DJANGO_SECRET_KEY=
DJANGO_ALLOWED_HOSTS=
# Database
POSTGRES_DB=app_db
POSTGRES_USER=app_user
POSTGRES_PASSWORD=app_password
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
# CORS / CSRF
CORS_ALLOWED_ORIGINS=https://app.example.com
CSRF_TRUSTED_ORIGINS=https://app.example.com
# JWT
ACCESS_TOKEN_LIFETIME=5
JWT_SECRET_KEY=
JWT_SIGNING_KEY=
JWT_ACCESS_TOKEN_LIFETIME_MINUTES=5
JWT_REFRESH_TOKEN_LIFETIME_DAYS=7
JWT_ROTATE_REFRESH_TOKENS=True
JWT_BLACKLIST_AFTER_ROTATION=True
JWT_ALGORITHM=HS256
# Redis / Celery
REDIS_URL=redis://redis:6379/0
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=
CELERY_BROKER_URL=
CELERY_RESULT_BACKEND=
# Timzone / Language
LANGUAGE_CODE=en-us
TIME_ZONE=Asia/Tehran
SMS_APIKEY=
BASE_URL=

25
backend/Dockerfile Normal file
View File

@@ -0,0 +1,25 @@
FROM python:3.14-slim
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PIP_INDEX_URL=https://package-mirror.liara.ir/repository/pypi/simple
# Adapted Runflare mirror for Debian-based official Python image
RUN . /etc/os-release && \
echo "deb http://mirror-linux.runflare.com/debian $VERSION_CODENAME main" > /etc/apt/sources.list && \
echo "deb http://mirror-linux.runflare.com/debian $VERSION_CODENAME-updates main" >> /etc/apt/sources.list && \
echo "deb http://mirror-linux.runflare.com/debian-security $VERSION_CODENAME-security main" >> /etc/apt/sources.list
RUN apt-get update \
&& apt-get install -y gcc libpq-dev \
&& rm -rf /var/lib/apt/lists/*
COPY qlockify-backend/requirements/ /app/requirements/
RUN pip install --no-cache-dir -r requirements/base.txt \
&& pip install --no-cache-dir -r requirements/prod.txt
COPY qlockify-backend/ .
CMD ["gunicorn", "core.wsgi:application", "--bind", "0.0.0.0:8000"]