Frontend's Repo: https://github.com/blefnk/relivator-docker-frontend
- IDE (VSCode recommended)
- Python (tested with 3.11.8 version)
- Docker and Docker Compose (for containerized development and deployment)
- For Windows only: Powershell 7
The paths below are an example, you can use any you like.
1. Clone the repository:
mkdir C:\B\S\reliverse && cd C:\B\S\reliverse # Windows
mkdir ~/Desktop/B/S/reliverse && cd ~/Desktop/B/S/reliverse # macOS/Linux
git clone https://github.com/blefnk/relivator-docker-backend.git
cd relivator-docker-backend
2. Create and activate a virtual environment:
Windows:
python -m venv C:\B\A\python\venv\main
macOS/Linux:
python -m venv ~/Desktop/B/A/python/venv/main
3. Configure workspace:
Then open project in VSCode > Ctrl+Shift+P > Terminal: Create New Terminal
Windows:
# Ctrl+Shift+P > Python: Select Interpreter > Enter interpreter path
# Find... > And choose python.exe in C:\B\A\python\venv\main\Scripts
C:\B\A\python\venv\main\Scripts\activate.ps1 # Or use .bat when CMD
macOS/Linux:
source ~/Desktop/B/A/python/venv/main/bin/activate
4. Install dependencies:
The project already has many pre-selected good packages, so you can easily get started, or removeΒΉ unused packages whenever you want.
So, to install the packages listed in requirements.txt
just run:
cd backend && pip install -r requirements.txt
ΒΉπ‘ How to remove unused packages?
Here are the most common and effective ways to remove unused packages from the requirements.txt
file:
- Best for small projects: If you already have a relatively short
requirements.txt
file, you can often manually go through it and identify packages that are no longer actively used in your code. - Time-consuming for larger projects: This becomes less practical as your project and the list of dependencies grow.
These tools analyze your project's code to help determine unused dependencies. Here are some popular options:
- pip-autoremove:
- Install:
pip install pip-autoremove
- Usage:
pip-autoremove requirements.txt -o requirements.txt
(This overwrites your original file)
- Install:
- pipdeptree (with reverse flag):
- Install:
pip install pipdeptree
- Usage:
pipdeptree -r > possible_unused.txt # Creates a list of possible unused packages # Manually review possible_unused.txt and edit requirements.txt
- Install:
- Other Tools:
pip-unused
: A simple command-line tool.- There may be similar plugins for your IDE or code editor.
- Caution: Automated tools can be helpful but they might not be 100% accurate. It's always best to double-check and test your project after removing packages from
requirements.txt
. - Version Conflicts: Sometimes packages might remain indirectly necessary due to dependencies of other required packages. Be mindful of complex dependencies when removing packages.
- Install pip-autoremove:
pip install pip-autoremove
- Create a backup (optional, but recommended):
cp requirements.txt requirements.txt.bak
- Remove unused packages:
pip-autoremove requirements.txt -o requirements.txt
- Review Changes: Check the updated
requirements.txt
to make sure the automated tool didn't remove anything essential. - Test Thoroughly: Run your project's tests or experiment with it manually to ensure everything still works as expected.
Start the development server:
uvicorn main:app --reload
# http://localhost:10000
# http://localhost:10000/items/5?q=example
A tip!
Remember to work on the activate virtual environment after each new terminal with:
C:\B\A\python\venv\main\Scripts\activate.ps1 # .bat cmd, Windows
source ~/Desktop/B/A/python/venv/main/bin/activate # macOS/Linux
So you will see something like that:
- Windows
(main) PS C:\B\S\reliverse\relivator-docker-backend\backend >
- macOS/Linux
(main) user@machine:~/Desktop/B/S/reliverse/relivator-docker-backend/backend$
Instructions for building and running the project using Docker are forthcoming.
Getting Things Ready:
- Install Docker Desktop and flyctl.
- Create an account with
fly auth signup
or login withfly auth login
. - Run
fly launch
from inside your project source directory to create, configure, and (for most apps) deploy a new application. - If prompted, run
fly deploy
to deploy your new app (or to redeploy after changes!).
Thanks for considering contributions to Reliverse, means to Relivator Universe, means to the one of main universe of Bleverse (Blefonix Multiverse)! π
- Follow the installation steps above, including deployment steps.
- Update
requirements.txt
if needed:pip freeze > requirements.txt
. - Make your changes. Ensure you have successful build with
flyctl deploy
. - Commit the changes to your repo fork. Submit a PR to relivator-docker-backend.
- [optional] Visit and sign up on bleverse.com to collect your reward as a thank you. (You can win even Blefcoins or even Blefonix Stone!)