Skip to content

jsshmzx/Tinder

Tinder

航海家计划后端API服务

Python Tests Docker Build CI Pylint CodeQL License

技术栈

  • 框架: FastAPI
  • 数据库: PostgreSQL(异步驱动:asyncpg)
  • ORM: SQLAlchemy 2.x(异步模式)
  • 缓存: Redis
  • 部署: Docker

快速开始

环境要求

  • Python 3.10+
  • PostgreSQL
  • Redis

本地开发

  1. 安装依赖
pip install -r requirements.txt
  1. 配置环境变量
cp .env.example .env
# 编辑.env文件设置数据库和Redis连接信息
  1. 数据库迁移
python db_migrate.py
  1. 运行服务
python server.py

服务将在 http://localhost:1912 启动

Docker 部署

docker build -t tinder .
docker run -p 1912:1912 tinder

Docker Compose 本地开发

docker compose up --build

服务将在 http://localhost:1912 启动。

首次启动会自动执行数据库迁移(docker-entrypoint.sh 中已包含 python db_migrate.py)。

停止并移除容器:

docker compose down

项目结构

├── modules/          # 功能模块(用户、索引等)
├── core/            # 核心功能(数据库迁移)
├── docs/            # 文档
├── server.py        # 主应用入口
├── db_migrate.py    # 数据库迁移管理
└── requirements.txt # 项目依赖

API 文档

启动服务后访问 http://localhost:1912/docs 查看Swagger文档

贡献指南

贡献前请先阅读 CONTRIBUTING.md

About

航海家计划后端API,使用Python+pgsql+redis

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages