Skip to content

srjkoolen/Structify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Project

This project is a web application built with FastAPI, designed to serve dynamic HTML pages and static assets like CSS, JavaScript, and images.


Features

  • Dynamic HTML Rendering using Jinja2 templates.
  • Static File Serving for CSS, JavaScript, and images.
  • Structured project layout for scalability and maintainability.

Project Structure

my_fastapi_project/
├── app/
│   ├── __init__.py
│   ├── main.py          # Entry point for the application
│   ├── core/            # Core configuration, settings, and utilities
│   ├── models/          # Database models and schemas
│   ├── api/             # API routes
│   ├── services/        # Business logic and reusable services
│   ├── db/              # Database-related utilities
│   ├── templates/       # HTML templates for Jinja2 rendering
│   │   ├── index.html
│   ├── static/          # Static files (CSS, JS, images)
│       ├── css/
│       │   ├── styles.css
│       ├── js/
│       │   ├── scripts.js
│       ├── images/
│           ├── logo.png
├── requirements.txt     # Python dependencies

Requirements

Ensure you have the following installed on your system:

  • Python 3.8+
  • pip (Python package manager)
  • Uvicorn (ASGI server)

Setup Instructions

  1. Clone the Repository
    Clone this repository to your local machine:

    git clone https://github.com/your-repo/fastapi-project.git
    cd fastapi-project
  2. Create a Virtual Environment
    Create and activate a virtual environment to manage dependencies:

    python -m venv env
    source env/bin/activate   # For Linux/MacOS
    env\Scripts\activate      # For Windows
  3. Install Dependencies
    Install the required Python packages:

    pip install -r requirements.txt
  4. Project Configuration
    Ensure the directory structure is intact:

    • Place HTML files in the app/templates/ folder.
    • Place CSS, JS, and images in the app/static/ folder.

Running the Application

  1. Start the Server
    Run the FastAPI server using Uvicorn:

    uvicorn app.main:app --reload
  2. Access the Application
    Open your web browser and navigate to:

    http://127.0.0.1:8000
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors