{"id":28240989,"url":"https://github.com/lucs1590/study-microservice","last_synced_at":"2026-05-15T23:06:04.087Z","repository":{"id":292588349,"uuid":"981337157","full_name":"Lucs1590/study-microservice","owner":"Lucs1590","description":"Microservice project using FastAPI, PostgreSQL, Docker and Nginx.","archived":false,"fork":false,"pushed_at":"2025-05-19T00:58:56.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-06T05:07:42.906Z","etag":null,"topics":["api","crud","fastapi","microservices","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lucs1590.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-10T21:53:07.000Z","updated_at":"2025-05-19T01:01:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"ea26595a-7aec-402a-bc24-ecfb1d81ab22","html_url":"https://github.com/Lucs1590/study-microservice","commit_stats":null,"previous_names":["lucs1590/study-microservice"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Lucs1590/study-microservice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucs1590%2Fstudy-microservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucs1590%2Fstudy-microservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucs1590%2Fstudy-microservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucs1590%2Fstudy-microservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lucs1590","download_url":"https://codeload.github.com/Lucs1590/study-microservice/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucs1590%2Fstudy-microservice/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259308157,"owners_count":22837974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","crud","fastapi","microservices","python"],"created_at":"2025-05-19T04:12:44.991Z","updated_at":"2026-05-15T23:05:59.050Z","avatar_url":"https://github.com/Lucs1590.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Microservices\n\nThis repository contains a application that demonstrates the use of microservices architecture. The application is built using Python and FastAPI, and it consists of multiple microservices that communicate with each other using HTTP requests.\nThe application is designed to be modular and scalable, allowing for easy addition of new features and services.\n\n## Microservices\n\nThe application consists of the following microservices:\n\n- `user-microservice`: This microservice is responsible for managing user data and authentication.\n- `people-microservice`: This microservice is responsible for managing people data and providing information about them.\n- `postgres`: This microservice is responsible for managing the database and providing data storage for the application.\n- `nginx`: This microservice is responsible for serving the application and acting as a reverse proxy for the other microservices.\n\n## Prerequisites\n\nBefore running the application, make sure you have the following software installed on your machine:\n\n- Docker: The application is designed to run in a containerized environment using Docker. You can download and install Docker from the official website: [Docker](https://www.docker.com/get-started)\n- Docker Compose: This is a tool for defining and running multi-container Docker applications. It is included with Docker Desktop, so if you have Docker installed, you should already have Docker Compose.\n- Python 3.8 or higher: The application is built using Python and FastAPI, so you will need to have Python installed on your machine. You can download and install Python from the official website: [Python](https://www.python.org/downloads/)\n- PostgreSQL: The application uses PostgreSQL as the database. You can download and install PostgreSQL from the official website: [PostgreSQL](https://www.postgresql.org/download/)\n\n## How to run the application\n\nThe following instructions will guide you through the process of running the application locally.\n\n1. Clone the repository:\n\n   ```bash\n   git clone git@github.com:Lucs1590/study-microservice.git\n   cd study-microservice\n   ```\n\n2. Install the required dependencies:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. Run the `user-microservice`:\n\n   ```bash\n   cd user-microservice\n   uvicorn app.main:app --host 0.0.0.0 --port 8000\n   ```\n\n4. Run the `people-microservice`:\n\n   ```bash\n   cd people-microservice\n   uvicorn app.main:app --host 0.0.0.0 --port 8001\n   ```\n\nAs mentioned earlier, this will run the application locally, and does not mean that you are actually running an application with microservices concepts. To do this, you will need to use Docker to run the application in a containerized environment. The following instructions will guide you through running the application using Docker.\n\n## How to run the application using Docker\n\n1. Make sure you have the pre-requisites installed as mentioned above and the project cloned to your local machine.\n2. Navigate to the root directory of the project:\n\n   ```bash\n   cd study-microservice\n   ```\n\n3. Build the Docker images:\n\n   ```bash\n   docker-compose build\n   ```\n\n4. Start the Docker containers:\n\n   ```bash\n   docker-compose up\n   ```\n\n5. The application will be running on `http://localhost:8000` for the `user-microservice` and `http://localhost:8001` for the `people-microservice`.\n6. You can access the PostgreSQL database using a PostgreSQL client or GUI tool (e.g., pgAdmin) with the following connection details:\n\n   - Host: `localhost`\n   - Port: `5432`\n   - Database: `postgres`\n   - User: `postgres`\n   - Password: `postgres`\n7. To stop the Docker containers, press `Ctrl + C` in the terminal where you started the containers, or run the following command in a separate terminal:\n\n   ```bash\n   docker-compose down\n   ```\n\n### Set .env file\n\nThe application uses environment variables to configure the database connection and other settings. You will need to create a `.env` file in the root directory of the project. You can use the following template for the `.env` file:\n\n```env\nPOSTGRES_USER=postgres\nPOSTGRES_PASSWORD=postgres\nPOSTGRES_DB=postgres\nPOSTGRES_HOST=main_db\nPOSTGRES_PORT=5432\nDATABASE_URL=postgresql://postgres:postgres@main_db:5432/postgres\nUSERS_SERVICE_HOST_URL=http://user_service:8000\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucs1590%2Fstudy-microservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucs1590%2Fstudy-microservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucs1590%2Fstudy-microservice/lists"}