Skip to content

Bnowako/hackathon-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Is it any good? yes

How does it work?

  1. For simple use cases we could just serve html from fastAPI
  2. For more complex use cases we would use all components
sequenceDiagram
    participant Browser
    participant NextJS as NextJS Middleware
    participant FastAPI as FastAPI Backend

    Browser->>NextJS: Request
    NextJS->>FastAPI: Proxy API Request (/api/*)
    FastAPI-->>NextJS: Response
    NextJS-->>Browser: API Response
    NextJS-->>Browser: Rendered Page (for non-API requests)

Loading

Requirements

backend

requirements

  1. Install uv
  2. Install docker
  3. Run local mongo instance
docker run -p 27017:27017 -d mongo

local development

  1. Go to backend folder
  2. Copy create .env based on .env.example in backend folder and set correct configuration properties
  3. Run local server (environment should be automaticly created by uv with correct python and correct dependencies)
uv run fastapi dev

*This modular package structure is inspired by https://github.com/zhanymkanov/fastapi-best-practices

frontend

requirements

  1. Install bun

local development

  1. Go to frontend folder
  2. Install packages
bun i
  1. Run application
bun run dev

Tricks

UI

For the ui use https://ui.shadcn.com/ which speeds up the development a lot!

Api changes

FastApi by default uses OpenAPI specification. After any changes to the api you can use frontend script that will create typescript types based on that by running

bun run generate:types

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published