ProjectCED / CED-LLM

Classify and Enhance Data with LLM - Project for Tampere University course Software Engineering Project. Working with Solita.
MIT License
0 stars 0 forks source link

Backend Libraries #18

Closed VeriHeppi closed 3 weeks ago

VeriHeppi commented 3 weeks ago

Description:
Research and decide on the backend libraries used in our Python-based API. These libraries will support tasks such as API development, database connections (Neo4J), testing, and other common back-end functionalities. This research will help us identify the best tools for performance, security, and ease of use.

Task List:

  1. API Frameworks:

    • Flask - Lightweight and widely used, Flask allows us to build simple RESTful APIs quickly.
      • Useful link: Flask Documentation
      • Pros: Lightweight, easy to learn, flexible.
      • Cons: Requires more manual setup for larger projects (e.g., blueprints, authentication).
    • FastAPI - A modern, fast (high-performance) framework for building APIs with Python, based on standard Python type hints.
      • Useful link: FastAPI Documentation
      • Pros: Automatic generation of OpenAPI docs, asynchronous support, better performance than Flask.
      • Cons: Slightly more complex to set up than Flask, newer and less battle-tested.
  2. Database Libraries:

    • Neo4J Driver - Official Python driver for Neo4J to handle communication with the Neo4J graph database.
      • Useful link: Neo4J Python Driver Docs
      • Pros: Optimized for Neo4J, built-in session and transaction management.
      • Cons: Requires understanding of Cypher queries and graph data models.
  3. Object-Relational Mappers (ORMs):

    • Py2Neo - A client library and ORM that offers a high-level API for interacting with Neo4J.
      • Useful link: Py2Neo Documentation
      • Pros: High-level abstraction for interacting with the graph database, integrates well with Python data structures.
      • Cons: May add overhead if complex Cypher queries are needed.
  4. Authentication & Security Libraries:

    • Flask-JWT-Extended - Adds JSON Web Token (JWT) support to Flask for secure user authentication.
    • FastAPI Users - A user management package for FastAPI, with OAuth2, JWT, and user management utilities.
  5. Testing Libraries:

    • pytest - A powerful testing framework for Python.
      • Useful link: pytest Documentation
      • Pros: Flexible, well-documented, and widely used in the Python ecosystem.
      • Cons: Requires initial configuration for complex setups.
    • Flask-Testing - A set of utilities to test Flask applications.
      • Useful link: Flask-Testing Docs
      • Pros: Simplifies testing of Flask applications, and integrates with pytest.
      • Cons: Flask-specific, not suited for other frameworks.
  6. Task Queues (optional):

    • Celery - Distributed task queue for Python, useful if we need to handle background tasks.
      • Useful link: Celery Documentation
      • Pros: Well-suited for distributed systems and task management.
      • Cons: May add complexity if the project doesn’t require task queuing.

Next Steps:

  1. Review documentation and examples for each library.
  2. Compare based on our project needs: performance, ease of integration, and learning curve.
  3. Make a decision and update the project plan accordingly.
vnuotio commented 3 weeks ago
  1. Flask - more mature and developed, both are good for small scale projects so there shouldn't be any problems with using this.
  2. Flask-JWT-Extended
  3. Pytest and Flask-Testing useful. Testing will become relevant in later sprints.