This is the backend API for Project Codename: PathCraft, a goal-setting and productivity application that blends goal-setting science with artificial-intelligence scheduling. This API is responsible for goal management, decomposition, scheduling, and user data persistence.
This service is built with Python using the FastAPI web framework and SQLAlchemy for the ORM.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Python 3.12+
pipandvenv
-
Clone the repository (if you haven't already):
git clone <repository-url> cd pathcraft-api
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use: venv\Scripts\activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Install the development dependencies (for testing):
pip install -r requirements-dev.txt
To run the API server locally, use uvicorn:
uvicorn src.main:app --reloadThe --reload flag makes the server restart after code changes. The API will be available at http://127.0.0.1:8000.
To run the test suite, use pytest from the pathcraft-api root directory:
pytestOnce the application is running, you can access the interactive API documentation (provided by Swagger UI) at:
An alternative documentation view (provided by ReDoc) is available at:
pathcraft-api/
├── src/
│ ├── __init__.py
│ ├── main.py # FastAPI application entry point
│ └── models.py # SQLAlchemy database models
├── tests/
│ ├── __init__.py
│ └── test_main.py # Tests for the main application
├── requirements.txt # Production dependencies
├── requirements-dev.txt # Development/test dependencies
└── README.md # This file