Skip to content

Latest commit

 

History

History
70 lines (62 loc) · 2.53 KB

README.md

File metadata and controls

70 lines (62 loc) · 2.53 KB

TradeCenter

best online store for selling your products!

version

  • pip version = 24.0

Existing username and password

  • System manager -
    • username: admin
    • password: admin
  • Store manger -
    • username: user1
    • password: 1234
    • owns: store1 (with id=0), store2 (with id=0)

Dependencies

Create Virtual Environment For Backend

  • change directory to backend
  • Create environment: python -m venv .backendvenv
  • Activate Environment:
    • linux/mac: source .backendvenv/bin/activate
    • windows: .backendvenv\Scripts\activate
      windows: if the line above causes errors, run: Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass before, and then try running the line above again.
  • pip install -r requirements.txt

Adding A Dependencie

  • Activate the virtual environment as above
  • pip install the new dependencie
  • Update requirements.txt: pip freeze > requirements.txt

For Frontend

Docker

  • install docker and run the docker daemon (by just opening the docker desktop)
  • copy the content of the file .env.example to a new file called .env and update the relevant fields (username and password - can leave it as is if you want)
  • GUIDE: is web/db
  • Build and Run the Docker Containers:
    • All the containers: docker-compose up -d
    • One container: docker-compose up -d <container-id> add --build to rebuild the image (if docker-compose.yml is changed)
  • see the logs:
    • docker-compose logs <container-id>
  • stop the containers:
    • docker-compose down
  • access a running container:
    • docker-compose exec <container-id> sh
  • running tests:
    • to run each test manually, start the database container:
      • docker-compose up -d db then run the tests individually as you wish (test config is in .env)
    • to run all the test together (not recommended):
      • docker-compose -f docker-compose.test.yml build
      • docker-compose -f docker-compose.test.yml up

Running on remote server

  • run everything reguraly
  • run flask:
    • flask run --host=0.0.0.0 --port=5000
  • disable firewall on windows