This project is a mini-chat using FastAPI to create an API, SQLAlchemy to work with a database, and a simple frontend to interact with users. The app contains two main models: a user model and a message model, which allows users to send and receive messages in real time.
- Backend: FastAPI
- Frontend: HTML/JavaScript
- ORM: SQLAlchemy
- Database: Any database supported by SQLAlchemy (e.g., PostgreSQL or SQLite). The example uses SQLite.
- User Model: Contains user information, including username, email and password.
- Message Model: Stores messages sent by users, including the time they were sent, the sender, and the body of the message.
It is a web-based messaging application where users can send and receive real-time messages. Key features include:
- Authentication: Register and authorize users through HTML and JavaScript forms. APIs are used for data processing and validation.
- Chat: Users can select interlocutors from the list and chat with them. Messages are displayed in the chat window.
- Sending Messages: Users can send text messages. WebSocket is used for instant message delivery. Old messages are loaded using server polling.
- Interface: A modern and responsive interface using CSS that provides a seamless experience across devices.
- User Management: Ability to select interlocutors, log out and work with "Favorites" like "Favorites" from telegrams.
Below is an animation that demonstrates the process of the application:
pip install -r requirements.txtalembic upgrade headuvicorn app.main:app