Skip to content

Latest commit

 

History

History
145 lines (124 loc) · 4.1 KB

README.md

File metadata and controls

145 lines (124 loc) · 4.1 KB

DEMO

This monorepo contains DEMO projects

[TOC]


Projects

account_password_management

My Skills

Requirements

  • python 3.11+
  • poetry

Building from source and running with docker-compose

  1. Clone the repo

    git clone git@github.com:Xiao75896453/DEMO.git
  2. Create .env .env.prod .env.docker file in projects/account_password_management and set value.

    .env example

    STAGE="stg"
    SERVICE_PORT=3000
    
    DB_HOST="localhost"
    DB_PORT="5432"
    DB_USER="postgres"
    DB_PASSWORD="password"
    DB_DATABASE="account_password_management"
    DB_POOL_SIZE=10
    DB_MAX_OVERFLOW=5
    DB_POOL_RECYCLE=300

    .env.prod

    # override .env if you need

    .env.docker

    PROJECT_PATH="projects/account_password_management"
    PROJECT_IMAGE_NAME="account-password-management"
    DOCKER_HOST_DB_PORT=5432
  3. Startup the services

    docker compose -f docker-compose.postgresql.yml -f projects/account_password_management/docker-compose.yml --env-file projects/account_password_management/.env --env-file projects/account_password_management/.env.docker -f docker-compose.prod.yml --env-file projects/account_password_management/.env.prod up

API Document

  1. Startup the services
  2. Open a browser to http://localhost:3000/docs#

Installation

  1. Clone the repo

    git clone
  2. Install Python packages

    poetry install
  3. Install PostgreSQL

  4. Set PostgreSQL account

  5. Create DB

  6. Create .env .env.prod .env.docker file in projects/account_password_management and set value.

    .env example

    STAGE="stg"
    SERVICE_PORT=3000
    
    DB_HOST="localhost"
    DB_PORT="5432"
    DB_USER="postgres"
    DB_PASSWORD="password"
    DB_DATABASE="account_password_management"
    DB_POOL_SIZE=10
    DB_MAX_OVERFLOW=5
    DB_POOL_RECYCLE=300

    .env.prod

    # override .env if you need

    .env.docker

    PROJECT_PATH="projects/account_password_management"
    PROJECT_IMAGE_NAME="account-password-management"
    DOCKER_HOST_DB_PORT=5432
  7. Create DB schema

    1. migration
      alembic -c 'projects/account_password_management/alembic.ini' upgrade head

Usage

  • Startup the services

    python projects/account_password_management/app.py
  • Test

    pytest projects/account_password_management

Contributing

  1. Fork the Project
  2. Create New Issue (Optional)
  3. Create your Feature Branch git checkout -b {project}/{type}/{description}
  4. Commit your Changes git commit (use .gitmessage.txt as format template for commit)
  5. Push to the Branch git push origin {your feature branch}
  6. Open a Pull Request
  7. Wait for review and merge

Contact

TingYi Xiao - a75896453@gmail.com


Acknowledgments