FastAPI-React-PGDB
Deploy and Host FastAPI-React-PGDB with Railway
FRAD-template
lNamelessl/FRAD-template
Just deployed
π FARM Stack Template
A modern, scalable template to kickstart your full-stack web projects. This template combines FastAPI (Python), React (JavaScript), and PostgresDB, all containerized with Docker and orchestrated via Docker Compose. Itβs designed for rapid development and easy deployment, with a clear structure for both backend and frontend.
Inspired by best practices and scalable architecture patterns, this template helps you build robust, production-ready web applications with:
- FastAPI for high-performance Python APIs
- React for a modern, component-based frontend
- PostgresDB for reliable data storage
- Nginx for efficient static file serving and reverse proxy
- Docker & Docker Compose for seamless local development and deployment
Whether you're building a prototype or a large-scale application, this template provides a solid foundation for your FARM stack projects.
π Table of Contents
β¨ Features
backend/: FastAPI backend
- alembic/: Alembic migrations.
- app/: Main FastAPI code.
- sample_module/: Modular structure example
- schemas/: Pydantic schemas
- routes/: API routes
- apis.py, crud.py, exceptions.py, formatters.py, models.py, selectors.py, services.py: Core logic
- common/: Shared utilities (auth, CRUD, exceptions, pagination, schemas, security, types, utils)
- core/: Database, handlers, settings, tags
- external/: External integrations
- sample_module/: Modular structure example
frontend/: React app
- public/: Static assets
- src/: Components, logic, tests
nginx/: Production Nginx config
Other:
- .vscode/: VS Code config
- tests/: Backend tests
- env_sample.txt: Env example
- .flake8, .gitignore, .pylintrc: Lint/config
- alembic.ini, docker-compose.yml, Dockerfile, LICENSE, pytest.ini, railway.toml, requirements.txt, start.sh: Project config
π‘ Getting Started
Backend (FastAPI)
- Create a virtual environment (if not using Docker):
py -m venv .venv .venv\Scripts\activate # Windows source .venv/bin/activate # macOS/Linux
- Install dependencies:
Or use Docker Compose:pip install -r requirements.txt
docker compose up
- Copy
.env_sample
to.env
and update variables. - Run migrations:
alembic upgrade head
- Start FastAPI:
fastapi dev # Dev fastapi run # Prod
Frontend (React)
- In
frontend/
:
Visitnpm install npm start
http://localhost:3000
. - Build for production:
npm run build
Nginx
- Use
nginx/nginx.conf
to serve the frontend and proxy API requests. - Example Docker run:
docker run --name my-nginx -v /path/to/nginx.conf:/etc/nginx/nginx.conf:ro -v /path/to/frontend/build:/usr/share/nginx/html:ro -p 80:80 -d nginx
π Deploy
Deploy on Railway:
π€ Contribute to the Project
We welcome contributions from the community to make this FARD Starter Template even better. If you have ideas for improvements, new features, or bug fixes, feel free to:
- Fork the repository and create a new branch.
- Submit a Pull Request with your changes.
- Engage in discussions on ideas, enhancements, or fixes.
By contributing, you help make this template more valuable for developers building FastAPI applications. Together, we can create a robust foundation for large-scale projects. Thank you for your support!
For additional information, refer to the following resources:
- FastAPI documentation: https://fastapi.tiangolo.com/
- Alembic documentation: https://alembic.sqlalchemy.org/en/latest/
π¬ Contact
Feel free to reach out if you have questions or suggestions.
- Name: Abdulrahim Kasim
- Email: [email protected]
- GitHub: github.com/lNameless
Deploy and Host FastAPI-PGDB-Template on Railway
FastAPI-PGDB-Template is a modern, production-ready starter kit for building backend web applications. It combines FastAPI for the backend and MongoDB for data storage, all orchestrated with Docker and Docker Compose. This template is designed for rapid backend development, scalability, and easy deployment to cloud platforms like Railway.
About Hosting FastAPI-PGDB-Template
Hosting FastAPI-MongoDB-Template involves deploying a containerized backend application that integrates a high-performance FastAPI API and a robust PGDB database. With Docker Compose, all services are managed together, simplifying both local development and cloud deployment. Railway provides a seamless platform to deploy, scale, and manage your application and its dependencies, reducing operational overhead and accelerating your go-to-production timeline.
Why Deploy FastAPI-PGDB-Template on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying FastAPI-PGDB-Template on Railway, you are one step closer to supporting a complete backend application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Common Use Cases
- Rapid prototyping of SaaS products
- Building scalable APIs
- Educational projects and hackathons
Dependencies for FastAPI-PGDB-Template Hosting
- Docker & Docker Compose
- Railway account
Deployment Dependencies
Happy coding! π
Template Content
FRAD-template
lNamelessl/FRAD-template