This is the backend of a realstate web application built using Flask, a Python web framework. The API manages announcements, user messages, user data, and administration tasks. The backend uses MySQL as the database management system (DBMS) and SQLAlchemy as the ORM (Object-Relational Mapping).
GET /ok
Retrieves a list of all announcements.
GET /<annonceId>
Retrieves details of a specific announcement identified by annonceId
.
POST /
Adds a new announcement. Requires authentication.
DELETE /<annonceId>
Deletes a specific announcement identified by annonceId
. Requires authentication.
GET /search
Searches for announcements.
GET /types
Retrieves a list of announcement types.
GET /
Retrieves announcements associated with the authenticated user. Requires authentication.
GET /
Retrieves all messages for the authenticated user. Requires authentication.
GET /unseen
Retrieves the count of unseen messages for the authenticated user. Requires authentication.
PUT /view
Marks a message as viewed. Requires authentication.
POST /
Sends a new message. Requires authentication.
GET /
Retrieves a list of all users.
POST /
Logs in a user.
PUT /user
Fills in user data. Requires authentication.
GET /<userId>
Checks if the user is valid based on address presence. Requires authentication.
GET /scrap
Scrapes announcements data. Admin access required.
GET /stats
Retrieves website statistics. Admin access required.
- Clone the repository.
- Install dependencies using
pip install -r requirements.txt
. - Set up the MySQL database and update the configuration in
config.py
. - Run the application using
python app.py
.
Feel free to contribute to the development of this web application backend. Create a fork of the repository, make your changes, and submit a pull request.