- Set up the project directory structure for a FastAPI application.
- Create a Python virtual environment (
venv
orconda
) for isolated development. - Install FastAPI and essential dependencies:
fastapi
uvicorn[standard]
(for running the FastAPI app)sqlalchemy
(for database interactions)pydantic
(for validation and settings)cadquery
(for geometry generation)numpy
pytest
- Initialise a Git repository and push to GitHub using the desktop app.
- Add a
.gitignore
file (e.g., ignore__pycache__
,.DS_Store
, virtual environments, STL files, etc.). - Create a basic FastAPI project structure:
track_app/
for core logic.templates/
andstatic/
for web interface assets (if needed).
- Set up Docker for local deployment:
- Create a
Dockerfile
to containerize the FastAPI application. - Create a
docker-compose.yml
file to manage dependencies and services. - Verify the application runs successfully in Docker.
- Create a
- Define models for track components in
models.py
:- Straight Track: Include length and other parameters.
- Chairs: Include dimensions and types (minimal for MVP).
- Rails: Placeholder for future iterations.
- Use SQLAlchemy to implement the database.
- Create migrations and populate the database with example data using Alembic.
- Implement a function to generate geometry for straight tracks.
- Integrate geometry generation with FastAPI routes.
- Use CadQuery to generate STL files based on user input.
- Validate STL file integrity using lightweight checks (e.g., watertightness).
- Provide basic feedback if STL integrity checks fail during testing.
- Provide a downloadable STL file through the FastAPI app.
- Create a simple web interface or API for:
- Submitting track parameters (e.g., length).
- Viewing and downloading the generated STL file.
- Test for usability and responsiveness.
- Write unit tests for models, routes, and geometry generation functions using
pytest
. - Test STL export functionality with various track lengths.
- Validate edge cases, such as:
- Extremely short or long tracks.
- Invalid user inputs.
- Deploy the FastAPI app on Docker Desktop for local testing.
- Verify the Docker setup:
- Ensure all dependencies are included.
- Validate the app runs correctly within the container.
- Document the steps for building and running the Docker container.
- Write a clear Getting Started guide for contributors.
- Document all database models and their relationships.
- Provide usage examples for API endpoints.
- Create a troubleshooting guide for common issues.
- Include detailed steps for setting up the FastAPI app locally and in Docker.
- Add support for curves and turnouts.
- Introduce more advanced track configurations and layouts.
- Implement REST API endpoints for programmatic access.
- Plan for web hosting and deployment on a cloud platform (e.g., AWS or DigitalOcean).