Skip to content

Repository files navigation

Api Rest Mutants AWS Core Python FastApi

GitHub

This project aims to assist Professor Charles Xavier in identifying mutants based on their DNA sequences, in order to recruit them for his school to combat the Sentinels. The API detects whether a person is a mutant by analyzing their DNA sequence.

License: MIT

Built With

  • Programming Language: Python
  • Cloud Services:
    • AWS Lambda
    • AWS EventBridge
    • AWS API Gateway
  • Database: MongoDB Atlas

Getting Started

Prerequisites

1. Deploy an EventBridge Service and Create a Rule:

Go to the AWS Management Console and navigate to the "EventBridge" service. If you haven't created an event bus yet, you can create a new one. Next, create a new rule. Configure the event pattern with the following JSON: json

{
  "source": [
    "my-application"
  ],
  "detail-type": [
    "mutant-detected"
  ]
}

Define the target action of the rule as a Lambda function that will process the events.

2. Create a Lambda Function:

Go to the AWS Management Console and search for the "Lambda" service. Create a new Lambda function. Use the code found in the lambda_function folder of your repository as the source code for the Lambda function. This code should capture the event it receives from EventBridge and send it to the MongoDB Cloud database.

🛠️ Setup

  1. Clone the repository:
git clone https://github.com/ccasllo/mutantes.git
cd mutantes
  1. Install Python Virtual Environment:
python3 -m venv venv
  1. Activate the Virtual Environment:
source venv/bin/activate
  1. Install Required Packages:
pip install -r requirements.txt
  1. configure variables. Create a file named .env and add the necessary variables following the format provided in example.env
.env

and excute .env

export $(cat .env)
  1. execute
uvicorn config.main:app --reload

Usage

Run Unit Tests:

  1. Assign Execution Permissions to the Script:
    chmod +x execute_test.sh
  2. Execute the Unit Tests:
    sh execute_test.sh

Contact

Carlos Castillo Project Link: https://github.com/ccasllo/mutantes.git

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages