This project is a simple microservice using Flask for a social media application with basic entities: User, Post, Comment, Like, Share, and Follow/Friendships.
The main focus of the business is to create a simple newsfeed app with the following entities:
- User
- Post
- Comment
- Like
- Share
- Follow/Friendships
Follow these steps to set up and run the microservice:
- Python >= 3.8
- Docker installed (for mysql db)
- Git installed
-
Clone the repository:
git clone https://github.com/omarnazih/NewFeed.git cd NewFeed
-
Create and Activate virtual environment
python -m venv .venv .\.venv\Scripts\activate
-
Install requirements.txt
pip install -r requirements.txt
-
Build and run the Docker containers to run mysql db:
docker-compose up --build
This will launch the MySQL db. Ensure that your Docker daemon is running.
-
Run Flask service
flask run
-
The microservice should be running at http://localhost:5000. You can now use the provided endpoints.
-
Swagger Documentation should also be available at http://localhost:5000/swagger-ui
-
To stop the containers, press
Ctrl + C
in the terminal where Docker is running, or run:docker-compose down