markdownCopy# Claude Unlimited Backend
This is the backend service for Claude Unlimited, an AI-powered chat application using Anthropic's Claude-3.5-Sonnet model.
claude-unlimited-backend/ ├── app/ │ ├── services/ │ │ ├── anthropic_service.py │ │ └── chat_service.py │ ├── utils/ │ │ ├── database.py │ │ ├── logger.py │ │ └── token_counter.py │ ├── config.py │ ├── routes.py │ └── init.py ├── app.py ├── .env ├── .gitignore ├── Procfile ├── requirements.txt └── README.md Copy
- Clone the repository: git clone https://github.com/yourusername/claude-unlimited-backend.git cd claude-unlimited-backend Copy
- Create a virtual environment: python -m venv venv source venv/bin/activate # On Windows, use venv\Scripts\activate Copy
- Install dependencies: pip install -r requirements.txt Copy
- Set up environment variables:
Create a
.env
file in the root directory and add: ANTHROPIC_API_KEY=your_api_key_here FLASK_APP=app.py FLASK_DEBUG=True DATABASE_URL=sqlite:///chat_history.db Copy - Initialize the database: flask db upgrade Copy
- Run the application: flask run Copy
- Create a new Heroku app: heroku create claude-unlimited-backend Copy
- Set environment variables: heroku config:set ANTHROPIC_API_KEY=your_api_key_here heroku config:set FLASK_APP=app.py heroku config:set FLASK_DEBUG=False Copy
- Deploy the application: git push heroku main Copy
- Run database migrations: heroku run flask db upgrade Copy
POST /chat
: Send a message to Claude and receive a response.GET /conversations
: Retrieve a list of all conversations.GET /conversations/<id>/messages
: Retrieve messages for a specific conversation.GET /usage
: Get usage statistics.
For detailed API documentation, refer to the routes.py
file.
To learn more about the technologies used in this project, refer to: