-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from sennav/main
Add docker to all components.
- Loading branch information
Showing
12 changed files
with
1,663 additions
and
1,485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Build stage | ||
FROM node:latest AS builder | ||
|
||
WORKDIR /app | ||
COPY ./ . | ||
|
||
RUN corepack enable | ||
RUN yarn install | ||
RUN yarn build | ||
|
||
# Nginx stage | ||
FROM nginx:latest | ||
|
||
# Set the working directory for Nginx | ||
WORKDIR /app | ||
|
||
# Copy the build output from the builder stage to Nginx's default directory | ||
COPY --from=builder /app/dist /usr/share/nginx/html | ||
|
||
RUN mkdir /usr/share/nginx/html/snippy | ||
RUN mv /usr/share/nginx/html/assets /usr/share/nginx/html/snippy/assets | ||
|
||
# Optionally copy a custom Nginx config (if you have one) | ||
COPY ./nginx.conf /etc/nginx/nginx.conf | ||
|
||
# Expose port 80 to access the app | ||
EXPOSE 80 | ||
|
||
# Nginx will automatically serve the content | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,15 @@ | ||
# Getting Started with Create React App | ||
# Client application | ||
|
||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). | ||
Useful commands: | ||
|
||
## Available Scripts | ||
```sh | ||
yarn start | ||
yarn build | ||
yarn lint | ||
yarn lint-fix | ||
yarn deploy | ||
``` | ||
|
||
In the project directory, you can run: | ||
## Running locally | ||
|
||
### `npm start` | ||
|
||
Runs the app in the development mode.\ | ||
Open [http://localhost:3000](http://localhost:3000) to view it in your browser. | ||
|
||
The page will reload when you make changes.\ | ||
You may also see any lint errors in the console. | ||
|
||
### `npm test` | ||
|
||
Launches the test runner in the interactive watch mode.\ | ||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. | ||
|
||
### `npm run build` | ||
|
||
Builds the app for production to the `build` folder.\ | ||
It correctly bundles React in production mode and optimizes the build for the best performance. | ||
|
||
The build is minified and the filenames include the hashes.\ | ||
Your app is ready to be deployed! | ||
|
||
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. | ||
|
||
### `npm run eject` | ||
|
||
**Note: this is a one-way operation. Once you `eject`, you can't go back!** | ||
|
||
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. | ||
|
||
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. | ||
|
||
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. | ||
|
||
## Learn More | ||
|
||
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). | ||
|
||
To learn React, check out the [React documentation](https://reactjs.org/). | ||
|
||
### Code Splitting | ||
|
||
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) | ||
|
||
### Analyzing the Bundle Size | ||
|
||
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) | ||
|
||
### Making a Progressive Web App | ||
|
||
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) | ||
|
||
### Advanced Configuration | ||
|
||
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) | ||
|
||
### Deployment | ||
|
||
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) | ||
|
||
### `npm run build` fails to minify | ||
|
||
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) | ||
Either run `yarn start` or use the container instructions on the main README. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# The "events" section is required by Nginx | ||
events { | ||
worker_connections 1024; # Maximum number of simultaneous connections | ||
} | ||
|
||
http { | ||
# Basic HTTP setup | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
upstream backend { | ||
server wasi-runner:3001; | ||
} | ||
|
||
server { | ||
listen 80; | ||
|
||
# Serve static files from /usr/share/nginx/html | ||
root /usr/share/nginx/html; | ||
|
||
# Default index file | ||
index index.html; | ||
|
||
# Redirect any request to / to index.html (for SPA routing) | ||
location / { | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
# Proxy requests to /api to wasi-runner:3000 | ||
location /api/ { | ||
proxy_pass http://backend; | ||
|
||
# WebSocket headers | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
|
||
# Preserve host and real IP headers | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
|
||
# Optional timeout settings for WebSockets | ||
proxy_read_timeout 3600s; | ||
proxy_send_timeout 3600s; | ||
} | ||
|
||
# Optional: Add headers to cache static assets for better performance | ||
location ~* \.(?:css|js|html|svg|woff2?|ttf|eot)$ { | ||
try_files $uri =404; | ||
add_header Cache-Control "public, max-age=31536000, immutable"; | ||
} | ||
|
||
# Optional: Handle 404 errors gracefully | ||
error_page 404 /index.html; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
"dependencies": { | ||
"@emotion/react": "^11.11.1", | ||
"@emotion/styled": "^11.11.0", | ||
"@g-loot/react-tournament-brackets": "^1.0.30", | ||
"@mui/icons-material": "^5.14.18", | ||
"@mui/material": "^5.14.18", | ||
"@types/jest": "^29.5.8", | ||
|
@@ -17,7 +16,9 @@ | |
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-router-dom": "^6.19.0", | ||
"styled-components": "^6.1.1", | ||
"react-svg-pan-zoom": "^3.13.1", | ||
"react-tournament-brackets": "^1.0.40", | ||
"styled-components": "^6.1.14", | ||
"typescript": "^5.2.2", | ||
"web-vitals": "^2.1.4" | ||
}, | ||
|
@@ -42,5 +43,10 @@ | |
"prettier": "^3.1.0", | ||
"vite": "^5.0.0" | ||
}, | ||
"packageManager": "[email protected]" | ||
"packageManager": "[email protected]", | ||
"overrides": { | ||
"react-tournament-brackets": { | ||
"styled-components": "$styled-components" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.