The following powerful modules and features are all completely or mostly mature in the prototype stack and ready for release. Most or all will be added to Bedrock revisions here in June 2025. Everything is under the same MIT License. This is all totally free and Open Source.
You are now in the 'project root'. Most commands and actions, if not otherwise specified, should be done from this directory. The project root is the directory with docker-compose.yml in it.
git clone git@github.com:jimmygizmo/bedrock.git
cd bedrock
(Needed for Windows WSL for sure and possibly others.) This command will give full permissions to the /dbvolume/ directory where the large DB file structure will be written by the PostgreSQL DB. You might have reasons later to do something similar again and you might in some cases need to use sudo. This is needed because the docker process behind Postgres is running at an elevated level. WSL handles this worse than macOS or Linux. Note that it is useful to completely wipe out all persisted DB data to cause the DB to be re-created fresh, sometimes frequently, and this is when you will most likely need those permissions. (I'll cover DB wiping during dev later.)
sudo chomd -R 777 dbvolume
On the first startup, Magma (the FastAPI Microservices Python app) will create all the database objects including the logical database itself, if necessary. The stack should work immediately. If not, simply restart it.
docker-compose up
*NEW* Scroll down and read about the new Bedrock Developer Menu (menu.py), which automates such actions!
Optional: Jupyter Notebook Server, pgAdmin DB GUI - For quick and efficient core stack builds out of the box, the pre-configured Jupyter and pgAdmin components are disabled in the docker-compose.yml file by default. To use either or both with Bedrock, simply uncomment the corresponding Docker Compose service block. For more information, see: Optional Bedrock Components
You access port 48000 on localhost, since we map the default FastAPI port 8000 to 48000 outside the container. Bedrock always uses ports in the 40-thousand ranges when mapping outside the Compose stack: 5432 -> 45432. 443 -> 44443, 8000 -> 48000, 80 -> 44080, etc.
Note: When internal service ports are mapped to 'Bedrock' ports outside the container, the mneumonic used is to first choose a similar 44*** port number and then a 40*** number before other 4**** numbers to find the best mapping. Bedrock has many potential modules so this scheme will be used to make sense of potentially many port numbers in a complex stack.
For OpenAPI interactive docs and API tools, navigate to:
https://127.0.0.1:48000/docs
For Redocly interactive docs, navigate to:
https://127.0.0.1:48000/redoc
For a full list of endpoints and more information about the Magma FastAPI application at the core of the Bedrock stack, please read Bedrock Magma API. Bedrock is a Python FastAPI platform and Magma is the rich, modern, best-practice code base to use as your API starting point.
Magma features over 40 CRUD endpoints for the rich ERP database schema and mock data set "Chinook" which is the basis for an online music store like iTunes. Chinook has a relational schema of medium complexity with circular relations and other advanced characteristics to give you a real-world foundation to learn from and build your own enterprise solution upon. Basic endpoints are provided for all 11 tables. A few examples:
List all music tracks using paging parameters:
http://localhost:48000/tracks/?skip=0&limit=100
List all artists:
http://localhost:48000/artists
Get the playlist with playlist_id 3:
http://localhost:48000/playlists/3
* See the "Bedrock Magma API" link above (the extras/API.md file) or the built-in OpenAPI docs/tools for details.
hit ctrl-C (in the same console)
*NEW* Scroll down and read about the new Bedrock Developer Menu (menu.py), which automates such actions!
Visit SmartMetal.ai for more information.
This section will soon get a lot of detailed and valuable information for Bedrock developers.
I use Pyenv for my virtual environments and this project containers a .python-version file specifying a virtual environment from Pyenv with the name 've.bedrock' so I recommend you use all that and will provide good instructions soon.
When you create ve.bedrock with Pyenv you want to use Python version 3.10.9 to match the Python image Bedrock uses in the running container. (see bedrock/Dockerfile). You will want to use the requirements-pinned.txt file so that all of your module versions in your local development environemt matches those in your deployed app.
> pyenv install 3.10.9
> pyenv virtualenv 3.10.9 ve.bedrock
For the best Python installs/upgrades, always upgrade pip and setuptools in a fresh virtual environment.
> pip install --upgrade pip
> pip install --upgrade setuptools
Install the large number of dependencies.
> pip install -r requirements-pinned.txt
Install the application module Magma itself.
First cd into the bedrock container directory so you are in the same directory as setup.py
You should then be inside /bedrock/bedrock/ (one-level deeper than the repo root of /bedrock/
> cd bedrock
> pip install .
This is important for running your Python code locally, outside of Docker, but it is equally important so your powerful IDE with real-time analysis (such as PyCharm or VS Code) will operate properly and to its fullest potential.
I'm a hardcore developer and this project is for developers so you can expect this to be a rich and valuable section of the docs for this project. I have a lot of strategic and tactical knowlege to pass on through this and other projects of mine, especially with regards to architecture and development. It's all about the code so stay tuned for lots of updates to this repo coming soon, valuable to my fellow developers most of all.
The Bedrock Developer Menu is a really slick little tool which displays the colorful combined docker log for all containers while giving you a menu of single keypress command macros for your most common and repetitive development actions. These are the handful of command sequences a full stack developer types into a terminal constantly, sometimes over a hundred times in a day. Having these under a single keypress is a wonderful benefit. A tiny but incredibly valuable addition to Bedrock: menu.py
- 1 - Start the Bedrock full stack & Magma microservices
- 2 - Stop the entire stack
- 3 - Delete the entire logical DB and all data
- 4 - Rebuild the Bedrock FastAPI container with current Magma code
- 5 - Run unit tests
- 6 - Reinstall the FastAPI microservices module 'magma' locally
- 7 - Git status
- 8 - Exit menu only (stack up/down state will not change)
NOTE: Diagram shows PascalCase naming, which is supported in Magma through aliasing, making imports of the substantial Chinook mock data simpler. However other than the aliases, all DB objects are referenced pythonically and per DB/ORM best practices and use lowercase_underscore naming and plural table names, with singlular model-related object names. A more accurate diagram is pending.
A lot more documentation is on the way. The project is currently well structured, clean and largely self-documenting, so don't delay in starting to build your amazing projects on Bedrock!
This project has been authored, engineered and developed by James Mannix with both original and open source components.
More information at: SmartMetal.ai
This project is licensed under the MIT License.
- β Free to use, modify, and distribute
- β Commercial use allowed
- β Attribution required (include the license and copyright)
- β No warranty (use at your own risk)
- β No re-packaging/re-distribution as a full-stack template
- β Distribute and profit from your custom solutions with no restrictions
