Skip to content

mkalenda/my-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My API

A FastAPI-based web API with a complete development environment setup.

Features

  • FastAPI framework with automatic API documentation
  • Pydantic models for data validation
  • Comprehensive testing with pytest
  • Code formatting with Ruff
  • Type checking with MyPy
  • Pre-commit hooks for code quality
  • Development server with hot reload

Quick Start

1. Set up the development environment

# Using the shell script
./dev.sh setup

# Or using Make
make setup

# Or using Python script
python scripts/dev.py setup

2. Start the development server

# Using the shell script
./dev.sh dev

# Or using Make
make dev

# Or using Python script
python scripts/dev.py dev

The API will be available at:

Development Commands

Make Commands

make help        # Show available commands
make setup       # Install dependencies and set up pre-commit hooks
make dev         # Start development server with hot reload
make test        # Run tests
make test-watch  # Run tests in watch mode
make lint        # Run linting
make format      # Format code
make type-check  # Run type checking
make check       # Run all checks (lint, format, type-check)
make clean       # Clean cache and temporary files
make install     # Install dependencies

Project Structure

my-api/
├── src/
│   └── main.py              # FastAPI application
├── tests/
│   ├── __init__.py
│   └── test_main.py         # Test cases
├── .pre-commit-config.yaml  # Pre-commit hooks configuration
├── Makefile                 # Make commands
├── pyproject.toml           # Project configuration
└── README.md                # This file

Code Quality

This project uses several tools to maintain code quality:

  • Ruff: Fast Python linter and formatter
  • MyPy: Static type checker
  • pytest: Testing framework
  • pre-commit: Git hooks for code quality

All tools are configured in pyproject.toml and run automatically via pre-commit hooks.

Testing

Run tests with:

make test

Tests are located in the tests/ directory and use pytest with FastAPI's test client.

Requirements

  • Python 3.13+
  • uv (Python package manager)

About

A Python API project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors