This project is designed to demonstrate the process of developing a software product and implements a chat for communication
Study plan link
1. poetry install
2. docker compose up -d
3. poetry run python -m messenger
- package manager is poetry
- core framework is FastAPI
- database Postgres
my-app/
├── alembic/ - store migrations
├──── env.py - functions for running migrations
├── app/
├──── app/
├────── api/ - handle all routes in separite files
├──────── __init__.py
├────── __init__.py
├────── app.py - accumulate all routes
├──── db/ - store models for database
├──── modules/ - provide buistes logic
├──── schemas/ - store data schemas
├──── services/ - provide buisnes logic
├── __init__.py
├── __main__.py - mane file that run app
├── .env - contains environment variables like creds
├── .gitignore
├── .dockerignore
├── .alembic.ini - config file for alembic
├── .docker-compose.yml
├── poetry.lock
└── pyproject.toml
Each web-app is an application that modify some data. Data is a core element that describe all system and any operations is a process of data transformation into new specific format
So data is a core of any application and any project starts from the questions
- What data we are going to handle
- How they are going to describe ower system
The answers to the questions lie in the list of requirements and ideas that customers put forward. For this project core idea is
Develop some messanger for secure communication beetwing customers and workers, handle some personal informations. Allow integrate different bots.
Requirements are:
- Messaging in private and group chats
- Personal information about client
- Role played system
- Notifications
- Bot integration
Once this answer has been obtained, we can define the data we are working with.
Database we are going to use is postgres as the most popular database
Tables:
- Users - store creds and basic info about user
- Chats - private, group
- Messages - text messages, photo or video, file
- Roles - client, admin, worker
- User profile
- Notifications
All picies of data are related to other. For example User is a person that create chats, send messages, receive notifications and so on So we should connect all data to each other and receive some diagram. It's called conceptual diagram.
+-----------------+ +-----------+ +----------------+
| Roles | <------ | Users | <------- | UserProfiles |
+-----------------+ +-----------+ +----------------+
+-----------------+ +---------------+ +---------+
| Chats |<------->| ChatMembers |<------->| Users |
+-----------------+ +---------------+ +---------+
+-----------------+ +---------+
| |-----> | Chats |
| Messages | +---------+
| | +---------+
| |-----> | Users |
+-----------------+ +---------+
+-----------------+ +---------+
| Notifications |-----> | Users |
+-----------------+ +---------+