git clone https://github.com/thachyyy/Retail-Store-Chain-Management-System.git
cd Retail-Store-Chain-Management-System
python -m venv venv
# python 3.10.10
source ./venv/Scripts/activate
pip install poetry
DEBUG=true
SQLALCHEMY_DEBUG=True
VERSION=0.1-SNAPSHOT
API_PREFIX=/api
PROJECT_NAME=Retail Chain Management System
POSTGRES_SERVER=localhost
POSTGRES_USER=postgres
POSTGRES_PASSWORD=1234
POSTGRES_DB=postgres
POSTGRES_SCHEMA=public
POSTGRES_PORT=5432
PROJECT_BUILD_TYPE=DEV
PUSHER_APP_ID=
PUSHER_KEY=
PUSHER_SECRET=
PUSHER_CLUSTER=
PUSHER_SSL=True
ACCESS_TOKEN_EXPIRES_IN_MINUTES=30
REFRESH_TOKEN_EXPIRES_IN_DAYS=30
JWT_ALGORITHM=HS256
JWT_SECRET_KEY=
S3_BUCKET_NAME=
S3_IMAGE_PREFIX=
S3_ENDPOINT_URL=
AWS_ACCESS_KEY=
AWS_SECRET_ACCESS_KEY=
AWS_REGION_NAME=
EMAIL_HOST=smtp.mailtrap.io
EMAIL_PORT=587
EMAIL_ADDRESS=nvdluan@gmail.com
EMAIL_PASSWORD=nlhzaiwefcqyoibm
# Channels
GENERAL_CHANNEL=general-channel
ALL_CHANNEL=all-channel
CROWD_BOT_API_KEY=
TIME_CANCEL_TASK=24
Tải PgAdmin4 tại link: Downloadhttps://www.pgadmin.org/download/
Tạo server
Viết tên server (tùy ý)
Chuyển tab sang connection nhập các trường thông tin bao gồm:
Nhấn save để lưu lại, các bảng bạn cần tạo hoặc đã tạo nó sẽ ở đường dẫn sau (server\postgres\database\posgres\Schemas\table)
Thêm config cho postgresql. Nhấn chuột phải vào tên Database chọn Query Tool
Chạy lệnh:
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
Mở command line chạy trong VS code chạy lệnh để migration database:
alembic upgrade head
Quay lại giao diện Query Tool chạy lệnh:
insert into system_settings (id, is_maintain) values (uuid_generate_v4(), false);
Chạy server backend
uvicorn app.main:app --reload
Mở trình duyệt web và truy cập vào
http://localhost:8000/docs