Skip to content

Latest commit

 

History

127 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Furniture Store

Python Version Django Version PostgreSQL Docker License

image image

Multi-page furniture store built with Django.

The project uses PostgreSQL, Docker, Nginx, and Gunicorn.


Features

  • Product catalog
  • Product categories
  • Shopping cart
  • Order management
  • User accounts
  • Product images
  • Static and media file handling
  • Demo data with fixtures
  • Docker Compose setup
  • Nginx reverse proxy

Tech Stack

  • Python 3.11+
  • Django 5.x
  • PostgreSQL 16
  • Gunicorn
  • Nginx
  • Docker / Docker Compose

Project Structure

FurnitureStore
├── backend/
│   ├── app/
│   ├── carts/
│   ├── fixtures/
│   │   └── goods/
│   ├── goods/
│   ├── main/
│   ├── media/
│   │   └── goods_images/
│   ├── orders/
│   ├── static/
│   │   └── deps/
│   ├── templates/
│   ├── users/
│   ├── .env
│   ├── Dockerfile
│   ├── entrypoint.sh
│   ├── manage.py
│   └── requirements.txt
├── conf.d/
├── sets/
├── compose.yml
├── .gitignore
├── LICENSE
└── README.md

Installation with Docker

Install Docker: https://docs.docker.com/engine/install/

Clone the repository:

git clone https://github.com/Phonkmasti/FurnitureStore.git
cd FurnitureStore

Edit environment variables:

nano .env

Update Nginx server name:

nano conf.d/nginx.conf

Build and start containers:

docker compose up -d --build

Apply migrations:

docker exec web python manage.py migrate

Load categories data:

docker exec web python manage.py loaddata backend/fixtures/books/subjects.json

Create admin user ( optional ):

docker exec web python manage.py createsuperuser

Database Setup

Create and apply migrations:

docker exec web python manage.py makemigrations
docker exec web python manage.py migrate

Create admin user:

docker exec web python manage.py createsuperuser

Load demo data:

docker exec web python manage.py loaddata fixtures/goods/goods_Category.json
docker exec web python manage.py loaddata fixtures/goods/goods_Products.json
docker exec web python manage.py loaddata fixtures/goods/goods_ProductImage.json

Manual Installation

Use this setup for local development.

Clone the repository:

git clone https://github.com/Phonkmasti/FurnitureStore.git
cd FurnitureStore/backend

Create virtual environment:

python -m venv .venv

Activate virtual environment:

Linux:

source .venv/bin/activate

Windows:

venv\Scripts\activate

Install dependencies:

pip install -r requirements.txt

Install PostgreSQL, create a user and a database, https://www.postgresql.org/download/, and then replace the values ​​in the backend/.env file with your own.

SECRET_KEY=your_secret_key
DEBUG=True # True only for dev, else False
ALLOWED_HOSTS=127.0.0.1,localhost
CSRF_TRUSTED_ORIGINS=http://127.0.0.1,http://localhost
DB_NAME=your_db_name
DB_USER=your_db_user
DB_PASS=your_db_password
DB_HOST=localhost
DB_PORT=5432

Apply migrations:

python manage.py migrate

Load demo data:

python manage.py loaddata fixtures/goods/goods_Category.json
python manage.py loaddata fixtures/goods/goods_Products.json
python manage.py loaddata fixtures/goods/goods_ProductImage.json

Create admin user:

python manage.py createsuperuser

Run development server:

python manage.py runserver

Useful Commands

Start containers:

docker compose -f compose.yml up -d

Stop containers:

docker compose -f compose.yml down

Rebuild containers:

docker compose -f compose.yml up -d --build

View logs:

docker compose -f compose.yml logs -f

Notes

Before deployment, update:

  • SECRET_KEY
  • ALLOWED_HOSTS
  • CSRF_TRUSTED_ORIGINS
  • PostgreSQL password
  • Nginx server_name

Do not commit real secrets, .env files, or private keys to the repository.


License

MIT

Releases

Packages

Contributors

Languages