Giter Site home page Giter Site logo

fastapi-angular-template's Introduction

FastAPI backend and Angular frontend template

This is a template for building web applications with FastAPI and Angular. The backend is built with FastAPI, PostgreSQL, SQLAlchemy, and Pydantic. The frontend is built with Angular, Angular Material, and Angular Flex-Layout. The project structure is organized in such a way that the backend and frontend are separated into their own directories for easy development and deployment. The backend is served by Uvicorn and the frontend is served by the Angular CLI development server. Both the backend and frontend can be deployed using Docker and Docker Compose.

Table of Contents

Project Structure

The project structure should be organized as follows:

src
│
└───backend
│   │   main.py
│   │   requirements.txt
│   │
│   └───app
│       │   __init__.py
│       │   db.py
│       │   models.py
│       │   routers.py
│       │   schemas.py

Frontend

src
│
└───frontend
│   │   angular.json
│   │   package.json
│   │   tsconfig.json
│   │   ...
│   │
│   └───src
│       │   app
│       │   assets
│       │   environments
│       │   ...

Features

  • Backend:
    • FastAPI
    • PostgreSQL
    • SQLAlchemy
    • Alembic
    • Pydantic
    • Uvicorn
    • Docker
    • Docker Compose
  • Frontend:
    • Angular
    • Angular Material
    • Angular Flex-Layout
    • Angular CLI
    • Docker
    • Docker Compose

Requirements

Development

  1. Clone the repository:

    git clone https://github.com/lpl212757/fastapi-angular-template
  2. Navigate to the project directory:

    cd src
  3. Install the dependencies for the backend:

    pip install -r backend/requirements.txt
  4. Install the dependencies for the frontend:

    cd frontend
    npm install
  5. Start the backend server:

    uvicorn main:app --reload
  6. Start the frontend development server:

    ng serve
  7. Open your browser and visit http://localhost:4200 to see the application.

  8. Happy coding!

Deployment

  1. Build the Docker images:

    docker-compose build
  2. Start the containers:

    docker-compose up -d
  3. Open your browser and visit http://localhost to see the application.

  4. Happy coding!

fastapi-angular-template's People

Contributors

locle97 avatar

Stargazers

 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.