Installation¶
This guide walks you through setting up the Freeze Design webshop for local development.
Prerequisites¶
| Software | Minimum Version | Purpose |
|---|---|---|
| Python | 3.11+ | Backend runtime |
| Node.js | 20+ | Frontend runtime |
| PostgreSQL | 15+ | Database |
| Redis | 7+ | Cache & Celery broker |
Clone the Repository¶
Backend Setup¶
Create Virtual Environment¶
Install Dependencies¶
Environment Configuration¶
Copy the example environment file and configure it:
Edit .env and set your database credentials:
Database Setup¶
Load Sample Data (Optional)¶
Frontend Setup¶
Install Dependencies¶
Environment Configuration¶
Edit .env.local:
Running the Application¶
Start Backend¶
Backend will be available at: http://localhost:8000
Start Frontend¶
Frontend will be available at: http://localhost:3000
Start Celery Worker (Optional)¶
Development Workflow¶
Open three terminal windows:
Access Points¶
| URL | Description |
|---|---|
http://localhost:3000 |
Main webshop |
http://localhost:8000/admin |
Django admin |
http://localhost:8000/api/docs/ |
API documentation |
Common Tasks¶
Adding a New API Endpoint¶
- Create the serializer in
backend/apps/<app>/serializers.py - Create the viewset in
backend/apps/<app>/views.py - Register in
backend/config/urls.pyrouter - Test at
http://localhost:8000/api/docs/
Adding a New React Component¶
- Create component in
frontend/components/ - Add types to
frontend/types/index.tsif needed - Create Storybook story in same directory
- Run
npm run storybookto preview
Running Tests¶
Useful Commands¶
Backend¶
# Create migrations
python manage.py makemigrations
# Apply migrations
python manage.py migrate
# Create superuser
python manage.py createsuperuser
# Shell access
python manage.py shell
# Validate OpenAPI schema
python manage.py spectacular --validate
Frontend¶
# Development server
npm run dev
# Production build
npm run build
# Linting
npm run lint
# Storybook
npm run storybook
# TypeDoc
npm run docs:typedoc
Verify Installation¶
- Open
http://localhost:3000in your browser - You should see the Freeze Design homepage
- Access Django admin at
http://localhost:8000/admin
Next Steps¶
- Configuration - Customize your environment
- Architecture Overview - Understand the system design
- Testing Guide - Write effective tests
- Deployment Guide - Deploy to staging or production