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 /okRetrieves 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 /searchSearches for announcements.
GET /typesRetrieves 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 /unseenRetrieves the count of unseen messages for the authenticated user. Requires authentication.
PUT /viewMarks 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 /userFills in user data. Requires authentication.
GET /<userId>Checks if the user is valid based on address presence. Requires authentication.
GET /scrapScrapes announcements data. Admin access required.
GET /statsRetrieves 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.