Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .firebase/hosting.cHVibGlj.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vite.svg,1729203568977,699a02e0e68a579f687d364bbbe7633161244f35af068220aee37b1b33dfb3c7
index.html,1729965737524,8fb99821182b113e53e50787a88f204dace9b4679012ec29663e70cb932dcee0
7 changes: 4 additions & 3 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"projects": {
"default": "digital-woman-technical",
"default": "webapp-e4a61",
"develop": "digital-woman-technical",
"stage": "digital-woman-technical-stage"
"stage": "digital-woman-technical-stage",
"prueba": "webapp-e4a61"
},
"targets": {},
"etags": {}
}
}
20 changes: 20 additions & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge
on:
push:
branches:
- no
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_WEBAPP_E4A61 }}
channelId: live
projectId: webapp-e4a61
21 changes: 21 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
on: pull_request
permissions:
checks: write
contents: read
pull-requests: write
jobs:
build_and_preview:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_WEBAPP_E4A61 }}
projectId: webapp-e4a61
8 changes: 8 additions & 0 deletions dataconnect-generated/js/default-connector/esm/index.esm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { getDataConnect, validateArgs } from 'firebase/data-connect';

export const connectorConfig = {
connector: 'default',
service: 'mujer-digital-technical-test',
location: 'us-central1'
};

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"module"}
9 changes: 9 additions & 0 deletions dataconnect-generated/js/default-connector/index.cjs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { getDataConnect, validateArgs } = require('firebase/data-connect');

const connectorConfig = {
connector: 'default',
service: 'mujer-digital-technical-test',
location: 'us-central1'
};
exports.connectorConfig = connectorConfig;

15 changes: 15 additions & 0 deletions dataconnect-generated/js/default-connector/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { ConnectorConfig, DataConnect } from 'firebase/data-connect';
export const connectorConfig: ConnectorConfig;

export type TimestampString = string;

export type UUIDString = string;

export type Int64String = string;

export type DateString = string;





25 changes: 25 additions & 0 deletions dataconnect-generated/js/default-connector/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "@firebasegen/default-connector",
"version": "1.0.0",
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
"description": "Generated SDK For default",
"license": "Apache-2.0",
"engines": {
"node": " >=18.0"
},
"typings": "index.d.ts",
"module": "esm/index.esm.js",
"main": "index.cjs.js",
"browser": "esm/index.esm.js",
"exports": {
".": {
"types": "./index.d.ts",
"require": "./index.cjs.js",
"default": "./esm/index.esm.js"
},
"./package.json": "./package.json"
},
"peerDependencies": {
"firebase": "^10.14.0"
}
}
6 changes: 6 additions & 0 deletions dataconnect/connector/connector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
connectorId: default
generate:
javascriptSdk:
outputDir: ..\..\dataconnect-generated\js\default-connector
package: "@firebasegen/default-connector"
packageJsonDir: ..\..
50 changes: 50 additions & 0 deletions dataconnect/connector/mutations.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# # Example mutations for a simple movie app

# # Create a movie based on user input
# mutation CreateMovie(
# $title: String!
# $genre: String!
# $imageUrl: String!
# ) @auth(level: USER_EMAIL_VERIFIED) {
# movie_insert(
# data: {
# title: $title
# genre: $genre
# imageUrl: $imageUrl
# }
# )
# }

# # Upsert (update or insert) a user's username based on their auth.uid
# mutation UpsertUser($username: String!) @auth(level: USER) {
# user_upsert(
# data: {
# id_expr: "auth.uid"
# username: $username
# }
# )
# }

# # Add a review for a movie
# mutation AddReview(
# $movieId: UUID!
# $rating: Int!
# $reviewText: String!
# ) @auth(level: USER) {
# review_upsert(
# data: {
# userId_expr: "auth.uid"
# movieId: $movieId
# rating: $rating
# reviewText: $reviewText
# # reviewDate defaults to today in the schema. No need to set it manually.
# }
# )
# }

# # Logged in user can delete their review for a movie
# mutation DeleteReview(
# $movieId: UUID!
# ) @auth(level: USER) {
# review_delete(key: { userId_expr: "auth.uid", movieId: $movieId })
# }
83 changes: 83 additions & 0 deletions dataconnect/connector/queries.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# # Example queries for a simple movie app.

# # @auth() directives control who can call each operation.
# # Anyone should be able to list all movies, so the auth level is set to PUBLIC
# query ListMovies @auth(level: PUBLIC) {
# movies {
# id
# title
# imageUrl
# genre
# }
# }

# # List all users, only admins should be able to list all users, so we use NO_ACCESS
# query ListUsers @auth(level: NO_ACCESS) {
# users { id, username }
# }

# # Logged in user can list all their reviews and movie titles associated with the review
# # Since the query requires the uid of the current authenticated user, the auth level is set to USER
# query ListUserReviews @auth(level: USER) {
# user(key: {id_expr: "auth.uid"}) {
# id
# username
# # <field>_on_<foreign_key_field> makes it easy to grab info from another table
# # Here, we use it to grab all the reviews written by the user.
# reviews: reviews_on_user {
# id
# rating
# reviewDate
# reviewText
# movie {
# id
# title
# }
# }
# }
# }

# # Get movie by id
# query GetMovieById($id: UUID!) @auth(level: PUBLIC) {
# movie(id: $id) {
# id
# title
# imageUrl
# genre
# metadata: movieMetadata_on_movie {
# rating
# releaseYear
# description
# }
# reviews: reviews_on_movie {
# id
# reviewText
# reviewDate
# rating
# user {
# id
# username
# }
# }
# }
# }

# # Search for movies, actors, and reviews
# query SearchMovie(
# $titleInput: String
# $genre: String
# ) @auth(level: PUBLIC) {
# movies(
# where: {
# _and: [
# { genre: { eq: $genre } }
# { title: { contains: $titleInput } }
# ]
# }
# ) {
# id
# title
# genre
# imageUrl
# }
# }
12 changes: 12 additions & 0 deletions dataconnect/dataconnect.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
specVersion: "v1beta"
serviceId: "mujer-digital-technical-test"
location: "us-central1"
schema:
source: "./schema"
datasource:
postgresql:
database: "fdcdb"
cloudSql:
instanceId: "mujer-digital-technical-test-fdc"
# schemaValidation: "COMPATIBLE"
connectorDirs: ["./connector"]
45 changes: 45 additions & 0 deletions dataconnect/schema/schema.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# # Example schema for simple movie review app

# # Users
# # Suppose a user can leave reviews for movies
# # user -> reviews is a one to many relationship,
# # movie -> reviews is a one to many relationship
# # movie <-> user is a many to many relationship
# type User @table {
# id: String! @col(name: "user_auth")
# username: String! @col(name: "username", dataType: "varchar(50)")
# # The following are generated by the user: User! field in the Review table
# # reviews_on_user
# # movies_via_Review
# }

# # Movies
# type Movie @table {
# # The below parameter values are generated by default with @table, and can be edited manually.
# # implies directive `@col(name: "movie_id")`, generating a column name
# id: UUID! @default(expr: "uuidV4()")
# title: String!
# imageUrl: String!
# genre: String
# }

# # Movie Metadata
# # Movie - MovieMetadata is a one-to-one relationship
# type MovieMetadata @table {
# # @unique indicates a 1-1 relationship
# movie: Movie! @unique
# # movieId: UUID <- this is created by the above reference
# rating: Float
# releaseYear: Int
# description: String
# }

# # Reviews
# type Review @table(name: "Reviews", key: ["movie", "user"]) {
# id: UUID! @default(expr: "uuidV4()")
# user: User!
# movie: Movie!
# rating: Int
# reviewText: String
# reviewDate: Date! @default(expr: "request.time")
# }
9 changes: 9 additions & 0 deletions filesystem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { copyFile } from 'node:fs';

copyFile('.env.example', '.env', (err) => {

if(err) throw err;

console.log('Archivo copiado exitosamente');

});
14 changes: 10 additions & 4 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,23 @@
}
],
"hosting": {
"source": ".",
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"frameworksBackend": {
"region": "us-central1"
}
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
"storage": {
"rules": "storage.rules"
},
"dataconnect": {
"source": "dataconnect"
}
}
2 changes: 1 addition & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": "https://webapp-e4a61.web.app/",
"paths": {
"@/*": [
"./src/*"
Expand Down
Loading