A simple REST API built with Flask, providing basic CRUD operations.
A lightweight and easy-to-use API for managing resources.
This project is a basic REST API implemented using the Flask framework in Python. It provides a foundation for building more complex APIs by offering standard CRUD (Create, Read, Update, Delete) operations. This API is designed to be simple, easy to understand, and a good starting point for developers learning Flask or those needing a quick API solution.
The API targets developers who need to create, manage, and access data through HTTP requests. It is suitable for small to medium-sized projects where a lightweight framework like Flask is preferred. The architecture is straightforward, leveraging Flask's routing and request handling capabilities.
Key technologies include Python and Flask. The API follows a RESTful design, using standard HTTP methods (GET, POST, PUT, DELETE) to interact with resources. Its unique selling point is its simplicity and ease of customization, making it ideal for rapid prototyping and learning.
- 🎯 CRUD Operations: Supports Create, Read, Update, and Delete operations for resources.
- ⚡ Lightweight: Built with Flask, ensuring minimal overhead and fast performance.
- 🔒 Secure: Can be easily secured with authentication and authorization mechanisms.
- 🎨 Simple Design: Easy-to-understand and modify codebase.
- 🛠️ Extensible: Can be extended with additional features and endpoints.
Clone and run in 3 steps:
git clone https://github.com/SANDEEPNEGI07/rest-api-with-Flask.git
cd rest-api-with-Flask
pip install -r requirements.txt && python app.pyOpen http://localhost:5000 to view it in your browser.
- Python 3.6+
- pip
# Clone repository
git clone https://github.com/SANDEEPNEGI07/rest-api-with-Flask.git
cd rest-api-with-Flask
# Create a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Linux/macOS
venv\Scripts\activate # On Windows
# Install dependencies
pip install -r requirements.txt
# Run the application
python app.pyWe welcome contributions! Please see our Contributing Guide for details.
- 🍴 Fork the repository
- 🌟 Create your feature branch (
git checkout -b feature/AmazingFeature) - ✅ Commit your changes (
git commit -m 'Add some AmazingFeature') - 📤 Push to the branch (
git push origin feature/AmazingFeature) - 🔃 Open a Pull Request
# Fork and clone the repo
git clone https://github.com/yourusername/rest-api-with-Flask.git
# Install dependencies
pip install -r requirements.txt
# Create a new branch
git checkout -b feature/your-feature-name
# Make your changes and test
python app.py # Run the app
# Commit and push
git commit -m "Description of changes"
git push origin feature/your-feature-name- Follow existing code conventions
- Run
flake8 app.pybefore committing - Add tests for new features
- Update documentation as needed
To run tests, execute the following command:
# Install pytest (if not already installed)
pip install pytest
# Run tests (example, assuming you have a tests/ directory)
pytest tests/- Create a
Dockerfile:
FROM python:3.9-slim-buster
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "app.py"]- Build and run the Docker image:
docker build -t rest-api-flask .
docker run -p 5000:5000 rest-api-flask- 📧 Email: sandeepnegi5898@gmail.com
- 🐛 Issues: GitHub Issues
- 📖 Documentation: Full Documentation
- 📚 Libraries used:
- 👥 Contributors: Thanks to all contributors