Auth firebase #1
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TIPO DE PULL REQUEST
Indique si el pull request es:
DESCRIPCIÓN DEL CAMBIO
This pull request includes significant changes to the backend system, focusing on setting up environment variables, configuring the database, and implementing authentication and transaction handling. The most important changes include adding environment variables, configuring the database with Sequelize, and creating controllers, services, and repositories for authentication and transaction management.
Environment Configuration:
back/.env.example
: Added environment variables for database and Firebase configuration.front/.env.example
: Added environment variables for Firebase configuration.Database Configuration:
back/src/infrastructure/database/config.ts
: Added Sequelize configuration for connecting to the PostgreSQL database.back/src/infrastructure/database/models/AccountModel.ts
: Defined theAccountModel
and its relations.back/src/infrastructure/database/models/TransactionModel.ts
: Defined theTransactionModel
and its relations.back/src/infrastructure/database/models/UserModel.ts
: Defined theUserModel
and its relations.back/src/infrastructure/database/models/index.ts
: Initialized all models and defined their relations.Authentication and Authorization:
back/src/controllers/authController.ts
: CreatedAuthController
to handle user sessions.back/src/middlewares/authMiddleware.ts
: Added middleware for authenticating users using Firebase tokens.back/src/services/authService.ts
: ImplementedAuthService
to verify tokens and handle authenticated users.Transaction Management:
back/src/controllers/transactionController.ts
: CreatedTransactionController
to handle transaction creation and retrieval.back/src/infrastructure/repositories/transactionRepository.ts
: ImplementedTransactionRepository
for database operations related to transactions.back/src/services/transactionService.ts
: AddedTransactionService
to encapsulate business logic for transactions.Other Changes:
back/package.json
: Added dependencies fordotenv
,firebase-admin
,pg
, andsequelize
.back/src/app.ts
: CreatedApp
class to initialize the Express application with Firebase, middlewares, routes, and database.back/src/index.ts
: Refactored to use the newApp
class and load environment variables.front/package.json
: Added dependencies foraxios
,firebase
, andreact-router-dom
.