Skip to content
プロジェクト

kkosiba/ecommerce-backend

GitHubで見る

概要

Django backend for eCommerce project

Web・アプリ開発

この数値の測り方

できること

  • Products API endpoint available at /api/products/.
  • Custom user authentication using JSON Web Tokens. The API is available at /api/accounts/.
  • Simple newsletter functionality: superuser can view the list of all subscribers in Django admin panel; any visitor can subscribe. The relevant API endpoint is available at /api/newsletter/.
  • Stripe payments API endpoint available at /api/payments/.

計測したスター増加

24時間
0
7日間
0
15日間
+2
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

ecommerce-backend

Django backend for eCommerce project

This project is built using Django REST Framework to provide the backend API for the eCommerce project. The frontend is available here.

Features

  1. Products API endpoint available at /api/products/.
  2. Custom user authentication using JSON Web Tokens. The API is available at /api/accounts/.
  3. Simple newsletter functionality: superuser can view the list of all subscribers in Django admin panel; any visitor can subscribe. The relevant API endpoint is available at /api/newsletter/.
  4. Stripe payments API endpoint available at /api/payments/.

Dependencies

  1. python >=3.13,<3.14
  2. Django >=5.1,<5.2
  3. PostgreSQL 16+

This project also uses other packages (see requirements/base.txt file for details). For instance, tag support is provided by django-taggit and image processing is thanks to Pillow.

Getting started

The easiest way to get backend up and running is via Docker. See docs to get started. Once set up run the following command:

make run

This command takes care of populating products list with the sample data.

It may take a while for the process to complete, as Docker needs to pull required dependencies. Once it is done, the application should be available at http://localhost:8000.

In order to use Stripe payments one needs to create an account and obtain a pair of keys (available in the dashboard after signing in). These keys need to be set in a .env file, see the Deployment section below for the example contents of such file.

Tests

To run Django tests run the following command:

make test

Deployment

There is a production-ready Docker image production.dockerfile available.

It can be deployed in a Kubernetes cluster for example.

To build it manually:

docker build --file production.dockerfile .

To run this image, you need to set the environment correctly. You can use a .env file like this:

PROJECT_ENVIRONMENT=production

# Django settings

DJANGO_SECRET_KEY="f41z(gp#mm7ktjo1bfux-n*0!mlti$9d1@k_sws@&kl*@tfi21"
DJANGO_SETTINGS_MODULE=src.settings.defaults

# Database settings

POSTGRES_DB=
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_HOST=
POSTGRES_PORT=5432

# Stripe

STRIPE_SECRET_KEY=
STRIPE_PUBLISHABLE_KEY=

# AWS

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_STORAGE_BUCKET_NAME=

You can then run the image like this:

docker run --env-file .env -d <image-name>

関連プロジェクトを探す

読み込み中…