Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
96fbd4f
fixed homlg acc id in CD
lseixas Sep 6, 2025
ac05461
removing cloudwatch logs to allow deploy
lseixas Sep 9, 2025
e62b0d0
updating extractor lambda
lseixas Sep 9, 2025
67871c3
finished lambda handler to correctly extract data
lseixas Sep 9, 2025
bd04509
attempting json creation
lseixas Sep 11, 2025
8b65a46
fixing variable name, adding put object permission
lseixas Sep 11, 2025
e78a3e3
updating output bucket, adding permissions to lambda
lseixas Sep 11, 2025
d637c47
feat: added genetic_algorithm module, boletim_ga & genetic_algorithm_…
ThomassBoehm Jan 14, 2026
91649e4
feat: genetic_algorithm_usecase done
ThomassBoehm Jan 20, 2026
d61fefb
feat: completed genetic algorithm viewmodel
ThomassBoehm Jan 27, 2026
e477f62
feat: added tests, not working yet
ThomassBoehm Jan 28, 2026
67cc385
fix: correcting tests
ThomassBoehm Jan 30, 2026
c9c7894
fix: tests corrected
ThomassBoehm Jan 31, 2026
ceafd6f
feat: boletim_ga test added
ThomassBoehm Jan 31, 2026
1b3dae3
adding libraris to requirements-dev
lseixas Feb 3, 2026
38fbe6f
fix: removed 'max_grade', 'population_size', and 'generations' valid…
ThomassBoehm Feb 25, 2026
7219bc3
fix: correction of request validations in src\modules\genetic_algorit…
ThomassBoehm Feb 25, 2026
27ba67d
fix: modified population parameter
ThomassBoehm Feb 25, 2026
f940633
fix: modified genetic_algorithm viewmodel and genetic_algorithm usecase
ThomassBoehm Feb 27, 2026
81d3baf
deleted unnecessary parameter on GeneticAlgorithmViewmodel
ThomassBoehm Feb 27, 2026
7f7454d
fix: tests updated
ThomassBoehm Mar 10, 2026
b3e9902
fix: modified GA viewmodel's output
ThomassBoehm Mar 24, 2026
d56f4f4
fix: altered tests
ThomassBoehm Mar 24, 2026
0c77f74
fixed test fetching for old GA keys
lseixas Mar 25, 2026
a22108d
refactoring iac, removed special treatment for contact_us lambda, cha…
lseixas Mar 26, 2026
34a5b2a
added ssm construct for better environment variables setup, fixed iac…
lseixas Mar 26, 2026
cb4fd18
updated CI/CD python versions
lseixas Mar 26, 2026
f47b011
fixing CD, fixing bucket name, fixing key syntax
lseixas Mar 26, 2026
1ce1719
fixing typo
lseixas Mar 26, 2026
241580a
fixing typo 2
lseixas Mar 26, 2026
5f25a6a
Merge pull request #70 from Maua-Dev/feat/Genetic-Algorythm
lseixas Mar 26, 2026
29e3f75
fixed relative imports
lseixas Mar 26, 2026
a5f5e8a
fixing typo 3
lseixas Mar 26, 2026
e24377e
fixed bucket name
lseixas Mar 26, 2026
db4edd0
fixing api url in ssm
lseixas Mar 26, 2026
a6a213f
upgraded s3 construct to use new Distribution API
lseixas Mar 26, 2026
5ab6826
stage lower conversion in ssm
lseixas Mar 26, 2026
8c44090
removed cdn plans as its not used
lseixas Mar 26, 2026
5b41cca
more improvments to infra qol
lseixas Apr 8, 2026
2edaa26
fixing typo enum in lambda version
lseixas Apr 8, 2026
fc07c4d
renaming buckets and re-running cd after deleting ssm parameters for …
lseixas Apr 8, 2026
15a5df2
removed unused state enum, added curso and disciplina entities. added…
lseixas May 2, 2026
96896bb
added mock and interface to disciplina and curso
lseixas May 2, 2026
4bea4d0
added dynamo local and table name to environments
lseixas May 2, 2026
54d7f20
added populate dynamo scripts, wrote to README
lseixas May 2, 2026
60d5bc0
added dynamo repo for both entities, added new auxiliary classes for …
lseixas May 2, 2026
29ed403
removing ghost file
lseixas May 2, 2026
b698fe5
changes to table naming, added dynamo construct
lseixas May 2, 2026
70e2106
added experimental plans extractor, reformulated requirements as laye…
lseixas May 2, 2026
dd19314
ading get repo to environemnts
lseixas May 2, 2026
58593fb
removing key name limitation
lseixas May 2, 2026
0661d21
changing to active agent
lseixas May 2, 2026
2866375
attempting to fix key lookup during download
lseixas May 2, 2026
b1b5d7a
fixed bedrock permission
lseixas May 3, 2026
75ea65c
attempting to fix key on s3 access
lseixas May 3, 2026
4e0868d
fixed bedrock client json parsing with md outbounds, granted dynamo p…
lseixas May 3, 2026
005082e
reformulated logic when extracting course, fixed weight parameters type
lseixas May 3, 2026
3c605c5
fixing updated logic to fetch for other fields instead of courses only
lseixas May 3, 2026
22755a2
enchacing prompt with exam distribution, changed parser to capitalize…
lseixas May 3, 2026
a0a11fe
increased lambda timeout
lseixas May 3, 2026
4661e36
feat: add course extractor
Matelz May 4, 2026
e156219
added get all disciplinas for frontend testing
lseixas May 4, 2026
d44667c
fixing environments tag importing dynamo during CI
lseixas May 4, 2026
c2f851a
fixing handler path on new logic in lambda construct
lseixas May 4, 2026
15d2028
fixing external interface to output correct json
lseixas May 4, 2026
43f53fd
feat: enhance course extraction logic and improve S3 processing
Matelz May 17, 2026
160c291
routing plans extractor on presenter, added dynamo external adapters …
lseixas May 19, 2026
58cb1b6
fixing imports and tests
lseixas May 19, 2026
b84e3e8
Merge pull request #73 from Maua-Dev/feat/lambda-course-extractor-int…
lseixas May 19, 2026
629dd7d
removed unused files, fixed parser, changed to nova lite
lseixas May 19, 2026
aca381c
Merge pull request #74 from Maua-Dev/feat/lambda-course-extractor-int…
lseixas May 19, 2026
c7de402
increasing lambda memory size
lseixas May 19, 2026
98ddbcb
experimental: improved parser and course extractor, added tests for u…
lseixas May 20, 2026
c52e6a1
removing boto3 client from CI - turning tests as local as possivel
lseixas May 20, 2026
da49c73
removed course extractor tests for now
lseixas May 20, 2026
ed3bcad
Harden plans extractor parsing fallbacks.
lseixas May 20, 2026
29a0a8b
adding rule to remove provas e trabalhos subs, added rule for 3 decim…
lseixas May 21, 2026
14d2229
update GA frontend rounding to Maua rules and increase lambda memory
lseixas May 21, 2026
31c92b4
added curso functions to replace s3 json
lseixas May 21, 2026
7d50377
adding .cursor to gitignore
lseixas May 23, 2026
713fc2a
added api key security to create course endpoint
lseixas May 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Python 3.9
- name: Setup Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.13'

- name: Set AWS Account ID and other variables
run: |
if [[ "${{ github.ref_name }}" == "dev" ]]; then
echo "AWS_ACCOUNT_ID=${{ secrets.AWS_ACCOUNT_ID_DEV }}" >> $GITHUB_ENV
elif [[ "${{ github.ref_name }}" == "homolog" ]]; then
echo "AWS_ACCOUNT_ID=${{ secrets.AWS_ACCOUNT_ID_HOMOLOG }}" >> $GITHUB_ENV
echo "AWS_ACCOUNT_ID=${{ secrets.AWS_ACCOUNT_ID_HOML }}" >> $GITHUB_ENV
elif [[ "${{ github.ref_name }}" == "prod" ]]; then
echo "AWS_ACCOUNT_ID=${{ secrets.AWS_ACCOUNT_ID_PROD }}" >> $GITHUB_ENV
else
Expand All @@ -51,7 +51,7 @@ jobs:
run: |
npm install -g aws-cdk
cd iac
pip install -r requirements.txt
pip install -r requirements-infra.txt

- name: DeployWithCDK
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
- name: Set up Python 3.13
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: 3.13
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -r requirements-app.txt -r requirements-dev.txt
- name: Runs tests
run: pytest
env:
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,10 @@ dmypy.json
/.vscode/
/.idea/
/iac/lambda_layer_out_temp/

.DS_Store
**/.DS_Store

/docs
/PLANOS DE ENSINO 2026
.cursor
2 changes: 1 addition & 1 deletion iac/adjust_layer_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# --- Configurações ---
BUILD_DIRECTORY = "build"
PYTHON_TOP_LEVEL_DIR = os.path.join(BUILD_DIRECTORY, "python")
REQUIREMENTS_FILE = "requirements-layer.txt"
REQUIREMENTS_FILE = "requirements-app.txt"

# --- CONSTRUÇÃO CORRETA DO CAMINHO ---
# Pega o diretório do projeto (a raiz 'dev_medias_back') subindo um nível a partir do script atual.
Expand Down
31 changes: 15 additions & 16 deletions iac/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import aws_cdk as cdk

from adjust_layer_directory import adjust_layer_directory
from iac.iac_stack import IacStack
from stack.iac_stack import IacStack

print("Starting the CDK")

Expand All @@ -19,27 +19,26 @@
aws_account_id = os.environ.get("AWS_ACCOUNT_ID")
stack_name = os.environ.get("STACK_NAME")

github_ref_name = os.environ.get("GITHUB_REF_NAME")

if 'prod' == github_ref_name:
stage = 'PROD'

elif 'homolog' == github_ref_name:
stage = 'HOMOLOG'

elif 'dev' == github_ref_name:
stage = 'DEV'

else:
stage = 'TEST'
stage = os.environ.get("GITHUB_REF_NAME").capitalize()
stack_name = os.environ.get("STACK_NAME")

tags = {
'project': 'DevMedias',
'stage': stage,
'stack': 'BACK',
'stack': stack_name,
'owner': 'DevCommunity',
}

IacStack(app, stack_name, env=cdk.Environment(account=aws_account_id, region=aws_region), tags=tags)
IacStack(
app,
stack_id=stack_name,
stack_name=stack_name,
stage=stage,
env=cdk.Environment(
account=aws_account_id,
region=aws_region
),
tags=tags
)

app.synth()
52 changes: 52 additions & 0 deletions iac/components/apigw_construct.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from aws_cdk import aws_apigateway as apigateway
from constructs import Construct
from aws_cdk.aws_apigateway import RestApi, Cors, CorsOptions

class ApigwConstruct(Construct):
rest_api: RestApi

def __init__(self, scope: Construct, construct_id: str, stage: str, **kwargs):
super().__init__(scope, construct_id, **kwargs)

self.stage = stage

cors_options = CorsOptions(
allow_origins=Cors.ALL_ORIGINS,
allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"],
allow_headers=Cors.DEFAULT_HEADERS
)

self.rest_api = RestApi(
self,
id=f"DevMedias_RestApi_{self.stage}",
rest_api_name=f"DevMedias_RestApi_{self.stage}",
description=f"This is the DevMedias RestApi for {self.stage}",
deploy_options=apigateway.StageOptions(
stage_name=stage.lower(),
logging_level=apigateway.MethodLoggingLevel.OFF,
data_trace_enabled=False,
metrics_enabled=True,
),
default_cors_preflight_options=cors_options,
)

# implementação de uma key para mínima proteção de rotas abertas como create_curso

api_key = self.rest_api.add_api_key(
id="AdminApiKey",
api_key_name="admin-key"
)

plan = self.rest_api.add_usage_plan("UsagePlan",
name="AdminPlan",
api_stages=[apigateway.UsagePlanPerApiStage(
api=self.rest_api,
stage=self.rest_api.deployment_stage,
)]
)
plan.add_api_key(api_key)

self.api_gateway_resource = self.rest_api.root.add_resource(
path_part="mss-medias",
default_cors_preflight_options=cors_options
)
51 changes: 51 additions & 0 deletions iac/components/dynamo_construct.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from aws_cdk import (
RemovalPolicy,
aws_dynamodb as dynamodb,
)
from constructs import Construct

# Manter alinhado com src.shared.infra.external.dynamo.academic_catalog_naming.ACADEMIC_CATALOG_TABLE_PREFIX
_ACADEMIC_CATALOG_PREFIX = "DevMediasAcademicCatalogTable"

RETAINED_STAGES = {"prod", "homolog"}


class DynamoConstruct(Construct):
"""Tabela single-table (pk + sk) para cursos e disciplinas."""

academic_catalog_table: dynamodb.Table

def __init__(
self,
scope: Construct,
construct_id: str,
stack_name: str,
stage: str,
**kwargs,
) -> None:
super().__init__(scope, construct_id, **kwargs)

stage_lower = stage.lower()

removal_policy = (
RemovalPolicy.RETAIN if stage_lower in RETAINED_STAGES else RemovalPolicy.DESTROY
)

self.academic_catalog_table = dynamodb.Table(
self,
id="AcademicCatalogTable",
partition_key=dynamodb.Attribute(
name="pk",
type=dynamodb.AttributeType.STRING,
),
sort_key=dynamodb.Attribute(
name="sk",
type=dynamodb.AttributeType.STRING,
),
billing_mode=dynamodb.BillingMode.PAY_PER_REQUEST,
removal_policy=removal_policy,
table_name=f"{_ACADEMIC_CATALOG_PREFIX}-{stage_lower}",
point_in_time_recovery_specification=dynamodb.PointInTimeRecoverySpecification(
point_in_time_recovery_enabled=(stage_lower == "prod")
),
)
Loading
Loading