Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
191 changes: 20 additions & 171 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,178 +1,27 @@
.DS_Store
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# UV
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
#uv.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
# Virtual environments
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject
*.venv

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
# Environment & secrets
.env
.env.local
.env.production
.env.backup

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
# Python cache
__pycache__/
*.py[cod]
*.pyo

# Ruff stuff:
.ruff_cache/
# Logs
*.log
logs/

# PyPI configuration file
.pypirc
# IDE
.idea/
.vscode/

# IntelliJ PyCharm
.idea
# OS files
.DS_Store
Thumbs.db
18 changes: 18 additions & 0 deletions file/django_app/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# === Django ===
SECRET_KEY=change_me_in_prod
DEBUG=True
ALLOWED_HOSTS=*
CORS_ALLOW_ALL=True
# CORS_ALLOWED_ORIGINS=https://twoja-domena.pl,https://app.twoja-domena.pl

# === JWT lifetimes ===
JWT_ACCESS_MINUTES=30
JWT_REFRESH_DAYS=7

# === Superuser bootstrap (optional) ===
[email protected]
SUPERUSER_PASSWORD=admin123
SUPERUSER_FULL_NAME=Admin

# Host port mapping (host:container)
PORT=8000
27 changes: 27 additions & 0 deletions file/django_app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Virtual environments
venv/
ENV/
*.venv

# Environment & secrets
.env
.env.local
.env.production
.env.backup

# Python cache
__pycache__/
*.py[cod]
*.pyo

# Logs
*.log
logs/

# IDE
.idea/
.vscode/

# OS files
.DS_Store
Thumbs.db
23 changes: 23 additions & 0 deletions file/django_app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.12-slim

ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=1

WORKDIR /app

# System deps
RUN apt-get update && apt-get install -y --no-install-recommends build-essential && rm -rf /var/lib/apt/lists/*

# Copy requirements first (better layer caching)
COPY coworking/requirements.txt /app/requirements.txt
RUN pip install --upgrade pip && pip install -r /app/requirements.txt

# Copy app
COPY coworking /app

# Entrypoint
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

EXPOSE 8000

CMD ["/entrypoint.sh"]
85 changes: 85 additions & 0 deletions file/django_app/JAK_WRZUCIC_NA_REPO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Jak wrzucić projekt na Git - Instrukcja dla kolegów

## Krok 1: Skopiuj folder z pendrive
Skopiuj cały folder `django_app` z pendrive na swój komputer.

## Krok 2: Przejdź do folderu projektu
```bash
cd django_app
```

## Krok 3: Zainicjalizuj repozytorium Git (jeśli jeszcze nie ma)
```bash
git init
```

## Krok 4: Stwórz nowy branch
```bash
git checkout -b moj-branch
# lub
git checkout -b dev
# lub jakikolwiek inny branch
```

## Krok 5: Dodaj wszystkie pliki
```bash
git add .
```

## Krok 6: Sprawdź co zostanie dodane (opcjonalnie)
```bash
git status
```

## Krok 7: Zrób commit
```bash
git commit -m "Initial commit - projekt coworking z rezerwacjami i użytkownikami"
```

## Krok 8: Dodaj remote (jeśli masz już repo na GitHub/GitLab)
```bash
git remote add origin https://github.com/twoj-username/nazwa-repo.git
# lub
git remote add origin [email protected]:twoj-username/nazwa-repo.git
```

## Krok 9: Wypchnij na remote
```bash
git push -u origin moj-branch
# lub nazwa twojego brancha
```

---

## Jeśli chcesz stworzyć nowe repo na GitHub:

1. Wejdź na https://github.com
2. Kliknij "New repository"
3. Nadaj nazwę (np. `coworking-app`)
4. **NIE** zaznaczaj "Initialize with README" (bo już mamy pliki)
5. Kliknij "Create repository"
6. Skopiuj URL repo (HTTPS lub SSH)
7. Wykonaj kroki 8-9 powyżej

---

## Ważne informacje:

- ✅ Baza danych `db.sqlite3` jest włączona do repo - koledzy zobaczą Twoje rezerwacje i użytkowników
- ✅ Plik `.env` jest wykluczony (bezpieczeństwo) - każdy musi stworzyć swój własny z `env_example.txt`
- ✅ Folder `venv/` jest wykluczony - każdy musi stworzyć własne środowisko wirtualne
- ✅ Wszystkie logi i pliki tymczasowe są wykluczone

---

## Po wrzuceniu na repo - dla kolegów:

Koledzy mogą pobrać projekt:
```bash
git clone https://github.com/twoj-username/nazwa-repo.git
cd nazwa-repo
git checkout moj-branch # lub nazwa brancha
```

Następnie postępują zgodnie z instrukcjami w `coworking/README.md`

38 changes: 38 additions & 0 deletions file/django_app/PRZED_WRZUCENIEM_NA_PENDRIVE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# ✅ Projekt gotowy do przeniesienia na pendrive!

## Co zostało przygotowane:

1. ✅ **.gitignore** - zaktualizowany, żeby dołączyć `db.sqlite3` (koledzy zobaczą Twoje rezerwacje i użytkowników)
2. ✅ **Instrukcje** - plik `JAK_WRZUCIC_NA_REPO.md` z krokami jak wrzucić na Git

## Co skopiować na pendrive:

Skopiuj **cały folder `django_app`** na pendrive.

## Co jest włączone do repo:

- ✅ Wszystkie pliki źródłowe (.py, .html, .css, .js)
- ✅ Baza danych `db.sqlite3` (z Twoimi rezerwacjami i użytkownikami)
- ✅ Migracje Django
- ✅ Statyczne pliki (CSS, JS, obrazy)
- ✅ Szablony HTML
- ✅ Dokumentacja (README.md, instrukcje)

## Co jest wykluczone (bezpieczeństwo):

- ❌ Folder `venv/` (każdy tworzy własne środowisko)
- ❌ Plik `.env` (z hasłami i kluczami API)
- ❌ Pliki logów
- ❌ Pliki cache Python (`__pycache__/`)

## Na innym komputerze:

1. Skopiuj folder z pendrive
2. Otwórz `JAK_WRZUCIC_NA_REPO.md` i wykonaj instrukcje
3. Gotowe! 🎉

---

**Uwaga:** Pamiętaj, że plik `.env` z hasłami i kluczami API NIE jest w repo.
Koledzy będą musieli stworzyć własny plik `.env` na podstawie `env_example.txt`.

Loading