diff --git a/client/.env b/.env similarity index 53% rename from client/.env rename to .env index b9e10ff..44af0d3 100644 --- a/client/.env +++ b/.env @@ -1,2 +1 @@ -REACT_APP_ENABLE_BUGSNAG=false REACT_APP_API_ENVIRONMENT=PRODUCTION \ No newline at end of file diff --git a/client/.eslintrc.json b/.eslintrc.json similarity index 100% rename from client/.eslintrc.json rename to .eslintrc.json diff --git a/.gitignore b/.gitignore index 24d587a..bd874d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,25 @@ -**/.vscode/ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js +.yarn + +# testing +/coverage + +# production +/build + +# misc .DS_Store -.env -node_modules/ -server/src/config/config.json -server/build/ -server/dist/ -server/src/api/graphql.types.ts - -yarn-error.log \ No newline at end of file +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json \ No newline at end of file diff --git a/.idea/bolt.iml b/.idea/bolt.iml deleted file mode 100644 index d6ebd48..0000000 --- a/.idea/bolt.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml deleted file mode 100644 index c6293fa..0000000 --- a/.idea/dataSources.local.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - " - - - master_key - ballot - - - - - - - - - - \ No newline at end of file diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml deleted file mode 100644 index d623395..0000000 --- a/.idea/dataSources.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - postgresql - true - org.postgresql.Driver - jdbc:postgresql://localhost:5432/bolt - - - \ No newline at end of file diff --git a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60.xml b/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60.xml deleted file mode 100644 index 2b3c2d6..0000000 --- a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60.xml +++ /dev/null @@ -1,783 +0,0 @@ - - - - - 10.11 - 1588292698 - - - 16385 - postgres - - - 40960 - evan - 1625 - 1 - sequence|table|40961|40963|1 -sequence|table|40969|40971|1 -sequence|table|40989|40991|1 -sequence|table|41002|41004|1 -sequence|table|41022|41024|1 -sequence|table|41046|41048|1 - - - - 24578 - evan - - - 24577 - evan - - - 13018 - default administrative connection database - postgres - - - 16384 - 1 - - - 24576 - 1 - 1 - 1 - 1 - - - 3373 - - - 3374 - - - 3375 - - - 4200 - - - 3377 - - - 10 - 1 - 1 - 1 - 1 - 1 - 1 - - - 12728 - 353 - postgres - - - 11 - system catalog schema - 350 - postgres - - - 2200 - standard public schema - 351 - postgres - 1626 - 1 - - - 403 - b-tree index access method - 1 - pg_catalog.bthandler - 330 - index - - - 405 - hash index access method - 1 - pg_catalog.hashhandler - 331 - index - - - 783 - GiST index access method - 1 - pg_catalog.gisthandler - 332 - index - - - 2742 - GIN index access method - 1 - pg_catalog.ginhandler - 333 - index - - - 4000 - SP-GiST index access method - 1 - pg_catalog.spghandler - 334 - index - - - 3580 - block range index (BRIN) access method - 1 - pg_catalog.brinhandler - 335 - index - - - 13004 - PL/pgSQL procedural language - 505 - 1.0 - pg_catalog - 11 - - - - - - - 40989 - 1268 - ballot - 1 - 1 - integer|0s - - - 41002 - 1268 - ballot - 1 - 1 - integer|0s - - - 40961 - 1265 - ballot - 1 - 1 - integer|0s - - - 40969 - 1266 - ballot - 1 - 1 - integer|0s - - - 41046 - 1268 - ballot - 1 - 1 - integer|0s - - - 41022 - 1268 - ballot - 1 - 1 - integer|0s - - - 40991 - ballot - 1268 -
- - 41004 - ballot - 1268 -
- - 40963 - ballot - 1265 -
- - 40971 - ballot - 1266 -
- - 41048 - ballot - 1268 -
- - 41024 - ballot - 1268 -
- - 41083 - ballot - 1269 -
- - 41073 - ballot - 1268 -
- - 40977 - ballot - 1268 -
- - 1 - integer|0s - 1 - 1268 - nextval('categories_category_id_seq'::regclass) - 23 - - - 2 - text|0s - 1 - 1268 - 25 - - - 40998 - 1268 - category_id - 1 - 1 - - - 41000 - 1268 - category_name - 1 - - - 40999 - 1268 - category_id - 1 - categories_pkey - - - 41001 - 1268 - category_name - categories_category_name_unique - - - 1 - integer|0s - 1 - 1268 - nextval('items_item_id_seq'::regclass) - 23 - - - 2 - text|0s - 1 - 1268 - 25 - - - 3 - text|0s - 1 - 1268 - 25 - - - 4 - text|0s - 1 - 1268 - 25 - - - 5 - integer|0s - 1 - 1268 - 23 - - - 6 - integer|0s - 1 - 1268 - 23 - - - 7 - integer|0s - 1 - 1268 - 23 - - - 8 - numeric(6,2 digit)|0s - 1268 - '0'::numeric - 1700 - - - 9 - boolean|0s - 1 - 1268 - false - 16 - - - 10 - boolean|0s - 1 - 1268 - true - 16 - - - 11 - boolean|0s - 1 - 1268 - true - 16 - - - 12 - text|0s - 1 - 1268 - 25 - - - 13 - integer|0s - 1 - 1268 - 1 - 23 - - - 41015 - 1268 - item_id - 1 - 1 - - - 41016 - 1268 - item_id - 1 - items_pkey - - - 41017 - 1268 - category_id - 40991 - 1 - categories - categories_pkey - category_id - - - 41068 - 1268 - location_id - 41048 - 1 - locations - locations_pkey - location_id - - - 1 - integer|0s - 1 - 1265 - nextval('knex_migrations_id_seq'::regclass) - 23 - - - 2 - varchar(255)|0s - 1265 - 1043 - - - 3 - integer|0s - 1265 - 23 - - - 4 - timestamp with time zone|0s - 1265 - 1184 - - - 40967 - 1265 - id - 1 - 1 - - - 40968 - 1265 - id - 1 - knex_migrations_pkey - - - 1 - integer|0s - 1 - 1266 - nextval('knex_migrations_lock_index_seq'::regclass) - 23 - - - 2 - integer|0s - 1266 - 23 - - - 40975 - 1266 - index - 1 - 1 - - - 40976 - 1266 - index - 1 - knex_migrations_lock_pkey - - - 1 - integer|0s - 1 - 1268 - nextval('locations_location_id_seq'::regclass) - 23 - - - 2 - text|0s - 1 - 1268 - 25 - - - 3 - boolean|0s - 1 - 1268 - false - 16 - - - 41056 - 1268 - location_id - 1 - 1 - - - 41058 - 1268 - location_name - 1 - - - 41057 - 1268 - location_id - 1 - locations_pkey - - - 41059 - 1268 - location_name - locations_location_name_unique - - - 1 - integer|0s - 1 - 1268 - nextval('requests_request_id_seq'::regclass) - 23 - - - 2 - integer|0s - 1 - 1268 - 23 - - - 3 - integer|0s - 1 - 1268 - 23 - - - 4 - uuid|0s - 1 - 1268 - 2950 - - - 5 - text|0s - 1268 - 25 - - - 6 - timestamp with time zone|0s - 1 - 1268 - CURRENT_TIMESTAMP - 1184 - - - 7 - timestamp with time zone|0s - 1 - 1268 - CURRENT_TIMESTAMP - 1184 - - - 41034 - 1268 - request_id - 1 - 1 - - - 41035 - 1268 - request_id - 1 - requests_pkey - - - 41036 - 1268 - request_item_id - 41004 - 1 - items - items_pkey - item_id - - - 41041 - 1268 - user_id - 40977 - 1 - users - users_pkey - uuid - - - 41030 - 1268 - status - status = ANY (ARRAY['SUBMITTED'::text, 'APPROVED'::text, 'DENIED'::text, 'ABANDONED'::text, 'CANCELLED'::text, 'READY_FOR_PICKUP'::text, 'FULFILLED'::text, 'RETURNED'::text, 'LOST'::text, 'DAMAGED'::text]) - - - 1 - varchar|0s - 1 - 1269 - 1043 - - - 2 - json|0s - 1 - 1269 - 114 - - - 3 - timestamp(6)|0s - 1 - 1269 - 1114 - - - 41089 - 1269 - sid - 1 - 1 - - - 41090 - 1269 - sid - 1 - session_pkey - - - 1 - text|0s - 1 - 1268 - 25 - - - 2 - text|0s - 1 - 1268 - 25 - - - 41079 - 1268 - name - 1 - - - 41081 - 1268 - name - 1 - 1 - - - 41082 - 1268 - name - 1 - settings_pkey - - - 41080 - 1268 - name - settings_name_unique - - - 1 - uuid|0s - 1 - 1268 - 2950 - - - 2 - varchar(256)|0s - 1268 - 1043 - - - 3 - text|0s - 1 - 1268 - 25 - - - 4 - text|0s - 1 - 1268 - 25 - - - 5 - text|0s - 1 - 1268 - 25 - - - 6 - text|0s - 1 - 1268 - 25 - - - 7 - boolean|0s - 1 - 1268 - false - 16 - - - 8 - boolean|0s - 1 - 1268 - false - 16 - - - 40987 - 1268 - uuid - 1 - 1 - - - 40985 - 1268 - uuid - 1 - - - 40988 - 1268 - uuid - 1 - users_pkey - - - 40986 - 1268 - uuid - users_uuid_unique - -
-
\ No newline at end of file diff --git a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA.meta b/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA.meta deleted file mode 100644 index af3b1d9..0000000 --- a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA.meta +++ /dev/null @@ -1 +0,0 @@ -#n:bolt \ No newline at end of file diff --git a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/information_schema.FNRwLQ.meta b/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/information_schema.FNRwLQ.meta deleted file mode 100644 index 1ff3db2..0000000 --- a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/information_schema.FNRwLQ.meta +++ /dev/null @@ -1,2 +0,0 @@ -#n:information_schema -! [null, 0, null, null, -2147483648, -2147483648] diff --git a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/pg_catalog.0S1ZNQ.meta b/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/pg_catalog.0S1ZNQ.meta deleted file mode 100644 index 44e65b1..0000000 --- a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/pg_catalog.0S1ZNQ.meta +++ /dev/null @@ -1,2 +0,0 @@ -#n:pg_catalog -! [null, 0, null, null, -2147483648, -2147483648] diff --git a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/public.abK9xQ.meta b/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/public.abK9xQ.meta deleted file mode 100644 index 72e9c99..0000000 --- a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/public.abK9xQ.meta +++ /dev/null @@ -1,2 +0,0 @@ -#n:public -! [1626, 0, null, null, -2147483648, -2147483648] diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 70fb766..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index fe90235..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index e980059..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/client.xml b/.idea/runConfigurations/client.xml deleted file mode 100644 index 337341b..0000000 --- a/.idea/runConfigurations/client.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/server.xml b/.idea/runConfigurations/server.xml deleted file mode 100644 index 75b6823..0000000 --- a/.idea/runConfigurations/server.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/sqldialects.xml b/.idea/sqldialects.xml deleted file mode 100644 index 6f2f0a0..0000000 --- a/.idea/sqldialects.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 3a129e9..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 41483fe..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1588292768173 - - - 1588659428429 - - - 1589511505526 - - - 1590463420366 - - - 1590465054997 - - - 1590465715110 - - - 1590547769047 - - - 1593990759178 - - - 1613697948794 - - - 1613698202158 - - - - - - - \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 44f6080..0000000 --- a/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM node:14-alpine - -# Bundle Source -RUN mkdir -p /usr/src/bolt -WORKDIR /usr/src/bolt -COPY . /usr/src/bolt -RUN yarn install - -# Set Timezone to EST -RUN apk add tzdata -ENV TZ="/usr/share/zoneinfo/America/New_York" - -FROM node:14-alpine -COPY --from=0 /usr/src/bolt/server/ /usr/src/bolt/server/ -COPY --from=0 /usr/src/bolt/client/ /usr/src/bolt/client/ -WORKDIR /usr/src/bolt - -EXPOSE 3000 -WORKDIR /usr/src/bolt/server -CMD ["yarn", "start-migrate"] diff --git a/LICENSE.md b/LICENSE.md index 4e5c446..0d567b3 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright 2019 HackGT, Inc. +Copyright 2024 HackGT, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/README.md b/README.md index 93fdd63..cd1c3c4 100644 --- a/README.md +++ b/README.md @@ -1,63 +1,16 @@ # bolt -Simple and efficient hardware checkout system - -# Server setup - -Required items: - -- A postrgesql server and database -- Install dependencies: `yarn install` -- Configure the required environment variables in `configs/config.json`. You can copy and rename `configs/configs.json.example`. -- Run the database migrations using `yarn migrate:dev`. -- Start the server for development with `yarn dev` - -# Client setup - -Note: the hardware desk page (/admin/desk) relies on a WebSocket connection to the server. The client assumes that you are -running the server on port 3000. If this isn't right, then you'll need to update the port in - -1. The `proxy` property in the **client's** package.json file -2. The local development WebSocket URL in `client/index.tsx` -3. `baseUrl` in `client/src/components/admin/AdminOverviewContainer.tsx` - -to use the correct server port. Make sure you don't commit the files with the changed port! +Simple and efficient hardware checkout system. Backed by the +[Hexlabs API](https://github.com/HackGT/api). ## Required environment variables -### Backend - -| Variable | Description | -| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- | -| secrets.adminKey | Random string of letters and numbers | -| secrets.session | Random string of letters and numbers used to secure sessions | -| secrets.groundTruth.url | URL to [Ground Truth](https://github.com/hackgt/ground-truth) authentication service | -| secrets.groundTruth.id | Client ID provided by Ground Truth | -| secrets.groundTruth.secret | Client secret provided by Ground Truth | -| secrets.admins.domains | Email domains that will result in a user being automatically made an admin | -| secrets.admins.emails | Email address that will result in a user being automatically made an admin | -| secrets.server.postgresURL | URL to connect to the postgresql database. If you need to supply database connection credentials, this is the place to do it. | -| secrets.server.isProduction | Boolean indicating whether to run the server in production mode. | -| secrets.server.defaultTimezone | Default server timezone | - ### Frontend -In /client, .env contains defaults for required variables. Create .env.local to override these environment -variables, or define them as temporary environment variables in your shell. - -| Variable | Description | -| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| REACT_APP_ENABLE_BUGSNAG | "true" or "false" whether to enable the Bugsnag integration. Keep disabled for local development unless testing Bugsnag-specific features | -| REACT_APP_BUGSNAG_API_KEY | Required if REACT_APP_ENABLE_BUGSNAG is enabled. Value should be the Notifier API Key for the Bugsnag project | - -# Development - -- For local development: - - Access server endpoints, such as authentication, using the development server. - - For frontend development, run `yarn start` inside the `/client` directory. -- You can find GraphiQL at `/api/graphiql`, but note that this endpoint is restricted to admin users. For local development, - promote your account to an admin in order to access GraphiQL. +| Variable | Description | +| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| REACT_APP_API_ENVIRONMENT | "production" or "development" depending on the environment you want to connect to (local development should be "development") | -## Code Style +## Development -Code style is enforced by eslint, prettier, and stylelint via config. +`yarn start` to run the frontend `yarn build` to build the app for production diff --git a/client/.gitignore b/client/.gitignore deleted file mode 100644 index f40a7a5..0000000 --- a/client/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* -package-lock.json \ No newline at end of file diff --git a/client/README.md b/client/README.md deleted file mode 100644 index 897dc83..0000000 --- a/client/README.md +++ /dev/null @@ -1,44 +0,0 @@ -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -## Available Scripts - -In the project directory, you can run: - -### `npm start` - -Runs the app in the development mode.
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser. - -The page will reload if you make edits.
-You will 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/). diff --git a/client/generate-build-version.js b/client/generate-build-version.js deleted file mode 100644 index b88f2cd..0000000 --- a/client/generate-build-version.js +++ /dev/null @@ -1,18 +0,0 @@ -// From https://dev.to/flexdinesh/cache-busting-a-react-app-22lk -const fs = require('fs'); - -const packageJson = require('./package.json'); - -const {version} = packageJson; -const jsonContent = JSON.stringify({ - version -}); - -fs.writeFile('./public/meta.json', jsonContent, 'utf8', (err) => { - if (err) { - console.log(`An error occured while writing JSON Object to meta.json (version v${version}`); - console.log(err); - } - - console.log(`meta.json file has been saved with latest version number v${version}`); -}); diff --git a/client/package.json b/client/package.json deleted file mode 100644 index b957c6d..0000000 --- a/client/package.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "name": "bolt-client", - "version": "1.3.2", - "private": true, - "dependencies": { - "@apollo/client": "^3.3.14", - "@bugsnag/js": "^7.9.2", - "@bugsnag/plugin-react": "^7.9.2", - "@chakra-ui/icons": "^2.0.9", - "@chakra-ui/react": "^2.3.2", - "@emotion/react": "^11", - "@emotion/styled": "^11", - "@heroicons/react": "^2.0.11", - "@hex-labs/core": "^1.0.51", - "@tanstack/react-query": "^4.3.9", - "@tanstack/react-query-devtools": "^4.3.9", - "@tanstack/react-table": "^8.5.13", - "accounting": "^0.4.1", - "axios": "^0.27.2", - "axios-hooks": "^3.1.5", - "cleave.js": "^1.6.0", - "firebase": "^9.9.4", - "framer-motion": "^6", - "graphql": "^15.5.0", - "graphql-tag": "^2.11.0", - "graphql-tools": "^7.0.4", - "lodash": "^4.17.21", - "react": "^18.2.0", - "react-beautiful-dnd": "^13.1.1", - "react-data-table-component": "^6.11.7", - "react-dom": "^18.2.0", - "react-dropzone": "^14.2.3", - "react-hook-form": "^7.36.0", - "react-redux": "^7.2.3", - "react-router": "^6.3.0", - "react-router-dom": "6.3.0", - "react-scripts": "5.0.1", - "react-slack-feedback": "^2.1.1", - "react-timeago": "^5.2.0", - "react-toast-notifications": "^2.4.3", - "redux": "^4.0.5", - "redux-thunk": "^2.3.0", - "semantic-ui-css": "^2.5.0", - "semantic-ui-react": "^2.1.3", - "stuff-with-good-eyesight": "^1.2.0", - "styled-components": "^5.2.3", - "subscriptions-transport-ws": "^0.9.18", - "typescript": "4.2.4" - }, - "scripts": { - "generate-build-version": "node generate-build-version", - "prebuild": "npm run generate-build-version", - "predeploy": "npm run build", - "deploy": "gh-pages -d build", - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject", - "lint": "eslint src/ --fix; stylelint src/**/*.css --fix; prettier src/ --write", - "postinstall": "semantic-ui-css-patch" - }, - "prettier": "@hex-labs/prettier-config", - "stylelint": { - "extends": "@hex-labs/stylelint-config" - }, - "browserslist": [ - ">0.2%", - "not dead", - "not ie <= 11", - "not op_mini all" - ], - "author": "Evan Strat", - "devDependencies": { - "@hex-labs/eslint-config-react": "^1.1.5", - "@hex-labs/prettier-config": "^1.1.5", - "@hex-labs/stylelint-config": "^1.1.5", - "@semantic-ui-react/css-patch": "^1.1.2", - "@types/accounting": "^0.4.1", - "@types/axios": "^0.14.0", - "@types/cleave.js": "^1.4.4", - "@types/firebase": "^3.2.1", - "@types/jest": "26.0.22", - "@types/lodash": "^4.14.168", - "@types/react": "*", - "@types/react-beautiful-dnd": "^13.1.2", - "@types/react-dom": "18", - "@types/react-redux": "^7.1.16", - "@types/react-router": "^5.1.18", - "@types/react-router-dom": "^5.3.3", - "@types/react-timeago": "^4.1.2", - "@types/semantic-ui": "^2.2.7", - "eslint": "^8.23.1", - "prettier": "^2.2.1", - "redux-devtools": "^3.5.0", - "stylelint": "^13.12.0" - }, - "options": { - "proxy": "http://localhost:3000" - } -} diff --git a/client/src/App.tsx b/client/src/App.tsx deleted file mode 100644 index 6e613cb..0000000 --- a/client/src/App.tsx +++ /dev/null @@ -1,153 +0,0 @@ -import React, { useEffect, useState } from "react"; -import { ToastProvider } from "react-toast-notifications"; -import { BrowserRouter as Router, Route, Routes, Link } from "react-router-dom"; -import { connect } from "react-redux"; -import { useQuery } from "@apollo/client"; -import { initializeApp } from "firebase/app"; -import { setPersistence, getAuth, inMemoryPersistence } from "firebase/auth"; -import axios from "axios"; -import { - AuthProvider, - ErrorScreen, - Footer, - Header, - HeaderItem, - LoadingScreen, - useLogin, -} from "@hex-labs/core"; -import { Box, Container } from "@chakra-ui/react"; -import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; -import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; - -import HomeContainer from "./components/home/HomeContainer"; -import CSVWizard from "./components/admin/csv/CSVWizard"; -import AdminOverviewContainer from "./components/admin/AdminHub"; -import AdminUsersList from "./components/admin/AdminUsersList"; -import AdminRequestSettingsWrapper from "./components/admin/AdminRequestSettingsWrapper"; -import UserProfileWrapper from "./components/userProfile/UserProfileWrapper"; -import DeskContainer from "./components/admin/desk/DeskContainer"; -import { User } from "./types/User"; -import { loginUser } from "./state/Account"; -import { AppState } from "./state/Store"; -import CacheBuster from "./components/util/CacheBuster"; -import DetailedItemStatistics from "./components/admin/reports/statistics/DetailedItemStatistics"; -import ItemDemandReport from "./components/admin/reports/demand/ItemDemandReport"; -import { USER_INFO } from "./graphql/Queries"; -import LoadingSpinner from "./components/util/LoadingSpinner"; -import CreateItemWrapper from "./components/items/CreateItemWrapper"; -import EditItemWrapper from "./components/items/EditItemWrapper"; -import PrivateRoute from "./components/util/PrivateRoute"; -import AxiosProvider from "./axios"; -import Cart from "./components/cart/Cart"; -import HardwareHeader from "./components/home/HardwareHeader"; -import EditRequest from "./components/admin/desk/submitted/EditRequest"; -import ProtectedRoute from "./components/util/ProtectedRoute"; -import LandingPage from "./components/home/LandingPage"; -import UserProfile from "./components/userProfile/UserProfile"; -import CreateCategoryWrapper from "./components/categories/CreateCategoryWrapper"; - -export const app = initializeApp({ - apiKey: "AIzaSyCsukUZtMkI5FD_etGfefO4Sr7fHkZM7Rg", - authDomain: "hexlabs-cloud.firebaseapp.com", -}); - -setPersistence(getAuth(app), inMemoryPersistence); - -axios.defaults.withCredentials = true; - -const queryClient = new QueryClient(); - -export const App: React.FC = () => { - const [loading, loggedIn] = useLogin(app); - - if (loading) { - return ; - } - - if (!loggedIn) { - window.location.href = `https://login.hexlabs.org?redirect=${window.location.href}`; - } - - return ( - - {/* - - - } /> - - - - - - } /> - } /> - {/* } /> - } /> - - - - - - - - - - }> - } /> - } /> - } /> - - } /> - } /> - - }> - } /> - - } /> - - - -