Skip to content

SANDEEPNEGI07/rest-api-with-Flask

Repository files navigation

REST API with Flask 🌐

A simple REST API built with Flask, providing basic CRUD operations.

A lightweight and easy-to-use API for managing resources.

GitHub stars GitHub forks GitHub issues GitHub pull requests GitHub last commit

Python Flask

About

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.

✨ Features

  • 🎯 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.

🚀 Quick Start

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.py

Open http://localhost:5000 to view it in your browser.

📦 Installation

Prerequisites

  • Python 3.6+
  • pip

Steps

# 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.py

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Quick Contribution Steps

  1. 🍴 Fork the repository
  2. 🌟 Create your feature branch (git checkout -b feature/AmazingFeature)
  3. ✅ Commit your changes (git commit -m 'Add some AmazingFeature')
  4. 📤 Push to the branch (git push origin feature/AmazingFeature)
  5. 🔃 Open a Pull Request

Development Setup

# 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

Code Style

  • Follow existing code conventions
  • Run flake8 app.py before committing
  • Add tests for new features
  • Update documentation as needed

Testing

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/

Docker

  1. 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"]
  1. Build and run the Docker image:
docker build -t rest-api-flask .
docker run -p 5000:5000 rest-api-flask

💬 Support

🙏 Acknowledgments

  • 📚 Libraries used:
    • Flask - A microframework for Python based on Werkzeug, Jinja 2 and good intentions.
    • requests - Python HTTP for Humans.
  • 👥 Contributors: Thanks to all contributors

About

RESTapi Application with proper CRUD operation

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published