Add Django backend, Next.js frontend, and deploy templates
This commit is contained in:
1 parent
fc0c991335
commit
e9cd22d36f
93 files changed
+7840
-1
No files matched your search
@@ -1 +1,48 @@
|
||||
# kkpab-site
|
||||
# KKPAB Site
|
||||
|
||||
Modernized rebuild of `kkpab26.ru` using:
|
||||
|
||||
- Django + Django REST Framework for content management API
|
||||
- Next.js for the public website
|
||||
- PostgreSQL for production data
|
||||
- Nginx for reverse proxy and static/media delivery
|
||||
|
||||
## Structure
|
||||
|
||||
- `backend/` Django API and admin
|
||||
- `frontend/` Next.js public website
|
||||
- `deploy/` deployment templates
|
||||
|
||||
## Local setup
|
||||
|
||||
### Backend
|
||||
|
||||
```bash
|
||||
cd backend
|
||||
python -m venv .venv
|
||||
source .venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
cp .env.example .env
|
||||
python manage.py migrate
|
||||
python manage.py loaddata content/fixtures/initial_data.json
|
||||
python manage.py createsuperuser
|
||||
python manage.py runserver 0.0.0.0:7788
|
||||
```
|
||||
|
||||
### Frontend
|
||||
|
||||
```bash
|
||||
cd frontend
|
||||
npm install
|
||||
cp .env.local.example .env.local
|
||||
npm run dev
|
||||
```
|
||||
|
||||
Frontend expects API at `http://localhost:7788/api`.
|
||||
|
||||
## Production notes
|
||||
|
||||
- build frontend with `npm run build`
|
||||
- run Django with `gunicorn`
|
||||
- route `/api`, `/admin`, `/media`, `/static` to Django
|
||||
- route `/` to Next.js
|
||||
Reference in new issue
Block a user