Coder Social home page Coder Social logo

awesome-fastapi-projects's Introduction

Awesome FastAPI Projects

View the website: https://kludex.github.io/awesome-fastapi-projects/

Local Development

Setup

Python and Virtual Environment

The instructions below assume you have pyenv installed. If you don't, use any other method to create a virtual environment and install Python 3.11.4.

  • Install Python 3.11.4
pyenv install 3.11.4
  • Create a virtual environment
pyenv virtualenv 3.11.4 awesome-fastapi-projects
  • Activate the virtual environment
pyenv local awesome-fastapi-projects

Install dependencies and pre-commit hooks

There is a Makefile with some useful commands to help you get started. For available commands, run make help. To install dependencies and pre-commit hooks, run:

make

Frontend

The frontend is built with React and Next.js. It is being statically built and served on GitHub Pages: https://kludex.github.io/awesome-fastapi-projects/

To run the frontend locally, you need to install Node.js and pnpm. The node version is specified in the .node-version file. To easily manage the node version, you can use fnm. Then, run the following commands:

make front

This will install the dependencies and start the development server. The frontend will be available at http://localhost:3000.

awesome-fastapi-projects's People

Contributors

kludex avatar sondrelg avatar vladfedoriuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

awesome-fastapi-projects's Issues

Serious need for an update

I think this is a fantastic collection of projects. Problem is that many links lead to a 404 and a lot of projects have been abandoned for a while. With all of the changes in Python and other dependencies, these examples are dated and a lot of builds fail. Maybe get a group of people willing to check out projects and accept pull requests? I know I'd be willing to contribute.

Add CONTRIBUTING.md

As it stands it's really hard to figure out how to contribute to this project.

@Kludex if you're not able to maintain this project anymore, a good idea would be to add a CONTRIBUTING.md file as a last effort, so that potential maintainer candidates know what maintaining and contributing to the project entails. It'll probably lead to more interest which is good, cause it would be a shame if this project died completely

Make the repositories sorted by stars (descending) by default

Currently, the repositories in a table are randomly ordered.

To sort them either in descending or ascending directions, one would need to tap/click on the stars column header.

It is counterintuitive, moreover, taking into account, that repositories with the higher numbers of stars tend to appear on top of a table.

Additionally, it would be nice to inform the user about the current sorting direction.

Improve dependencies parsing performance

The dependencies parsing for repos is quite slow.

The reasons for this are:

  • To parse dependencies for repo, a repo needs to be cloned into a temporary directory:
    • A temporary directory is created before cloning the repo and destroyed immediately after the parsing is finished
  • A new process is spawned for each repo to use a tool to parse the dependencies
  • Database operations - updating the repo, creating dependencies, repo-dependencies m2m relations.

There are some heuristics in place to prevent unnecessary parsing:

  • A revisions hash is stored from the last repo parsing session - so if the revision does not change, we do nothing.

Possible improvements could be:

  • Using a process pool to reuse the processes for dependencies parsing sessions.

Statistics

It would be nice to show some statistics about the data which is gathered.

The concept is to display at least:

  1. The total number of repositories in the dataset
  2. The total number of dependencies
  3. Perhaps, it could be nice to show an average number of dependencies per project, although, it is unclear if it this information is useful

A neat feature would be to show the delta from the previous scraping and parsing session: how many repositories have been added from the previous deployment, and how many new dependencies have been parsed.

Improve pagination

Consider improving the pagination UI (the "Next" and "Previous" buttons at the bottom of the table).

It would be useful to jump straight onto a selected page or skip some pages if desired.

A current page the user is on should be reflected in a query parameter value (similar to search and dependencies query parameters). This is useful for sharing the links to the specific page or just preserving the state in between the page reloads.

error while running your project

stack trace

Traceback (most recent call last):
File "generate_table.py", line 31, in
writer.value_matrix = [
File "generate_table.py", line 32, in
[format_with_link(project), ", ".join(filter_list(dependencies))]
File "generate_table.py", line 22, in format_with_link
links = open("unique_links.txt", "r")
FileNotFoundError: [Errno 2] No such file or directory: 'unique_links.txt'

Looking for maintainers

I don't have time to maintain this project anymore. If you are reading this, and you want to help, the same comment that I made before applies for you: #15 (comment)

Improve the mobile UI

Currently, when the page is opened on a mobile device with a small screen, the following problems occur:

  1. The header is missing (probably some tailwind CSS class is responsible for that and should be removed)
  2. The table does not fit the screen, and the scrollbar shows up.
  3. The title does not fit the screen as well.
  4. The cross to unselect a dependency for the dependencies multi-select input is too small and it is hard to tap on it.
  5. It is hard to read the repository description due to text-overflow behavior
    • It is worth noticing, that the text-overflow behavior was intentionally added and it works well on a desktop. However,
      for mobile devices, an accordion-like widget for description would possibly be a better option.

So, in order to adapt the app to mobile devices, I suggest:

  1. redesign the header - make it appear on a screen and change the layout of the elements.
  2. redesign the footer - make it more compact
  3. redesign the table row, and make the table fit the screen
  4. decrease the font size of the heading (title)
  5. Adapt the form, make it bigger, improve the multi-select input

Standardize changelog and releasing

  • A changelog should be kept
  • A new release should be created for a batch of changes (with corresponding build and a tag)
  • Standardize the git flow

Dark mode

Investigate if we could add a dark mode easily.

Bug with a hard reload on navigation

When we use the Next.js router navigation (even just to update the query parameters), the hard reload is happening and the table is flickering (first, the unfiltered table is shown, then the table re-renders and the actual filtered result is displayed).

Perhaps, related to netlify/next-runtime#2089

Also, upgrading Next.js might be helpful: #26

Overall, it should be investigated how the table flickering on reload can be prevented.

Maintenance

Some of the dependencies need upgrading.

The project utilizes pip-tools for Python dependencies management, so one may adhere to:
https://github.com/jazzband/pip-tools#updating-requirements

Essential packages to keep updated and to pay the most attention to:

  • Pydantic
  • SQLAlchemy, aiosqlite, alembic
  • Typer
  • httpx (and httpx-* extensions)
  • third-party-imports

Also, necessary development/testing dependencies are:

  • pytest (and pytest-* plugins)
  • polyfactory (see if a better integration with SQLAlchemy has already landed, perhaps, adjust the codebase)
  • dirty-equals
  • ruff (get rid of black in favor of a new ruff formatter)
  • mypy (and types-* plugins)
  • pyproject-fmt
  • ipython
  • pre-commit
  • stamina
  • loguru

Generally, consult pyproject.toml to see the core Python dependencies standing behind the project.

For Node.js packages, a pnpm package manager is employed:
Useful commands:

https://github.com/kachkaev/njt can be used to track the changelog of the packages to be updated

The following Frontend dependencies updates will require special care and thorough testing:

Apart from that, both pip-tools (pip?), and pnpm might also require an update.

CI/CD and pre-commit hooks will need to be adapted as well.
To update the pre-commit hooks, you may use https://pre-commit.com/#updating-hooks-automatically
But keep in mind to sync the linter / formatters versions among .pre-commit-config.yaml, respective lock files (requirements/*.txt and package.json), and GitHub Actions Workflows configs.

Consider if it is time to bump Python (to 3.12) and Node.js (to 20.*) versions.

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.