Giter Site home page Giter Site logo

fastapi-project's Introduction

FastAPI Todo App

This is a simple todo app using FastAPI, HTMX, Jinja and SQLite. It allows you to create, update and delete tasks from a web interface. It uses SQLite as the database and SQLAlchemy as the ORM.

Why these technologies?

  • FastAPI: FastAPI is a modern and fast web framework for Python that supports async operations, dependency injection, data validation and automatic documentation. It is based on Pydantic and Starlette, and it is well suited for building RESTful APIs and microservices.
  • HTMX: HTMX is a lightweight JavaScript library that lets you add dynamic behavior to your HTML using custom attributes. It enables you to use AJAX, WebSockets, CSS transitions and server-sent events without writing any JavaScript code. It is ideal for creating interactive and responsive web pages with minimal effort.
  • Jinja: Jinja is a powerful and flexible templating engine for Python that allows you to generate HTML, XML or other markup formats from Python data structures. It supports template inheritance, sandboxed execution, automatic HTML escaping and many other features. It integrates well with FastAPI and HTMX, and it makes it easy to create dynamic web pages.
  • SQLite: SQLite is a self-contained, serverless, zero-configuration and cross-platform database engine that stores data in a single file. It supports most of the SQL standard features, such as transactions, triggers, views and indexes. It is fast, reliable and portable, and it can handle low to medium traffic web applications.
  • SQLAlchemy: SQLAlchemy is a popular and mature ORM (object-relational mapper) for Python that provides a high-level abstraction over various databases. It allows you to write Python code to manipulate data instead of raw SQL queries. It supports multiple database backends, including SQLite, and it offers many advanced features such as declarative mapping, query expressions, session management and schema migrations.

How to run this app?

To run this app, you need to have Python 3.8 or higher installed on your system. You also need to install the required packages using the following command:

pip install -r requirements.txt

Alternatively, you can use Docker to build and run the app without installing anything locally. To do that, you need to have Docker and Docker Compose installed on your system. Then, you can use the following commands:

docker-compose build
docker-compose up

To start the app, you need to run the following command:

uvicorn main:app --reload

This will start a local server on port 8000. You can access the app by visiting http://localhost:8000 in your browser.

To use the app, you need to create an account and log in. You can then add tasks by filling the form and clicking the "Add" button. You can also update the status of a task by clicking the "Update" button or delete a task by clicking the "Delete" button.

References

: Why FastAPI? : FastAPI - The Database Toolkit for Python : Why Every Web Developer Should Know HTMX? : htmx - high power tools for html : Jinja2 Explained in 5 Minutes! : Jinja - Reviews, Pros & Cons | Companies using Jinja : What Is SQLite and Why Is It So Popular? : SQLite - The Database Toolkit for Python : SQLAlchemy - Introduction : SQLAlchemy + Pandas: A Comprehensive Guide to Database Session Management

fastapi-project's People

Contributors

thefirsthero avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.