Skip to content

zenosaaur/shutsuensha.ru

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

773 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฐ Pinterest Clone

1536 ร— 864 / Vue 3 & FastAPI

Clone for educational purposes only

๐Ÿฐ Try it right now!

Quick try with test account and get started

Logo

โš ๏ธ Disclaimer:
This project is an unofficial Pinterest clone created solely for educational purposes.
It is not affiliated with, endorsed by, or sponsored by Pinterest Inc.
Use responsibly and respect copyright and trademark laws.

๐Ÿ”ฅ Features at a Glance

  • ๐Ÿ–ผ๏ธ Masonry grid feed with infinite scroll
  • ๐Ÿ” Search by query and tags
  • ๐Ÿ“Œ Detailed pins with comments, likes, related pins
  • ๐Ÿ“ Create/edit pins and boards
  • ๐Ÿ‘ค User profiles with followers/following
  • ๐Ÿ’ฌ Real-time chat & notifications
  • ๐Ÿ“ก SSE & WebSocket-powered updates
  • ๐Ÿง  Smart recommendations based on user activity
  • ๐Ÿ” JWT & Google OAuth2
  • โš™๏ธ REST & GraphQL APIs
  • ๐Ÿ“ฆ Dockerized with GitLab CI/CD
  • ๐ŸŒ Nginx Reverse Proxy/Security/Optimization

๐ŸŽฏ Use Cases

  • Build your own image-sharing platform
  • Learn modern full-stack development with Vue + FastAPI
  • Use the project as a boilerplate for social media apps
  • Practice advanced CI/CD & real-time data techniques

๐Ÿ“ฝ Overview

๐ŸŒธ Feed

The feed is the main page featuring search and tags, displaying pins in the form of gifs, videos, and images. It shows users who have posted these pins. The layout follows a masonry grid design with infinite scrolling.

๐Ÿ“Œ Pin + Related

A detailed pin with title, description, href, tags, and the user who created it. Includes comments and likes. Below the pin, related pins are displayed based on connected tags.

๐Ÿ” Search

Pin search by query and tags, with a quick search feature available on any page. It also displays popular pins and a list of recent searches.

โœจ New Pin

Pin creation โ€” image/gif/video, with the option to add additional information to the pin and assign tags to it.

๐Ÿ‘ค User Profile

User profile โ€” profile editing by the owner, creation of boards, viewing/editing created/liked/saved pins, viewing/editing pins on boards. Users can also follow/unfollow and message other users.

๐Ÿ‘ฅ Followers/Following

View followers/following for any user.

๐Ÿงท Boards

Users create boards and add/remove pins on them

โญ Recommendations

Users receive real-time recommendations based on their recently viewed pins.

๐Ÿ”” Realtime Updates

Users receive real-time updates from others when their pins are saved, commented on, or liked.

๐Ÿ’ฌ Chats

By messaging another user, you create a chat where you can exchange messages and media in real time. Chats can be customized in terms of size and color. You can also see which users are online on the site or in the chat.

๐Ÿ’ฌ๐Ÿ”” Chats Updates

On any page, you receive real-time updates about new messages from other users.

๐Ÿ“โค๏ธ Comments/Likes

You can comment on, like, and save a pin, as well as comment on and like other comments.

Project Architecture

Architecture

๐Ÿ› ๏ธ Technologies Used

๐Ÿงฉ Backend

  • FastAPI โ€“ REST & GraphQL API
  • SQLAlchemy โ€“ ORM for database interactions
  • Pydantic โ€“ data validation & environment management
  • JWT โ€“ access/refresh tokens with revocation support
  • OAuth2 โ€“ Google authentication
  • httpx โ€“ interaction with external APIs
  • FastAPI-Cache โ€“ API-level caching
  • FastAPI-Limiter โ€“ API-level rate limiting
  • FastAPI-Mail โ€“ sending emails via FastAPI
  • GraphQL (Strawberry) โ€“ GraphQL API layer

๐Ÿ—„ Databases

  • PostgreSQL, MySQL, MongoDB โ€“ relational & non-relational databases
  • Redis โ€“ caching, token revocation, Celery broker/results, RedBeat

โฑ Async Tasks & Realtime

  • Celery โ€“ async tasks: email sending, image processing
  • Celery Beat โ€“ periodic tasks (e.g., promo emails)
  • Redis Stream โ€“ Consumer Groups, message streaming, background worker processing
  • Redis pub/sub โ€“ message passing between Celery and FastAPI
  • RabbitMQ โ€“ task and result passing between Celery and FastAPI
  • RabbitMQ pub/sub โ€“ message publication to exchange, queue subscription, SSE message transfer
  • RabbitMQ stream โ€“ message publishing and consumption from RabbitMQ queues
  • WebSockets โ€“ real-time chat with FastAPI.websockets
  • SSE (Server-Sent Events) โ€“ real-time notifications
  • Asyncio, Aiofiles โ€“ asynchronous operations

๐Ÿงช Testing & Code Quality

  • Pytest โ€“ testing framework
  • Ruff โ€“ linting & formatting
  • Alembic โ€“ database migrations
  • Logging โ€“ error logging (client-side, server-side, request logging)
  • Sentry โ€“ real-time error tracking, exception capturing, and performance monitoring

๐Ÿ“ฆ Deployment

  • Docker, Docker Compose โ€“ containerization & orchestration
  • Nginx โ€“ reverse proxy with routing for API, WebSocket, Vue.js, SSE, and Prometheus with basic auth
  • SSL โ€“ secure HTTPS
  • VPS โ€“ deployment on virtual server
  • GitLab CI/CD โ€“ automated build, lint/format, migrations, test, deploy pipeline
  • Yandex S3 โ€“ media file storage (Yandex Object Storage)
  • Prometheus โ€“ monitoring & metrics collection for FastAPI, VPS (via node-exporter), and Nginx (via nginx-exporter)
  • Grafana โ€“ visualization of metrics collected by Prometheus for monitoring system performance and health
  • Loki โ€“ centralized log aggregation system for collecting logs
  • Promtail โ€“ agent for gathering and shipping logs to Loki

๐ŸŽจ Frontend

  • Vue 3 โ€“ modern JavaScript frontend framework
  • Pinia โ€“ state management
  • Vue Router โ€“ routing
  • Tailwind CSS โ€“ utility-first CSS framework
  • Axios โ€“ HTTP client

โš™๏ธ CI/CD Pipeline

This project uses GitLab CI/CD to automate the entire delivery process. The pipeline includes the following stages:

  • ๐Ÿงฎ Check Disk Space
    Before anything starts, it checks available disk space. If it's less than 3 GB, it automatically runs docker system prune to free space.

  • ๐Ÿณ Docker Build
    Builds separate Docker images for:

    • FastAPI backend (Dockerfile-fastapi)
    • Vue 3 frontend (Dockerfile-vuejs)
  • โœ… Lint & Format

    • Runs ruff check to detect linting issues.
    • Runs ruff format --check to ensure formatting consistency.
  • ๐Ÿ› ๏ธ Database Migrations

    • Applies PostgreSQL migrations via alembic upgrade head.
    • Initializes MySQL database via custom script (app.mysql.init_db).
  • ๐Ÿงช Testing
    Runs pytest inside a container.

  • ๐Ÿš€ Deploy
    Uses docker-compose up -d to start all services after successful testing.

๐Ÿ”’ Secrets & Env Handling:
Before any job runs, the pipeline copies environment variables from a predefined ${ENV} file and exports them for the scripts.

You can view the complete CI/CD configuration in .gitlab-ci.yml.

Discussion

Have suggestions or improvements for the project? Feel free to discuss them in the Discussion section!

License

MIT License โ€“ free to use & share!

Contacts

Feel free to reach out if you have any questions, suggestions, or collaboration ideas:

About

Pinterest Clone | Vue 3 & FastAPI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Vue 63.7%
  • Python 32.8%
  • HTML 2.1%
  • JavaScript 1.2%
  • Other 0.2%