Skip to content

Repository files navigation

basic-foundation

Build Status

Opinionated Foundation Boilerplate for a SaaS Platform

  • Boring tech
  • Reproducible builds
  • Development flow
    • easy deployment
    • preview builds
  • 100% test coverage
  • Easy to extend

tech

  • fastapi
  • postgresql
  • htmx
  • tailwind.css

Assumptions

Getting started

brew update

Install python tools

Install pyenv https://github.com/pyenv/pyenv

brew install pyenv

using pyenv

pyenv version

https://pipx.pypa.io/stable/

brew install pipx
pipx ensurepath
sudo pipx --global ensurepath  # optional to allow pipx actions with --global argument
brew update
brew install pyenv
eval "$(pyenv init -)"

Install python

pyenv install 3.12

set the local dir to use the python version

pyenv local 3.12

Install Poetry

curl -sSL https://install.python-poetry.org | python -

Set the virtual env to be local to the project

poetry config virtualenvs.in-project true

Configure project

cd basic-foundation

Install dependencies for python and npm (tailwind)

make install 

Setup the environment

cp .env.ci .env

Run docker-compose (postgres)

docker compose up

Setup database

make migrate

start service

make run 

Run api tests

make test-api

Run playwright tests (assume fastapi instance is running on localhost:8000)

make test-playwright

Enter the poetry shell

poetry shell

deploy to render.com

  • Signup/Login to render.com dashboard
  • Select "New Blueprint"
  • Choose the basic-foundation repo from the list and click the "Connect" button
  • View the service on the dashboard

references

About

Basic Foundation is a Python starter kit for building full-stack SaaS applications with FastAPI, PostgreSQL, and HTMX.

Topics

Resources

Stars

17 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages