Welcome to your Python capstone project! You'll be working with a FastAPI + PostgreSQL application that helps people track their daily learning journey. This will prepare you for deploying to the cloud in the next phase.
By the end of this capstone, your API should be working locally and ready for cloud deployment.
- Getting Started
- Development Tasks
- Data Schema
- AI Analysis Reference
- Explore Your Database
- Troubleshooting
- Contributing
- License
- Git installed on your machine
- Docker Desktop installed and running
- VS Code with the Dev Containers extension
-
Fork this repository to your GitHub account by clicking the "Fork" button
-
Clone your fork to your local machine:
git clone https://github.com/YOUR_USERNAME/journal-starter.git
-
Move into the project directory:
cd journal-starter -
Open in VS Code:
code .
Environment variables live in a .env file (which is git-ignored so you don't accidentally commit secrets). This repo ships with a template named .env-sample.
-
Copy the sample file to create your real
.env:cp .env-sample .env
- Install the Dev Containers extension in VS Code (if not already installed)
- Reopen in container: When VS Code detects the
.devcontainerfolder, click "Reopen in Container"- Or use Command Palette (
Cmd/Ctrl + Shift + P):Dev Containers: Reopen in Container
- Or use Command Palette (
- Wait for setup: The API container will automatically install Python, dependencies, and configure your environment. The PostgreSQL Database container will also automatically be created.
In a terminal outside of VS Code, run:
docker psYou should see the postgres service running.
Back in the VS Code terminal, verify you're in the project root:
pwdYou should see a path ending with journal-starter.
Then start the API with:
./start.sh- Visit the API docs: http://localhost:8000/docs
- Create your first entry In the Docs UI Use the POST
/entriesendpoint to create a new journal entry. - View your entries using the GET
/entriesendpoint to see what you've created!
π― Once you can create and see entries, you're ready to start the development tasks!
You'll use feature branches and Pull Requests (PRs) for each task. Complete these tasks in your forked repository using feature branches.
- Branch:
feature/logging-setup - Configure logging in
api/main.py
- Branch:
feature/get-single-entry - Implement GET /entries/{entry_id} in
api/routers/journal_router.py
- Branch:
feature/delete-entry - Implement DELETE /entries/{entry_id} in
api/routers/journal_router.py
- Branch:
feature/ai-analysis - Implement
analyze_journal_entry()inapi/services/llm_service.py - Implement POST /entries/{entry_id}/analyze in
api/routers/journal_router.py
- Branch:
feature/data-model-improvements - Add validators to
api/models/entry.py
- Branch:
feature/cloud-cli-setup - Uncomment one CLI tool in
.devcontainer/devcontainer.json
Each journal entry follows this structure:
| Field | Type | Description | Validation |
|---|---|---|---|
| id | string | Unique identifier (UUID) | Auto-generated |
| work | string | What did you work on today? | Required, max 256 characters |
| struggle | string | What's one thing you struggled with today? | Required, max 256 characters |
| intention | string | What will you study/work on tomorrow? | Required, max 256 characters |
| created_at | datetime | When entry was created | Auto-generated UTC |
| updated_at | datetime | When entry was last updated | Auto-updated UTC |
This endpoint analyzes a journal entry using your chosen LLM and returns:
- Sentiment: positive, negative, or neutral
- Summary: 2-sentence summary of the entry
- Topics: 2-4 key topics mentioned
Example Request:
POST /entries/123e4567-e89b-12d3-a456-426614174000/analyzeExample Response:
{
"entry_id": "123e4567-e89b-12d3-a456-426614174000",
"sentiment": "positive",
"summary": "The learner made progress with FastAPI and database integration. They're excited to continue learning about cloud deployment.",
"topics": ["FastAPI", "PostgreSQL", "API development", "cloud deployment"],
"created_at": "2025-12-25T10:30:00Z"
}-
Read the documentation for your chosen provider:
-
Add required environment variables to your
.envfile -
Add your SDK to
api/requirements.txtand runpip install -r api/requirements.txt
Want to see your data directly in the database? You can connect to PostgreSQL using VS Code's PostgreSQL extension:
- Install the PostgreSQL extension in VS Code (search for "PostgreSQL" by Chris Kolkman)
- Restart VS Code after installation
- Open the PostgreSQL extension (click the PostgreSQL icon in the sidebar)
- Click "Add Connection" or the "+" button
- Enter these connection details:
- Host name:
postgres - User name:
postgres - Password:
postgres - Port:
5432 - Connection Type:
Standard/No SSL - Database:
career_journal - Display name:
Journal Starter DB(or any name you prefer)
- Host name:
-
Expand your connection in the PostgreSQL panel
-
Left-click on "Journal Starter DB" to expand
-
Right-click on "career_journal"
-
Select "New Query"
-
Type this query to see all your entries:
SELECT * FROM entries;
-
Run the query to see all your journal data! (Ctrl/Cmd + Enter OR use the PostgreSQL command pallete: Run Query)
You can now explore the database structure, see exactly how your data is stored, and run custom queries to understand PostgreSQL better.
If the API won't start:
- Make sure the PostgreSQL container is running:
docker ps - Check the container logs:
docker logs your-postgres-container-name - Restart the database:
docker restart your-postgres-container-name
If you can't connect to the database:
- Verify the
.envfile exists and has the correct DATABASE_URL - Make sure Docker Desktop is running
- Try restarting the dev container:
Dev Containers: Rebuild Container
If the dev container won't open:
- Ensure Docker Desktop is running
- Install the "Dev Containers" extension in VS Code
- Try:
Dev Containers: Rebuild and Reopen in Container
We welcome contributions to improve this capstone project! Open an issue and we can plan from there.
Found a bug or have a suggestion? Please open an issue with:
- Clear description of the problem or suggestion
- Steps to reproduce (for bugs)
- Expected vs actual behavior
- Environment details (OS, Docker version, etc.)
This project is licensed under the MIT License - see the LICENSE file for details.
If you use this project as a foundation for your own work, we'd appreciate a link back to this repository, but it's not required.