This is a FastAPI project with various domain models, routes, and services configured for a web application. It includes functionality for writing model fields to a TypeScript-compatible format for frontend use.
-
Clone the repository:
git clone https://github.com/yourusername/yourrepository.git
-
Navigate to the project directory:
cd <your-file-clone-repository>
-
Install the required dependencies:
pip install -r requirements.txt
The project includes the following routes:
- /index
- /blog
- /comments
- /experiences
- /links
- /projects
- /user
- /login
- /register
- /contact
- /newsletter
- /subscriber
Each route is prefixed with its corresponding path and tagged for easier organization in the OpenAPI documentation.
The project includes several Pydantic models defined in the src.domain package:
- Blog
- Experiences
- Contact
- User
- Links
- Projects
- Subscriber
- Newsletter
- Comment
This project includes a script to document the field names and types of the models and write them to output.txt for frontend usage.
To use this feature:
- Run the main script
- When prompted, type
y
to drop and seed the database if needed. - When prompted, type
y
to write the document.
The script will generate an output.txt
file with the following format:
/* tslint:disable */
/* eslint-disable */
export interface Blog {
'_id'?: string;
naslov: string;
kategorija: string;
// and others
}
/* tslint:disable */
/* eslint-disable */
export interface Experiences {
'_id'?: string;
title: string;
stack: string;
// and others
}
// Other models will follow the same pattern