Description
We need to initialize the cco-service web application. As decided in ADR-001, this will be a FastAPI application that serves as the "Service Wrapper" around the core library. This issue involves setting up the API framework and connecting it to the Redis session store.
Context
Unlike traditional web apps, we are not using a persistent relational database (PostgreSQL/MySQL). The "Work-in-Progress" CCOs are transient and stored in Redis. The backend manages the orchestration between the user (API/Frontend) and the cco-core logic.
Requirements
- Framework: Initialize a new FastAPI project.
- Session Store: Implement a connection to a Redis instance. Create a helper utility to Save/Load JSON objects to Redis keys with an expiration time (TTL).
- Health Check: Provide a simple
GET /health endpoint that verifies the API is up and can connect to Redis.
Technical Scope (Suggested)
- Use
redis-py or aioredis for the Redis connection.
- The
docker-compose.yml (from the repo root) will handle spinning up the Redis container, but this issue focuses on the application code connecting to it.
- Ensure the Redis keys use a session ID (UUID) so different users don't overwrite each other's work.
Acceptance Criteria
References
Description
We need to initialize the
cco-serviceweb application. As decided in ADR-001, this will be a FastAPI application that serves as the "Service Wrapper" around the core library. This issue involves setting up the API framework and connecting it to the Redis session store.Context
Unlike traditional web apps, we are not using a persistent relational database (PostgreSQL/MySQL). The "Work-in-Progress" CCOs are transient and stored in Redis. The backend manages the orchestration between the user (API/Frontend) and the
cco-corelogic.Requirements
GET /healthendpoint that verifies the API is up and can connect to Redis.Technical Scope (Suggested)
redis-pyoraioredisfor the Redis connection.docker-compose.yml(from the repo root) will handle spinning up the Redis container, but this issue focuses on the application code connecting to it.Acceptance Criteria
GET /healthreturns200 OKand confirms Redis connectivity.cco-corelibrary is successfully imported and accessible within the API context.References