best online store for selling your products!
- pip version = 24.0
- System manager -
- username: admin
- password: admin
- Store manger -
- username: user1
- password: 1234
- owns: store1 (with id=0), store2 (with id=0)
- 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.
- linux/mac:
- pip install -r requirements.txt
- Activate the virtual environment as above
- pip install the new dependencie
- Update requirements.txt:
pip freeze > requirements.txt
- download nodejs (make sure npm is also downloaded)
- for working with vscode download the dependencies:
npm install
to install all dependencies- to start server:
npm run dev
- 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)
- All the containers:
- 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
- to run each test manually, start the database container:
- run everything reguraly
- run flask:
flask run --host=0.0.0.0 --port=5000
- disable firewall on windows