Tokenwise is a proxy server to cache your open-ai API responses and reduce your token usage and bills.
- Node.js (Latest LTS version recommended)
- MongoDB
- npm or yarn package manager
- Clone the repository:
git clone https://github.com/varun-r-boop/tokenwise.git
cd tokenwise
- Install dependencies:
npm install
- Create a
.env
file in the root directory and add your environment variables:
PORT=3000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
npm start
- Runs the compiled JavaScript codenpm run dev
- Runs the TypeScript code directly using ts-nodenpm run build
- Compiles TypeScript to JavaScriptnpm run lint
- Runs ESLint to check code qualitynpm run lint:fix
- Runs ESLint and automatically fixes issues
src/
├── controller/ # Request handlers
├── db/ # Database configuration
├── models/ # Mongoose models
├── routes/ # API routes
├── utils/ # Utility functions
└── index.ts # Application entry point
- express: Web framework
- mongoose: MongoDB object modeling
- jsonwebtoken: JWT authentication
- bcrypt: Password hashing
- cors: Cross-origin resource sharing
- dotenv: Environment variable management
- @xenova/transformers: AI capabilities
- typescript: TypeScript support
- ts-node: TypeScript execution
- eslint: Code linting
- @types/*: TypeScript type definitions
- Fork the repository
- Create your feature branch (
git checkout -b users/username/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin users/username/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.