A real-time chat application with WebSocket support, built with FastAPI, PostgreSQL, and Redis.
New here? Start with our WELCOME.md or .ai-ide-welcome.md for a quick overview and links to all onboarding resources!
- Real-time chat using WebSocket connections
- User authentication with JWT tokens
- Message history and persistence
- Rate limiting and connection management
- Health monitoring and telemetry
- Comprehensive test suite
mcp_chat_client/
├── backend/ # FastAPI backend
│ ├── app/ # Application code
│ │ ├── api/ # API endpoints and routers
│ │ ├── core/ # Core functionality
│ │ ├── db/ # Database models and sessions
│ │ ├── models/ # SQLAlchemy models
│ │ ├── schemas/ # Pydantic schemas
│ │ └── services/ # Business logic services
│ ├── tests/ # Test suite
│ ├── alembic/ # Database migrations
│ └── Dockerfile # Backend container definition
├── docker/ # Docker configuration
│ ├── dev/ # Development environment
│ └── test/ # Test environment
├── docker-compose.dev.yml # Development compose file
├── docker-compose.test.yml # Test compose file
└── .env.example # Environment variables template
- Docker and Docker Compose
- Python 3.9+
- Node.js 16+ (for frontend development)
-
Clone the repository:
git clone https://github.com/yourusername/mcp_chat_client.git cd mcp_chat_client -
Copy the environment template:
cp .env.example .env
-
Update the
.envfile with your configuration:- Set your database credentials
- Configure Redis settings
- Set up JWT secret key
- Configure API keys for AI services
-
Start the development environment:
docker compose -f docker-compose.dev.yml up -d
-
Access the application:
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
-
Install dependencies:
cd backend pip install -r requirements.txt pip install -r requirements-test.txt -
Run database migrations:
./run_migration.sh
-
Start the development server:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
-
Start the test environment:
docker compose -f docker-compose.test.yml up -d
-
Run the test suite:
cd backend pytest -
Generate coverage report:
pytest --cov=app tests/
The API documentation is available at /docs when running the application. It includes:
- REST API endpoints
- WebSocket connection details
- Authentication requirements
- Request/response schemas
See .env.example for all required environment variables. Key variables include:
- Database configuration (PostgreSQL)
- Redis settings
- JWT configuration
- WebSocket settings
- Test environment settings
- Monitoring configuration
- AI provider API keys
To set up your environment:
- Copy
.env.exampleto.envand fill in the values as needed. - Run
bash validate_env.shto check for missing or empty variables.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
See docs/admin_endpoints.md for a full guide to all admin-only API endpoints, including usage tips and example requests.
- Troubleshooting & Environment Issues: docs/env_troubleshooting.md
- Known Issues: KNOWN_ISSUES.md
To serve onboarding, rules, and knowledge graph data via HTTP for AI-IDE tools:
make -f Makefile.ai ai-ide-api-build # Build the Docker image
make -f Makefile.ai ai-ide-api-up # Start the API at http://localhost:8080
make -f Makefile.ai ai-ide-api-down # Stop the APIExample endpoints: