full-stack-fastapi-template
                                
                                 full-stack-fastapi-template copied to clipboard
                                
                                    full-stack-fastapi-template copied to clipboard
                            
                            
                            
                        feat(config): add support for separate test database via .env.test
Summary
This PR adds support for a dedicated PostgreSQL test database by introducing a .env.test file and adapting the config logic to switch automatically based on the ENVIRONMENT variable.
What’s in this PR
- Adds a .env.testfile withENVIRONMENT=testandPOSTGRES_DB=app_test
- Updates config.pyto dynamically load the correct database
- Documents the workflow under a new Testing Environment section in the README
Why
Right now, both development and test environments point to the same DB (app), which can lead to data conflicts during CI runs or local testing.
This solves Issue #125 by making test isolation simple and configuration-driven—no breaking changes introduced.
Additional Notes
- The same Docker Compose setup is used for dev and test
- .env.testis included by default — let me know if you’d prefer it excluded via- .gitignore
- This keeps compatibility with all current workflows while making CI cleaner and safer