A modern mock JSON server for testing HTTP requests and learning CRUD operations - Available in Python and JavaScript!
CRUDREX helps you quickly set up a mock REST API server for testing your applications, learning CRUD operations, or prototyping without needing a real backend.
cd crudrex-py
pip install -e .
crudrexcd crudrex-py
pip install -r requirements.txtpython crudrex/cli/cli.py
# or
crudrexcd crudrex-js
npm install
npm startcd crudrex-js
npm installnpm start
# or
node src/cli.js- π Create collections dynamically on-the-fly
- π Full CRUD operations (GET, POST, PUT, PATCH, DELETE)
- πΎ Automatic data persistence in JSON files
- π CORS enabled for cross-origin requests
- π₯οΈ Beautiful web interface with modern design
- β¨οΈ CLI interface for easy server management
- π± Responsive design that works on all devices
- Python Version: See
crudrex-py/README.mdfor detailed documentation - JavaScript Version: See
crudrex-js/README.mdfor detailed documentation
crudrex/
βββ crudrex-py/ # Python version (Flask)
β βββ crudrex/ # Main package
β β βββ api/ # API server
β β βββ cli/ # CLI interface
β βββ demo.py # Demo script
β βββ README.md # Python docs
β βββ pyproject.toml # Python config
β
βββ crudrex-js/ # JavaScript version (Node.js)
β βββ src/ # Source code
β β βββ cli.js # CLI interface
β β βββ server.js # API server
β βββ data/ # JSON data storage
β βββ README.md # JavaScript docs
β βββ package.json # Node.js config
β
βββ LICENSE # MIT License
βββ README.md # This file
| Feature | Python Version | JavaScript Version |
|---|---|---|
| Best For | Python developers | Node.js/JavaScript developers |
| Framework | Flask | Express.js |
| Dependencies | Lightweight | npm ecosystem |
| Performance | Fast for Python apps | Better for JavaScript apps |
| Learning | Understanding Python web | Understanding Node.js web |
Both versions support custom configuration:
- Port: Default 3000
- Data Directory: Auto-created for JSON storage
- CORS: Enabled by default
# POST request to create a new collection
curl -X POST http://localhost:3000/api/users \
-H "Content-Type: application/json" \
-d '{"name": "John Doe", "email": "john@example.com"}'# GET all users
curl http://localhost:3000/api/users
# GET specific user
curl http://localhost:3000/api/users/1# PUT (replace)
curl -X PUT http://localhost:3000/api/users/1 \
-H "Content-Type: application/json" \
-d '{"name": "Jane Doe", "email": "jane@example.com"}'
# PATCH (partial update)
curl -X PATCH http://localhost:3000/api/users/1 \
-H "Content-Type: application/json" \
-d '{"email": "jane.new@example.com"}'curl -X DELETE http://localhost:3000/api/users/1Both versions come with a beautiful web interface available at:
http://localhost:3000
The interface allows you to:
- View all collections and their data
- Add, edit, and delete records
- Test API endpoints interactively
- Monitor request/response logs
Contributions are welcome! Please feel free to submit a Pull Request.
Python Version:
cd crudrex-py
pip install -e .JavaScript Version:
cd crudrex-js
npm install
npm run devThis project is licensed under the MIT License - see the LICENSE file for details.
TraxDinosaur
- GitHub: @TraxDinosaur
- Original Python Version & JavaScript Port
- Inspired by mockapi.io and crudcrud.com
- Web interface design inspired by Hyde/Hyprland aesthetics
Note: Both versions (Python and JavaScript) offer identical functionality from a user's perspective. Choose the one that best fits your development environment and preferences.