Skip to content

Commit 661d0b3

Browse files
author
phernandez
committed
update README and TODO
1 parent e8b2356 commit 661d0b3

2 files changed

Lines changed: 51 additions & 18 deletions

File tree

README.md

Lines changed: 50 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,59 @@
22

33
![Build Status](https://github.com/basicmachines-co/basic-foundation/actions/workflows/basic-foundation-test.yml/badge.svg)
44

5-
Opinionated Foundation Boilerplate for a SaaS Platform
6-
7-
- Boring tech
8-
- Reproducible builds
9-
- Development flow
10-
- easy deployment
11-
- preview builds
12-
- 100% test coverage
13-
- Easy to extend
14-
15-
tech
16-
17-
- fastapi
18-
- postgresql
19-
- htmx
20-
- tailwind.css
5+
### Overview
6+
7+
Basic Foundation is designed for developers building web applications and APIs in Python. It takes advantage of Python
8+
3.12’s type hinting and async capabilities for scalability and performance. The project includes transactional database
9+
tests, ensuring that the real database logic is tested and not just mocked. With built-in JWT authentication, API, and
10+
web modules, and a pre-configured CI/CD pipeline, it streamlines setting up the infrastructure needed for a typical SaaS
11+
project. Additionally, full test coverage and support for dynamic preview environments reduce the chances of bugs and
12+
make deployments safer.
13+
14+
## Features of Basic Foundation
15+
16+
- **Python 3.12 with Type Hints**: The project uses Python 3.12 and includes type hints throughout the codebase. Pyright
17+
is configured to perform type checking during development, ensuring that types are correctly enforced. This reduces
18+
runtime errors by catching type mismatches early.
19+
- **100% Asynchronous APIs**: All API operations are asynchronous, implemented with FastAPI and async SQLAlchemy. This
20+
setup allows non-blocking I/O, which improves performance and scalability when handling multiple concurrent requests,
21+
such as during API-heavy workloads.
22+
- **Transactional Tests with Rollbacks**: Instead of relying on mock objects, database tests are run in real
23+
transactions that are rolled back after the test completes. This ensures that each test starts with a clean database
24+
state while still exercising the full application stack, making it possible to catch more bugs and integration issues.
25+
- **Authentication and User Management**: The application includes JWT-based authentication, with functionality for user
26+
registration, login, and subscription management. These are implemented as modular components that can be extended to
27+
fit project-specific requirements.
28+
- **API Module**: The API module exposes endpoints for core business logic, including user management and subscription
29+
handling. Built using FastAPI, it offers an easy way to extend or add new APIs while maintaining clear separation
30+
between the web and API layers.
31+
- **Web Module**: Server-side rendering is handled using Jinja2 templates, while HTMX is used to enhance the user
32+
experience with partial page updates. TailwindCSS is used for styling to minimize the need for custom CSS. This
33+
approach keeps the frontend simple, while still supporting dynamic updates.
34+
- **Email Integration**: The project includes email sending via SMTP, enabling the app to send account-related emails
35+
such as password recovery or account activation. This feature simplifies integrating email functionality without
36+
third-party services.
37+
- **Database Migrations with DBMate**: Database schema changes are handled by DBMate, which provides simple migration
38+
commands for PostgreSQL. It ensures that schema changes can be applied, rolled back, and dumped consistently across
39+
different environments.
40+
- **100% Test Coverage**: Every core library, API endpoint, and web component has full test coverage. Tests are written
41+
using pytest, ensuring that all critical paths are tested. This helps catch regressions and bugs early in the
42+
development process.
43+
- **Playwright for Frontend Testing**: Playwright is used for testing frontend functionality, including interactive
44+
features like forms and modals. These tests ensure that the frontend behaves as expected across different browsers and
45+
devices.
46+
- **Continuous Integration and Deployment (CI/CD)**: GitHub Actions is used for automated testing, versioning, and
47+
building of the project. Each release includes automated version bumps, database migrations, and deployment to
48+
Render.com or other platforms.
49+
- **Preview Environments**: The project supports preview environments using Render.com’s feature, allowing each pull
50+
request or branch to deploy its own isolated environment. This is useful for testing changes before merging them into
51+
the main branch.
52+
- **TailwindCSS for Styling**: Minimal CSS is used in favor of TailwindCSS, which provides utility-based styling. This
53+
keeps the styles consistent and reduces the complexity of managing custom CSS.
2154

2255
## Assumptions
2356

24-
- Requires a python installation (recommend python [3.12](https://docs.python.org/release/3.12.1/whatsnew/3.12.html))
57+
- Requires a python installation (3.12)
2558
- Github access https://docs.github.com/en/get-started/quickstart/set-up-git
2659
- Docker/Docker compose
2760

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- api
88
- web-htmx
99
- [-] uv
10-
- [ ] permission checks
10+
- [x] permission checks
1111
- [x] has to be at least one admin
1212
- [x] only admins can create/edit users
1313
- [ ] dashboard stats should link to filtered list

0 commit comments

Comments
 (0)