Merge pull request #5 from JBB0807/auth-print-2

Added file for Fly.io and OAuth
This commit is contained in:
JB Balahadia 2025-04-21 18:39:58 -07:00 committed by GitHub
commit f4ee9dad40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 129 additions and 1 deletions

26
.dockerignore Normal file
View file

@ -0,0 +1,26 @@
# flyctl launch added from .gitignore
# Logs
**\logs
**\*.log
**\npm-debug.log*
**\yarn-debug.log*
**\yarn-error.log*
**\pnpm-debug.log*
**\lerna-debug.log*
**\node_modules
**\dist
**\dist-ssr
**\*.local
# Editor directories and files
**\.vscode\*
!**\.vscode\extensions.json
**\.idea
**\.DS_Store
**\*.suo
**\*.ntvs*
**\*.njsproj
**\*.sln
**\*.sw?
fly.toml

18
.github/workflows/fly-deploy.yml vendored Normal file
View file

@ -0,0 +1,18 @@
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
name: Fly Deploy
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
concurrency: deploy-group # optional: ensure only one action runs at a time
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

27
Dockerfile Normal file
View file

@ -0,0 +1,27 @@
# Build Stage
FROM node:18 AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Serve Stage
FROM nginx:stable-alpine
# Copy built React files into nginx public folder
COPY --from=build /app/dist /usr/share/nginx/html
# Remove default nginx config
RUN rm /etc/nginx/conf.d/default.conf
# Add your own nginx config
COPY nginx.conf /etc/nginx/conf.d
# Expose port 80
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

42
fly.toml Normal file
View file

@ -0,0 +1,42 @@
# fly.toml app configuration file generated for bytecamp-web on 2025-04-21T13:40:11-07:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = 'bytecamp-web'
primary_region = 'sea'
[build]
[env]
PORT = '8080'
[http_service]
internal_port = 80
force_https = true
auto_stop_machines = 'stop'
auto_start_machines = true
min_machines_running = 0
processes = ['app']
[[services]]
protocol = 'tcp'
internal_port = 8080
[[services.ports]]
port = 80
handlers = ['http']
[[services.ports]]
port = 443
handlers = ['tls', 'http']
[[services.tcp_checks]]
interval = '10s'
timeout = '2s'
grace_period = '5s'
[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1

11
nginx.conf Normal file
View file

@ -0,0 +1,11 @@
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri /index.html;
}
}

View file

@ -29,12 +29,16 @@ function SignUpForm() {
}
};
const googleAuth = () => {
window.open("https://byte-camp-auth-service.fly.dev/auth/google", "_self");
};
return (
<div className="form-container sign-up-container">
<form onSubmit={handleOnSubmit}>
<h1>Instructor</h1>
<div className="social-container">
<a href="#" className="social">
<a href="#" className="social" onClick={googleAuth}>
<i className="fab fa-google-plus-g" />
</a>
</div>