Skip to content

feature: Connect api with frontend#75

Merged
sporestudio merged 6 commits intodevfrom
feature/connect-api-with-frontend
May 31, 2025
Merged

feature: Connect api with frontend#75
sporestudio merged 6 commits intodevfrom
feature/connect-api-with-frontend

Conversation

@sporestudio
Copy link
Copy Markdown
Owner

Following changes were made:

  • Add new method on redis service to get all the files associated to an user id.
  • Create a new endpoint which user will be able to list his stored files.
  • Create several functions in the dashboard page to handle uploading, downloading and file listing.
  • Adapt config to work on local environment

Note

Notes:

  • The logic to handle file behavior will be separated from the dashboard page in the future.
  • "user_id" is hardcoded actually, we will need to manage this.
  • The config for docker connection will change when domain have been configured..

Implement a method to get all the files that the user has stored in the
S3 bucket based on his user id.
Create a endpoint to list the files that the user has stored.
Create several function to handle logic for upload, download and list
files in the frontend, this logic will be separate from the page in the
future.
@sporestudio sporestudio requested a review from jvicg May 31, 2025 14:50
@sporestudio sporestudio self-assigned this May 31, 2025
@sporestudio sporestudio added the feature New functionality implementation label May 31, 2025
@sporestudio sporestudio merged commit 8ab3ae9 into dev May 31, 2025
3 checks passed
@sporestudio sporestudio deleted the feature/connect-api-with-frontend branch May 31, 2025 14:57
sporestudio added a commit that referenced this pull request Jun 2, 2025
* merge: Resolve commit conflicts (#50)

* refactor: discard Rust use

Discard Rust for the cryptography lib for the project.

* chore: modify .gitignore

Avoid python virtual environment.

* feat: create new crypto lib in python

Start the new library for managing the logic related to all the cipher
service for the backend.

* chore: add app requirements

Add the requirements for the python app

* chore: delete unnecessary files

---------

Co-authored-by: jorgerodriguez-palisis <jorge.rodriguez@palisis.com>
Co-authored-by: jcorreag <jcorreag@pm.me>

* feature: Create login (#51)

* refactor: Move assets to public directory

* style: Add hiddenbox logo

Add hiddenbox logo to public directory.

* refactor: Correct typo errors

* refactor: Exclude navigation in login page

* feat: Create photo component

Create a component to show photos.

* feat: add photo component in login page

* refactor: Fix login (#52)

Avoid some unused values. I don't delete it because we will need it on
future, so for the moment it will be commented.

* refactor: Improve directory structure (#54)

* chore: Resolve merge conflicts

Avoid python virtual environment.

* refactor: Improve directory structure

All the project directory structure has been refactorized to follow an
standard an to be easier to understand.

* chore: Remove app directory

* chore: Change services name

* refactor: Rename file and correct path (#58)

Set realative path on the import to make it works on the docker
container.

* Refactor: dashboard styles (#59)

* style: Fix header styles

Set the header background color transparent when is scrolled.

* style: Adjust header margins

Add more margin in left and right in the header component..

* style: Fix styles for dashboard

- Create styles for upload files and logout buttons.
- Establish colors for files icons.
- Create hovers for buttons.

* refactor: Modified classes for footer

* refactor: Move encrypted statement

Move encrypted statement to my files title to make it more general.

* feature: Deploy s3 buckets (#64)

* chore: Add project name variable

* refactor: Add s3 bucket to infra

Add s3 to store fragments.

* feature: Create db service (#65)

* feature: Create db service into compose

Create PostgreSQL service into docker compose to be able to store file
fragment metadata.

* feature: Deploy s3 buckets (#64)

* chore: Add project name variable

* refactor: Add s3 bucket to infra

Add s3 to store fragments.

* chore: add db data volume to compose

---------

Co-authored-by: jorgerodriguez-palisis <jorge.rodriguez@palisis.com>

* docs: Update readme (#66)

* docs: Add contributing and images

* docs: Update README.md

Update main readme.

* fix: Solve paths errors on api (#67)

Change redis for redis_service to solve paths problems into API.

* feature: Terraform dynamic files (#68)

* feat: Add dynamic files generation in main.tf

Generate ansible inventory and ansible configuration in a dynamic way
with terraform local file resource.

* chore: Add necessary terraform global vars

Add variables for user, templates path and credentials path.

* feat: Add ansible cfg template

Add template to generate ansible.cfg in a dynamic way.

* refactor: Modify inventory template

Generate ansible inventory in a dynamic way.

* refactor: Change ansible inventory path

* fix: Correct key path

* feature: Implement s3 service (#69)

* chore: Install boto3 library

Install requirements for use boto3 library that allow us to comunicate
with the s3 bucket.

* feat: Implement s3 service

Basic service to put and get objects into s3 bucket. Should check if
credentials are needed to establish connection with the s3 bucket.

* feat: Implement s3 service into api

Integrate new s3 service with the API. Redis is still using yet to store
files' metadata and index of fragments. As soon as possible we should
implement database store method.

* feat: Integrate s3 service into API

Create singleton to access s3 service and implement different methods
for store and get fragments from s3 bucket.

* fix: Fix lint error

* refactor: Set props as private and change key format

- Set bucket and s3 property as private so anybody can use outside the
  object.
- Change format key for a cleaner format.

* refactor: Change s3 class name in api

Readapt the api to the new class name of the s3 service.

* refactor: Avoid hardcoded names

Pass s3 bucket name as an env variable.

* refactor: Pass user id to s3 service

* feature: Terraform dynamic files (#68)

* feat: Add dynamic files generation in main.tf

Generate ansible inventory and ansible configuration in a dynamic way
with terraform local file resource.

* chore: Add necessary terraform global vars

Add variables for user, templates path and credentials path.

* feat: Add ansible cfg template

Add template to generate ansible.cfg in a dynamic way.

* refactor: Modify inventory template

Generate ansible inventory in a dynamic way.

* refactor: Change ansible inventory path

* fix: Correct key path

* chore: Add custom exceptions

Create custom exceptions for s3 service to handle errors.

* refactor: Handle errors in s3 service

Implement custom exceptions in s3 service and handle errors with the
bucket name.

* fix: Fix linter errors

---------

Co-authored-by: jorgerodriguez-palisis <jorge.rodriguez@palisis.com>

* fix: Fix argument passed to hgetall method (#71)

Fix the name of the argument passed to the method that get metadata from
redis.

* fix: Solve download logic on api (#72)

* chore: Add filename param to EncryptedRespomse

Add parameter to contemplate filname in EncryptedRespomse object.

* fix: Solve download logic problem

- Add exceptions for handle errors when try to obtain metadata and
fragments index.
- Pass key to fernet.
- Return correct filename.

* fix: Solve bugs infra (#73)

* chore: Pass aws environmental variables

Pass aws credentials as an envs variables

* fix: Solve variables problem

Fix problem with path module variable, making a local variable to use
it.

* fix: Modify nginx configuration (#74)

Modify nginx proxy pass direction since we changed the container name to
api.

* feature: Connect api with frontend (#75)

* chore: Install axios in frontend

* chore: Change config to work in local.

* feat: Implement get file method

Implement a method to get all the files that the user has stored in the
S3 bucket based on his user id.

* feat: Create list files endpoint

Create a endpoint to list the files that the user has stored.

* feat: Modify frontend to integrate API

Create several function to handle logic for upload, download and list
files in the frontend, this logic will be separate from the page in the
future.

* fix: Correct linter errors

* feature: Implement certbot (#76)

* chore: Avoid keys

* feat: Implement dyndns config

- Add Makefile to automate certbot.
- Add cronjob to update IP address.

* feat: Add dyndns service to compose

---------

Co-authored-by: jorgerodriguez-palisis <jorge.rodriguez@palisis.com>
Co-authored-by: jcorreag <jcorreag@pm.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New functionality implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant