From 4c43dca047019e327dca3f729ea921c2ef9f4022 Mon Sep 17 00:00:00 2001 From: oblionC Date: Thu, 1 Jun 2023 20:47:14 +0530 Subject: [PATCH 1/3] Complete assignment --- backend/.gitignore | 7 + backend/build/config.gypi | 409 +++++++ backend/build/node_gyp_bins/python3 | 1 + backend/index.js | 313 +++++ {server => backend}/package-lock.json | 1058 ++++++++++++++++- backend/package.json | 23 + client/.gitignore | 1 - client/src/App.css | 38 - client/src/App.jsx | 32 - .../Components/AllProblems/AllProblems.css | 37 - .../Components/AllProblems/AllProblems.jsx | 50 - client/src/Components/HomePage/HomePage.css | 17 - client/src/Components/HomePage/HomePage.jsx | 21 - client/src/Components/HomePage/LoremPosts.js | 39 - client/src/Components/Login/Login.css | 3 - client/src/Components/Login/Login.jsx | 44 - .../Components/ProblemsPage/ProblemsPage.css | 43 - .../Components/ProblemsPage/ProblemsPage.jsx | 86 -- client/src/Components/Signup/Signup.css | 29 - client/src/Components/Signup/Signup.jsx | 60 - client/src/Constants/Navbar/Navbar.css | 7 - client/src/Constants/Navbar/Navbar.jsx | 28 - client/src/constants.js | 1 - client/src/index.css | 7 - frontend/.gitignore | 24 + {client => frontend}/README.md | 0 {client => frontend}/index.html | 3 - {client => frontend}/package-lock.json | 50 +- {client => frontend}/package.json | 2 +- {client => frontend}/public/vite.svg | 0 frontend/src/App.css | 42 + frontend/src/App.jsx | 37 + {client => frontend}/src/assets/react.svg | 0 frontend/src/components/userform/UserForm.css | 51 + frontend/src/components/userform/UserForm.jsx | 24 + frontend/src/constants/constants.js | 3 + frontend/src/index.css | 0 {client => frontend}/src/main.jsx | 0 frontend/src/pages/home/BlogData.jsx | 74 ++ frontend/src/pages/home/Home.css | 29 + frontend/src/pages/home/Home.jsx | 28 + frontend/src/pages/layout/Layout.css | 70 ++ frontend/src/pages/layout/Layout.jsx | 28 + frontend/src/pages/login/Login.css | 6 + frontend/src/pages/login/Login.jsx | 36 + frontend/src/pages/problems/CodeArea.jsx | 40 + frontend/src/pages/problems/Problems.css | 18 + frontend/src/pages/problems/Problems.jsx | 47 + frontend/src/pages/problems/QuestionArea.jsx | 22 + frontend/src/pages/problems/QuestionData.jsx | 24 + .../src/pages/problems/SubmissionData.jsx | 20 + frontend/src/pages/problemsList.jsx | 38 + .../src/pages/problemsets/Problemsets.css | 16 + .../src/pages/problemsets/Problemsets.jsx | 89 ++ frontend/src/pages/signup/Signup.css | 53 + frontend/src/pages/signup/Signup.jsx | 35 + {client => frontend}/vite.config.js | 0 server/.gitignore | 2 - server/index.js | 216 ---- server/middleware.js | 19 - server/package.json | 17 - 61 files changed, 2672 insertions(+), 845 deletions(-) create mode 100644 backend/.gitignore create mode 100644 backend/build/config.gypi create mode 120000 backend/build/node_gyp_bins/python3 create mode 100644 backend/index.js rename {server => backend}/package-lock.json (54%) create mode 100644 backend/package.json delete mode 100644 client/.gitignore delete mode 100644 client/src/App.css delete mode 100644 client/src/App.jsx delete mode 100644 client/src/Components/AllProblems/AllProblems.css delete mode 100644 client/src/Components/AllProblems/AllProblems.jsx delete mode 100644 client/src/Components/HomePage/HomePage.css delete mode 100644 client/src/Components/HomePage/HomePage.jsx delete mode 100644 client/src/Components/HomePage/LoremPosts.js delete mode 100644 client/src/Components/Login/Login.css delete mode 100644 client/src/Components/Login/Login.jsx delete mode 100644 client/src/Components/ProblemsPage/ProblemsPage.css delete mode 100644 client/src/Components/ProblemsPage/ProblemsPage.jsx delete mode 100644 client/src/Components/Signup/Signup.css delete mode 100644 client/src/Components/Signup/Signup.jsx delete mode 100644 client/src/Constants/Navbar/Navbar.css delete mode 100644 client/src/Constants/Navbar/Navbar.jsx delete mode 100644 client/src/constants.js delete mode 100644 client/src/index.css create mode 100644 frontend/.gitignore rename {client => frontend}/README.md (100%) rename {client => frontend}/index.html (54%) rename {client => frontend}/package-lock.json (98%) rename {client => frontend}/package.json (92%) rename {client => frontend}/public/vite.svg (100%) create mode 100644 frontend/src/App.css create mode 100644 frontend/src/App.jsx rename {client => frontend}/src/assets/react.svg (100%) create mode 100644 frontend/src/components/userform/UserForm.css create mode 100644 frontend/src/components/userform/UserForm.jsx create mode 100644 frontend/src/constants/constants.js create mode 100644 frontend/src/index.css rename {client => frontend}/src/main.jsx (100%) create mode 100644 frontend/src/pages/home/BlogData.jsx create mode 100644 frontend/src/pages/home/Home.css create mode 100644 frontend/src/pages/home/Home.jsx create mode 100644 frontend/src/pages/layout/Layout.css create mode 100644 frontend/src/pages/layout/Layout.jsx create mode 100644 frontend/src/pages/login/Login.css create mode 100644 frontend/src/pages/login/Login.jsx create mode 100644 frontend/src/pages/problems/CodeArea.jsx create mode 100644 frontend/src/pages/problems/Problems.css create mode 100644 frontend/src/pages/problems/Problems.jsx create mode 100644 frontend/src/pages/problems/QuestionArea.jsx create mode 100644 frontend/src/pages/problems/QuestionData.jsx create mode 100644 frontend/src/pages/problems/SubmissionData.jsx create mode 100644 frontend/src/pages/problemsList.jsx create mode 100644 frontend/src/pages/problemsets/Problemsets.css create mode 100644 frontend/src/pages/problemsets/Problemsets.jsx create mode 100644 frontend/src/pages/signup/Signup.css create mode 100644 frontend/src/pages/signup/Signup.jsx rename {client => frontend}/vite.config.js (100%) delete mode 100644 server/.gitignore delete mode 100644 server/index.js delete mode 100644 server/middleware.js delete mode 100644 server/package.json diff --git a/backend/.gitignore b/backend/.gitignore new file mode 100644 index 00000000..a3fae348 --- /dev/null +++ b/backend/.gitignore @@ -0,0 +1,7 @@ +node_modules +*.toml +binding.gyp +bindings/ +grammar.js +src + diff --git a/backend/build/config.gypi b/backend/build/config.gypi new file mode 100644 index 00000000..1b43b6b6 --- /dev/null +++ b/backend/build/config.gypi @@ -0,0 +1,409 @@ +# Do not edit. File was generated by node-gyp's "configure" step +{ + "target_defaults": { + "cflags": [], + "default_configuration": "Release", + "defines": [], + "include_dirs": [], + "libraries": [] + }, + "variables": { + "asan": 0, + "coverage": "false", + "dcheck_always_on": 0, + "debug_nghttp2": "false", + "debug_node": "false", + "enable_lto": "false", + "enable_pgo_generate": "false", + "enable_pgo_use": "false", + "error_on_warn": "false", + "force_dynamic_crt": 0, + "host_arch": "x64", + "icu_gyp_path": "tools/icu/icu-system.gyp", + "icu_small": "false", + "icu_ver_major": "72", + "is_debug": 0, + "libdir": "lib", + "llvm_version": "0.0", + "napi_build_version": "8", + "node_builtin_shareable_builtins": [ + "deps/cjs-module-lexer/lexer.js", + "deps/cjs-module-lexer/dist/lexer.js", + "deps/undici/undici.js" + ], + "node_byteorder": "little", + "node_debug_lib": "false", + "node_enable_d8": "false", + "node_enable_v8_vtunejit": "false", + "node_fipsinstall": "false", + "node_install_corepack": "true", + "node_install_npm": "false", + "node_library_files": [ + "lib/_http_agent.js", + "lib/_http_client.js", + "lib/_http_common.js", + "lib/_http_incoming.js", + "lib/_http_outgoing.js", + "lib/_http_server.js", + "lib/_stream_duplex.js", + "lib/_stream_passthrough.js", + "lib/_stream_readable.js", + "lib/_stream_transform.js", + "lib/_stream_wrap.js", + "lib/_stream_writable.js", + "lib/_tls_common.js", + "lib/_tls_wrap.js", + "lib/assert.js", + "lib/assert/strict.js", + "lib/async_hooks.js", + "lib/buffer.js", + "lib/child_process.js", + "lib/cluster.js", + "lib/console.js", + "lib/constants.js", + "lib/crypto.js", + "lib/dgram.js", + "lib/diagnostics_channel.js", + "lib/dns.js", + "lib/dns/promises.js", + "lib/domain.js", + "lib/events.js", + "lib/fs.js", + "lib/fs/promises.js", + "lib/http.js", + "lib/http2.js", + "lib/https.js", + "lib/inspector.js", + "lib/internal/abort_controller.js", + "lib/internal/assert.js", + "lib/internal/assert/assertion_error.js", + "lib/internal/assert/calltracker.js", + "lib/internal/async_hooks.js", + "lib/internal/blob.js", + "lib/internal/blocklist.js", + "lib/internal/bootstrap/browser.js", + "lib/internal/bootstrap/loaders.js", + "lib/internal/bootstrap/node.js", + "lib/internal/bootstrap/switches/does_not_own_process_state.js", + "lib/internal/bootstrap/switches/does_own_process_state.js", + "lib/internal/bootstrap/switches/is_main_thread.js", + "lib/internal/bootstrap/switches/is_not_main_thread.js", + "lib/internal/buffer.js", + "lib/internal/child_process.js", + "lib/internal/child_process/serialization.js", + "lib/internal/cli_table.js", + "lib/internal/cluster/child.js", + "lib/internal/cluster/primary.js", + "lib/internal/cluster/round_robin_handle.js", + "lib/internal/cluster/shared_handle.js", + "lib/internal/cluster/utils.js", + "lib/internal/cluster/worker.js", + "lib/internal/console/constructor.js", + "lib/internal/console/global.js", + "lib/internal/constants.js", + "lib/internal/crypto/aes.js", + "lib/internal/crypto/certificate.js", + "lib/internal/crypto/cfrg.js", + "lib/internal/crypto/cipher.js", + "lib/internal/crypto/diffiehellman.js", + "lib/internal/crypto/ec.js", + "lib/internal/crypto/hash.js", + "lib/internal/crypto/hashnames.js", + "lib/internal/crypto/hkdf.js", + "lib/internal/crypto/keygen.js", + "lib/internal/crypto/keys.js", + "lib/internal/crypto/mac.js", + "lib/internal/crypto/pbkdf2.js", + "lib/internal/crypto/random.js", + "lib/internal/crypto/rsa.js", + "lib/internal/crypto/scrypt.js", + "lib/internal/crypto/sig.js", + "lib/internal/crypto/util.js", + "lib/internal/crypto/webcrypto.js", + "lib/internal/crypto/x509.js", + "lib/internal/debugger/inspect.js", + "lib/internal/debugger/inspect_client.js", + "lib/internal/debugger/inspect_repl.js", + "lib/internal/dgram.js", + "lib/internal/dns/callback_resolver.js", + "lib/internal/dns/promises.js", + "lib/internal/dns/utils.js", + "lib/internal/dtrace.js", + "lib/internal/encoding.js", + "lib/internal/error_serdes.js", + "lib/internal/errors.js", + "lib/internal/event_target.js", + "lib/internal/file.js", + "lib/internal/fixed_queue.js", + "lib/internal/freelist.js", + "lib/internal/freeze_intrinsics.js", + "lib/internal/fs/cp/cp-sync.js", + "lib/internal/fs/cp/cp.js", + "lib/internal/fs/dir.js", + "lib/internal/fs/promises.js", + "lib/internal/fs/read_file_context.js", + "lib/internal/fs/recursive_watch.js", + "lib/internal/fs/rimraf.js", + "lib/internal/fs/streams.js", + "lib/internal/fs/sync_write_stream.js", + "lib/internal/fs/utils.js", + "lib/internal/fs/watchers.js", + "lib/internal/heap_utils.js", + "lib/internal/histogram.js", + "lib/internal/http.js", + "lib/internal/http2/compat.js", + "lib/internal/http2/core.js", + "lib/internal/http2/util.js", + "lib/internal/idna.js", + "lib/internal/inspector_async_hook.js", + "lib/internal/js_stream_socket.js", + "lib/internal/legacy/processbinding.js", + "lib/internal/linkedlist.js", + "lib/internal/main/check_syntax.js", + "lib/internal/main/environment.js", + "lib/internal/main/eval_stdin.js", + "lib/internal/main/eval_string.js", + "lib/internal/main/inspect.js", + "lib/internal/main/mksnapshot.js", + "lib/internal/main/print_help.js", + "lib/internal/main/prof_process.js", + "lib/internal/main/repl.js", + "lib/internal/main/run_main_module.js", + "lib/internal/main/test_runner.js", + "lib/internal/main/watch_mode.js", + "lib/internal/main/worker_thread.js", + "lib/internal/mime.js", + "lib/internal/modules/cjs/helpers.js", + "lib/internal/modules/cjs/loader.js", + "lib/internal/modules/esm/assert.js", + "lib/internal/modules/esm/create_dynamic_module.js", + "lib/internal/modules/esm/fetch_module.js", + "lib/internal/modules/esm/formats.js", + "lib/internal/modules/esm/get_format.js", + "lib/internal/modules/esm/handle_process_exit.js", + "lib/internal/modules/esm/initialize_import_meta.js", + "lib/internal/modules/esm/load.js", + "lib/internal/modules/esm/loader.js", + "lib/internal/modules/esm/module_job.js", + "lib/internal/modules/esm/module_map.js", + "lib/internal/modules/esm/package_config.js", + "lib/internal/modules/esm/resolve.js", + "lib/internal/modules/esm/translators.js", + "lib/internal/modules/package_json_reader.js", + "lib/internal/modules/run_main.js", + "lib/internal/net.js", + "lib/internal/options.js", + "lib/internal/per_context/domexception.js", + "lib/internal/per_context/messageport.js", + "lib/internal/per_context/primordials.js", + "lib/internal/perf/event_loop_delay.js", + "lib/internal/perf/event_loop_utilization.js", + "lib/internal/perf/nodetiming.js", + "lib/internal/perf/observe.js", + "lib/internal/perf/performance.js", + "lib/internal/perf/performance_entry.js", + "lib/internal/perf/resource_timing.js", + "lib/internal/perf/timerify.js", + "lib/internal/perf/usertiming.js", + "lib/internal/perf/utils.js", + "lib/internal/policy/manifest.js", + "lib/internal/policy/sri.js", + "lib/internal/priority_queue.js", + "lib/internal/process/esm_loader.js", + "lib/internal/process/execution.js", + "lib/internal/process/per_thread.js", + "lib/internal/process/policy.js", + "lib/internal/process/pre_execution.js", + "lib/internal/process/promises.js", + "lib/internal/process/report.js", + "lib/internal/process/signal.js", + "lib/internal/process/task_queues.js", + "lib/internal/process/warning.js", + "lib/internal/process/worker_thread_only.js", + "lib/internal/promise_hooks.js", + "lib/internal/querystring.js", + "lib/internal/readline/callbacks.js", + "lib/internal/readline/emitKeypressEvents.js", + "lib/internal/readline/interface.js", + "lib/internal/readline/promises.js", + "lib/internal/readline/utils.js", + "lib/internal/repl.js", + "lib/internal/repl/await.js", + "lib/internal/repl/history.js", + "lib/internal/repl/utils.js", + "lib/internal/socket_list.js", + "lib/internal/socketaddress.js", + "lib/internal/source_map/prepare_stack_trace.js", + "lib/internal/source_map/source_map.js", + "lib/internal/source_map/source_map_cache.js", + "lib/internal/stream_base_commons.js", + "lib/internal/streams/add-abort-signal.js", + "lib/internal/streams/buffer_list.js", + "lib/internal/streams/compose.js", + "lib/internal/streams/destroy.js", + "lib/internal/streams/duplex.js", + "lib/internal/streams/duplexify.js", + "lib/internal/streams/end-of-stream.js", + "lib/internal/streams/from.js", + "lib/internal/streams/lazy_transform.js", + "lib/internal/streams/legacy.js", + "lib/internal/streams/operators.js", + "lib/internal/streams/passthrough.js", + "lib/internal/streams/pipeline.js", + "lib/internal/streams/readable.js", + "lib/internal/streams/state.js", + "lib/internal/streams/transform.js", + "lib/internal/streams/utils.js", + "lib/internal/streams/writable.js", + "lib/internal/structured_clone.js", + "lib/internal/test/binding.js", + "lib/internal/test/transfer.js", + "lib/internal/test_runner/coverage.js", + "lib/internal/test_runner/harness.js", + "lib/internal/test_runner/mock.js", + "lib/internal/test_runner/reporter/dot.js", + "lib/internal/test_runner/reporter/spec.js", + "lib/internal/test_runner/reporter/tap.js", + "lib/internal/test_runner/runner.js", + "lib/internal/test_runner/tap_checker.js", + "lib/internal/test_runner/tap_lexer.js", + "lib/internal/test_runner/tap_parser.js", + "lib/internal/test_runner/test.js", + "lib/internal/test_runner/tests_stream.js", + "lib/internal/test_runner/utils.js", + "lib/internal/test_runner/yaml_to_js.js", + "lib/internal/timers.js", + "lib/internal/tls/secure-context.js", + "lib/internal/tls/secure-pair.js", + "lib/internal/trace_events_async_hooks.js", + "lib/internal/tty.js", + "lib/internal/url.js", + "lib/internal/util.js", + "lib/internal/util/colors.js", + "lib/internal/util/comparisons.js", + "lib/internal/util/debuglog.js", + "lib/internal/util/inspect.js", + "lib/internal/util/inspector.js", + "lib/internal/util/iterable_weak_map.js", + "lib/internal/util/parse_args/parse_args.js", + "lib/internal/util/parse_args/utils.js", + "lib/internal/util/types.js", + "lib/internal/v8/startup_snapshot.js", + "lib/internal/v8_prof_polyfill.js", + "lib/internal/v8_prof_processor.js", + "lib/internal/validators.js", + "lib/internal/vm.js", + "lib/internal/vm/module.js", + "lib/internal/wasm_web_api.js", + "lib/internal/watch_mode/files_watcher.js", + "lib/internal/watchdog.js", + "lib/internal/webstreams/adapters.js", + "lib/internal/webstreams/compression.js", + "lib/internal/webstreams/encoding.js", + "lib/internal/webstreams/queuingstrategies.js", + "lib/internal/webstreams/readablestream.js", + "lib/internal/webstreams/transfer.js", + "lib/internal/webstreams/transformstream.js", + "lib/internal/webstreams/util.js", + "lib/internal/webstreams/writablestream.js", + "lib/internal/worker.js", + "lib/internal/worker/io.js", + "lib/internal/worker/js_transferable.js", + "lib/module.js", + "lib/net.js", + "lib/os.js", + "lib/path.js", + "lib/path/posix.js", + "lib/path/win32.js", + "lib/perf_hooks.js", + "lib/process.js", + "lib/punycode.js", + "lib/querystring.js", + "lib/readline.js", + "lib/readline/promises.js", + "lib/repl.js", + "lib/stream.js", + "lib/stream/consumers.js", + "lib/stream/promises.js", + "lib/stream/web.js", + "lib/string_decoder.js", + "lib/sys.js", + "lib/test.js", + "lib/timers.js", + "lib/timers/promises.js", + "lib/tls.js", + "lib/trace_events.js", + "lib/tty.js", + "lib/url.js", + "lib/util.js", + "lib/util/types.js", + "lib/v8.js", + "lib/vm.js", + "lib/wasi.js", + "lib/worker_threads.js", + "lib/zlib.js" + ], + "node_module_version": 108, + "node_no_browser_globals": "false", + "node_prefix": "/usr", + "node_release_urlbase": "", + "node_section_ordering_info": "", + "node_shared": "false", + "node_shared_brotli": "true", + "node_shared_cares": "true", + "node_shared_http_parser": "false", + "node_shared_libuv": "true", + "node_shared_nghttp2": "true", + "node_shared_nghttp3": "false", + "node_shared_ngtcp2": "false", + "node_shared_openssl": "true", + "node_shared_zlib": "true", + "node_tag": "", + "node_target_type": "executable", + "node_use_bundled_v8": "true", + "node_use_dtrace": "false", + "node_use_etw": "false", + "node_use_node_code_cache": "true", + "node_use_node_snapshot": "true", + "node_use_openssl": "true", + "node_use_v8_platform": "true", + "node_with_ltcg": "false", + "node_without_node_options": "false", + "openssl_is_fips": "false", + "openssl_quic": "false", + "ossfuzz": "false", + "shlib_suffix": "so.108", + "target_arch": "x64", + "v8_enable_31bit_smis_on_64bit_arch": 0, + "v8_enable_gdbjit": 0, + "v8_enable_hugepage": 0, + "v8_enable_i18n_support": 1, + "v8_enable_inspector": 1, + "v8_enable_javascript_promise_hooks": 1, + "v8_enable_lite_mode": 0, + "v8_enable_object_print": 1, + "v8_enable_pointer_compression": 0, + "v8_enable_shared_ro_heap": 1, + "v8_enable_short_builtin_calls": 1, + "v8_enable_webassembly": 1, + "v8_no_strict_aliasing": 1, + "v8_optimized_debug": 1, + "v8_promise_internal_field_count": 1, + "v8_random_seed": 0, + "v8_trace_maps": 0, + "v8_use_siphash": 1, + "want_separate_host_toolset": 0, + "nodedir": "/home/tanmay/.cache/node-gyp/18.15.0", + "standalone_static_library": 1, + "userconfig": "/home/tanmay/.npmrc", + "cache": "/home/tanmay/.npm", + "local_prefix": "/home/tanmay/Desktop/full-stack-roadmap/full-stack-assignment", + "globalconfig": "/usr/etc/npmrc", + "init_module": "/home/tanmay/.npm-init.js", + "prefix": "/usr", + "user_agent": "npm/9.6.6 node/v18.15.0 linux x64 workspaces/false", + "metrics_registry": "https://registry.npmjs.org/", + "node_gyp": "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js", + "global_prefix": "/usr" + } +} diff --git a/backend/build/node_gyp_bins/python3 b/backend/build/node_gyp_bins/python3 new file mode 120000 index 00000000..ae65fdaa --- /dev/null +++ b/backend/build/node_gyp_bins/python3 @@ -0,0 +1 @@ +/usr/bin/python3 \ No newline at end of file diff --git a/backend/index.js b/backend/index.js new file mode 100644 index 00000000..9ed13eff --- /dev/null +++ b/backend/index.js @@ -0,0 +1,313 @@ +const express = require('express'); +const bodyParser = require('body-parser'); +const cookieParser = require('cookie-parser'); +const jwt = require('jsonwebtoken'); +const cors = require('cors'); +const app = express(); +const port = 3000; +const secretKey = "secret"; + +const auth = (req, res, next) => { + const token = req.headers['authorization']; + if (!token) { + return res.status(401).send('Not logged in'); + } + try { + let decodedToken = jwt.verify(token, secretKey); + if (decodedToken && decodedToken.id) { + req.userId = decodedToken.id; + next(); + } + } + catch (err) { + return res.status(403).json({ message: err.message }) + } +} + +const checkIfAdmin = function (req, res, next) { + try { + let id = req.userId; + let found = false; + USERS.forEach(user => { + if (user.id === id && user.isAdmin) { + found = true; + next(); + } + }) + if (!found) { + return res.status(401).send("User not admin"); + } + } + catch (err) { + return res.status(401).send("Unauthorized"); + } +} + +app.use(bodyParser.urlencoded({ + extended: true +})); +app.use(bodyParser.json()); +app.use(cookieParser()); +app.use(cors()); + + +class User { + constructor(id, username, password, isAdmin) { + this.id = id; + this.username = username; + this.password = password; + this.isAdmin = isAdmin; + } +} + +const USERS = [ + new User(1, "a", "a", true), + new User(2, "b", "b", false) +]; + +const QUESTIONS = [{ + id: 1, + title: "Two states", + difficulty: "Easy", + description: "Given an array , return the maximum of the array?", + acceptance: "50%", + testCases: [{ + input: "[1,2,3,4,5]", + output: "5" + }] +}, { + id: 2, + title: "Two", + difficulty: "Hard", + description: "Find a pair of a numbers in a list that sums up to a target", + acceptance: "40%", + testCases: [{ + input: "[1,2,3,4,5], 9", + output: "[3, 4]" + }] +}]; + +const SUBMISSION = [ + { + userId: 1, + questions: [ + { + questionId: 1, + submissions: [ + { + userCode: "int main() {printf('hello world')}", + language: "c", + status: "Success", + }, + { + userCode: "int main() {printf('bruh world')}", + language: "python", + status: "Success", + } + ] + }, + ] + }, + { + userId: 2, + questions: [ + { + questionId: 1, + submissions: [ + { + userCode: "int main() {printf('bruh world')}", + language: "python", + status: "Success", + } + ] + } + ] + } +] + +// app.get('/signup', function(req, res) { +// return res.sendFile(__dirname + "/signup.html"); +// }) +app.post('/signup', function (req, res) { + // body: + // { + // username, + // password + // } + let username = req.body.username; + let password = req.body.password; + //Store email and password (as is for now) in the USERS array above (only if the user with the given email doesnt exist) + let userExists = false; + USERS.forEach(user => { + if (user.username === username) { + userExists = true; + } + }) + + if (userExists) { + return res.status(403).json({ message: 'User already exists' }); + } + else { + let newUser = new User(USERS.length + 1, username, password, false); + USERS.push(newUser); + return res.status(200).send({ message: 'User added!' }); + } + // return back 200 status code to the client +}) + +// app.get('/login', function(req, res) { +// res.sendFile(__dirname + '/login.html'); +// }) + +app.post('/login', function (req, res) { + + let username = req.body.username; + let password = req.body.password; + + let userExists = false; + + USERS.forEach(user => { + if (user.username === username) { + userExists = true; + if (user.password === password) { + const token = jwt.sign({ id: user.id }, secretKey); + return res.status(200).json({ token, message: "Logged in successfully" }) + } + else { + return res.status(403).json({ message: "Incorrect Password" }); + } + } + }) + if (!userExists) { + res.status(404).json({ message: "User not found" }); + } + +}) + +app.get('/problemsets', function (req, res) { + // Fetch the questions from the database + const questions = QUESTIONS; + // Render the questions page with the username and questions + res.status(200).json({ questions: questions }); + //return the user all the questions in the QUESTIONS array +}) + +app.get("/problems/:questionId", auth, function (req, res) { + const questionId = req.params.questionId; + const userId = req.userId; + + // Get user submissions for question + let i; + let submissions; + let found = false; + for (i = 0; i < SUBMISSION.length; i++) { + if (SUBMISSION[i].userId == userId) { + found = true; + break; + } + } + + if (!found) { + submissions = []; + } + else { + let j; + let userQuestions = SUBMISSION[i].questions; + found = false; + for (j = 0; j < userQuestions.length; j++) { + if (userQuestions[j].questionId == questionId) { + found = true; + break; + } + } + + if (!found) { + submissions = []; + } + else { + submissions = userQuestions[j].submissions; + } + } + + // Get question data + let questionData; + for (i = 0; i < QUESTIONS.length; i++) { + if (QUESTIONS[i].id == questionId) { + questionData = QUESTIONS[i]; + break; + } + } + if (questionData == undefined) return res.status(404).json({ message: "Question not found" }) + + return res.status(200).json({ submissions, questionData }); +}); + + +app.post("/problems/:questionId", auth, function (req, res) { + // let the user submit a problem, randomly accept or reject the solution + // Store the submission in the SUBMISSION array above + const userId = req.userId; + const questionId = Number(req.params.questionId); + const userCode = req.body.usercode; + const language = req.body.language; + const status = Math.random() > 0.5 ? "Success" : "Fail"; + + // Create submission + const submission = { + userCode, + language, + status + } + + // Add submission to SUBMISSIONS + let found = false; + let i = 0; + // Find the user + SUBMISSION.forEach(user => { + if (user.userId == userId) { + found = true; + return; + } + if (!found) + i++; + }) + if (!found) { + const newUser = { + userId, + questions: [] + }; + SUBMISSION.push(newUser); + } + // Reset boolean + found = false; + // Find the question + let j = 0; + SUBMISSION[i].questions.forEach(question => { + if (question.questionId == questionId) { + found = true; + return; + } + if (!found) + j++; + }) + if (!found) { + const newQuestion = { + questionId, + submissions: [] + } + SUBMISSION[i].questions.push(newQuestion); + } + SUBMISSION[i].questions[j].submissions.push(submission); + return res.status(200).json({ message: "Submitted successfully", status }) +}); + +app.get('/admin', auth, checkIfAdmin, (req, res) => { + return res.send("You are admin"); +}) +// leaving as hard todos +// Create a route that lets an admin add a new problem +// ensure that only admins can do that. + +app.listen(port, function () { + console.log(`Example app listening on port ${port}`) +}) diff --git a/server/package-lock.json b/backend/package-lock.json similarity index 54% rename from server/package-lock.json rename to backend/package-lock.json index 55cd30c7..67dae4dd 100644 --- a/server/package-lock.json +++ b/backend/package-lock.json @@ -1,20 +1,30 @@ { - "name": "server", + "name": "express-backend-app", "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "server", + "name": "express-backend-app", "version": "1.0.0", "license": "ISC", "dependencies": { "body-parser": "^1.20.2", + "cookie-parser": "^1.4.6", "cors": "^2.8.5", + "ejs": "^3.1.9", "express": "^4.18.2", - "jsonwebtoken": "^9.0.0" + "html": "^1.0.0", + "jsonwebtoken": "^9.0.0", + "nodemon": "^2.0.22", + "tree-sitter-cli": "^0.20.8" } }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -27,11 +37,55 @@ "node": ">= 0.6" } }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, + "node_modules/async": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "engines": { + "node": ">=8" + } + }, "node_modules/body-parser": { "version": "1.20.2", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", @@ -55,11 +109,36 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -80,6 +159,101 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "engines": [ + "node >= 0.8" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -107,11 +281,36 @@ "node": ">= 0.6" } }, + "node_modules/cookie-parser": { + "version": "1.4.6", + "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.6.tgz", + "integrity": "sha512-z3IzaNjdwUC2olLIB5/ITd0/setiaFMLYiZJle7xg5Fe9KWAceil7xszYfHHBtDFYLSgJduS2Ty0P1uJdPDJeA==", + "dependencies": { + "cookie": "0.4.1", + "cookie-signature": "1.0.6" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/cookie-parser/node_modules/cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, "node_modules/cors": { "version": "2.8.5", "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", @@ -162,6 +361,20 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, + "node_modules/ejs": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz", + "integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==", + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -261,6 +474,44 @@ "node": ">= 0.8" } }, + "node_modules/filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/finalhandler": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", @@ -294,6 +545,19 @@ "node": ">= 0.6" } }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -312,6 +576,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -323,6 +598,14 @@ "node": ">= 0.4.0" } }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -334,6 +617,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/html": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/html/-/html-1.0.0.tgz", + "integrity": "sha512-lw/7YsdKiP3kk5PnR1INY17iJuzdAtJewxr14ozKJWbbR97znovZ0mh+WEMZ8rjc3lgTK+ID/htTjuyGKB52Kw==", + "dependencies": { + "concat-stream": "^1.4.7" + }, + "bin": { + "html": "bin/html.js" + } + }, "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -360,6 +654,11 @@ "node": ">=0.10.0" } }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -373,6 +672,66 @@ "node": ">= 0.10" } }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/jake": { + "version": "10.8.5", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", + "integrity": "sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==", + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.1", + "minimatch": "^3.0.4" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/jsonwebtoken": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz", @@ -393,6 +752,20 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, + "node_modules/jsonwebtoken/node_modules/semver": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/jwa": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", @@ -479,6 +852,17 @@ "node": ">= 0.6" } }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -492,6 +876,68 @@ "node": ">= 0.6" } }, + "node_modules/nodemon": { + "version": "2.0.22", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.22.tgz", + "integrity": "sha512-B8YqaKMmyuCO7BowF1Z1/mkPqLk6cs/l63Ojtd6otKjMx47Dq1utxfRxcavH1I7VSaL8n5BUaoutadnsX3AAVQ==", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=8.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/nodemon/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -532,6 +978,22 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -544,6 +1006,11 @@ "node": ">= 0.10" } }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" + }, "node_modules/qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", @@ -580,6 +1047,36 @@ "node": ">= 0.8" } }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -605,17 +1102,11 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" + "semver": "bin/semver" } }, "node_modules/send": { @@ -678,6 +1169,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/simple-update-notifier": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz", + "integrity": "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==", + "dependencies": { + "semver": "~7.0.0" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/simple-update-notifier/node_modules/semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -686,6 +1196,41 @@ "node": ">= 0.8" } }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, "node_modules/toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", @@ -694,6 +1239,26 @@ "node": ">=0.6" } }, + "node_modules/touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dependencies": { + "nopt": "~1.0.10" + }, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/tree-sitter-cli": { + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.20.8.tgz", + "integrity": "sha512-XjTcS3wdTy/2cc/ptMLc/WRyOLECRYcMTrSWyhZnj1oGSOWbHLTklgsgRICU3cPfb0vy+oZCC33M43u6R1HSCA==", + "hasInstallScript": true, + "bin": { + "tree-sitter": "cli.js" + } + }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -706,6 +1271,16 @@ "node": ">= 0.6" } }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==" + }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -714,6 +1289,11 @@ "node": ">= 0.8" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -737,6 +1317,11 @@ } }, "dependencies": { + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, "accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -746,11 +1331,43 @@ "negotiator": "0.6.3" } }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, + "async": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" + }, "body-parser": { "version": "1.20.2", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", @@ -770,11 +1387,33 @@ "unpipe": "1.0.0" } }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, "buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, "bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -789,6 +1428,74 @@ "get-intrinsic": "^1.0.2" } }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, "content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -807,11 +1514,32 @@ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==" }, + "cookie-parser": { + "version": "1.4.6", + "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.6.tgz", + "integrity": "sha512-z3IzaNjdwUC2olLIB5/ITd0/setiaFMLYiZJle7xg5Fe9KWAceil7xszYfHHBtDFYLSgJduS2Ty0P1uJdPDJeA==", + "requires": { + "cookie": "0.4.1", + "cookie-signature": "1.0.6" + }, + "dependencies": { + "cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==" + } + } + }, "cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, "cors": { "version": "2.8.5", "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", @@ -852,6 +1580,14 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, + "ejs": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz", + "integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==", + "requires": { + "jake": "^10.8.5" + } + }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -937,6 +1673,40 @@ } } }, + "filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "requires": { + "minimatch": "^5.0.1" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, "finalhandler": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", @@ -961,6 +1731,12 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "optional": true + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -976,6 +1752,14 @@ "has-symbols": "^1.0.3" } }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "requires": { + "is-glob": "^4.0.1" + } + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -984,11 +1768,24 @@ "function-bind": "^1.1.1" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" + }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" }, + "html": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/html/-/html-1.0.0.tgz", + "integrity": "sha512-lw/7YsdKiP3kk5PnR1INY17iJuzdAtJewxr14ozKJWbbR97znovZ0mh+WEMZ8rjc3lgTK+ID/htTjuyGKB52Kw==", + "requires": { + "concat-stream": "^1.4.7" + } + }, "http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -1009,6 +1806,11 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" + }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -1019,6 +1821,48 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "jake": { + "version": "10.8.5", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", + "integrity": "sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==", + "requires": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.1", + "minimatch": "^3.0.4" + } + }, "jsonwebtoken": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz", @@ -1034,6 +1878,14 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "semver": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "requires": { + "lru-cache": "^6.0.0" + } } } }, @@ -1102,6 +1954,14 @@ "mime-db": "1.52.0" } }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -1112,6 +1972,51 @@ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, + "nodemon": { + "version": "2.0.22", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.22.tgz", + "integrity": "sha512-B8YqaKMmyuCO7BowF1Z1/mkPqLk6cs/l63Ojtd6otKjMx47Dq1utxfRxcavH1I7VSaL8n5BUaoutadnsX3AAVQ==", + "requires": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } + } + }, + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "requires": { + "abbrev": "1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -1140,6 +2045,16 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, "proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -1149,6 +2064,11 @@ "ipaddr.js": "1.9.1" } }, + "pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" + }, "qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", @@ -1173,6 +2093,35 @@ "unpipe": "1.0.0" } }, + "readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "requires": { + "picomatch": "^2.2.1" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1184,12 +2133,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", - "requires": { - "lru-cache": "^6.0.0" - } + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, "send": { "version": "0.18.0", @@ -1244,16 +2190,75 @@ "object-inspect": "^1.9.0" } }, + "simple-update-notifier": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz", + "integrity": "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==", + "requires": { + "semver": "~7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==" + } + } + }, "statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, "toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" }, + "touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "requires": { + "nopt": "~1.0.10" + } + }, + "tree-sitter-cli": { + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.20.8.tgz", + "integrity": "sha512-XjTcS3wdTy/2cc/ptMLc/WRyOLECRYcMTrSWyhZnj1oGSOWbHLTklgsgRICU3cPfb0vy+oZCC33M43u6R1HSCA==" + }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -1263,11 +2268,26 @@ "mime-types": "~2.1.24" } }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + }, + "undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==" + }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", diff --git a/backend/package.json b/backend/package.json new file mode 100644 index 00000000..9aa21eb6 --- /dev/null +++ b/backend/package.json @@ -0,0 +1,23 @@ +{ + "name": "express-backend-app", + "version": "1.0.0", + "description": "", + "main": "bindings/node", + "scripts": { + "start": "nodemon index.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "body-parser": "^1.20.2", + "cookie-parser": "^1.4.6", + "cors": "^2.8.5", + "ejs": "^3.1.9", + "express": "^4.18.2", + "html": "^1.0.0", + "jsonwebtoken": "^9.0.0", + "nodemon": "^2.0.22", + "tree-sitter-cli": "^0.20.8" + } +} diff --git a/client/.gitignore b/client/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/client/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/client/src/App.css b/client/src/App.css deleted file mode 100644 index 35ac68f3..00000000 --- a/client/src/App.css +++ /dev/null @@ -1,38 +0,0 @@ -/* -font-family: 'Merriweather', serif; -font-family: 'Montserrat', sans-serif; -font-family: 'Prompt', sans-serif; -font-family: 'Sacramento', cursive; -*/ - -h1 , h2 , h3 , h4 , h5 , h6 { - font-family: 'Montserrat', sans-serif; - font-weight: 900; -} -p , a { - font-family: 'Prompt', sans-serif -} - -.flex-row { - display: flex; - justify-content: center; - align-items: center; - flex-direction: row; -} - -.flex-col { - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; -} - -.logo { - width: 40px; - height: 40px; -} - -a , Link { - text-decoration: none; -} - diff --git a/client/src/App.jsx b/client/src/App.jsx deleted file mode 100644 index f376af09..00000000 --- a/client/src/App.jsx +++ /dev/null @@ -1,32 +0,0 @@ -import { BrowserRouter , Routes , Route } from "react-router-dom"; - -import HomePage from "./Components/HomePage/HomePage" -import AllProblems from "./Components/AllProblems/AllProblems"; - -import Navbar from "./Constants/Navbar/Navbar" -import ProblemsPage from "./Components/ProblemsPage/ProblemsPage"; -import Signup from "./Components/Signup/Signup" -import Login from "./Components/Login/Login" -import "./App.css" - -function App() { - - return ( - - - - } /> - } /> - } /> - } /> - } /> - 404 Not Found} /> - - - //
- // Finish the assignment! Look at the comments in App.jsx as a starting point - //
- ) -} - -export default App diff --git a/client/src/Components/AllProblems/AllProblems.css b/client/src/Components/AllProblems/AllProblems.css deleted file mode 100644 index 0bdfb9f4..00000000 --- a/client/src/Components/AllProblems/AllProblems.css +++ /dev/null @@ -1,37 +0,0 @@ -table { - margin-top: 2rem; - width: 95%; - border-collapse: collapse; -} - - -tr { - color: rgb(0, 0, 156); - border: 2px solid grey; -} - -th { - border: 2px solid black; - text-align: start; - padding: 0.5rem 0 0.5rem 0.3rem; - color: black; - font-family: 'Merriweather', serif; -} - -td { - font-family: 'Merriweather', serif; - padding: 1rem; -} - -.Easy { - color: green; - font-weight: 900; -} -.Medium { - color: rgb(255, 166, 0); - font-weight: 900; -} -.Hard { - color: red; - font-weight: 900; -} \ No newline at end of file diff --git a/client/src/Components/AllProblems/AllProblems.jsx b/client/src/Components/AllProblems/AllProblems.jsx deleted file mode 100644 index 1e16e6b2..00000000 --- a/client/src/Components/AllProblems/AllProblems.jsx +++ /dev/null @@ -1,50 +0,0 @@ -import React, {useEffect, useState} from 'react' -import { Link } from 'react-router-dom' - -import "./AllProblems.css" -import { backendUrl } from "../../constants.js"; - -const AllProblemsPage = () => { - const [problems, setProblems] = useState([]); - - const init = async () => { - const response = await fetch(`${backendUrl}/problems`, { - method: "GET", - }); - - const json = await response.json(); - setProblems(json.problems); - } - - useEffect(() => { - init() - }, []); - - return ( -
- - - - - - - - - - {problems.map((prob,index) => ( - - - - - - - - ))} - - -
TitleDifficultyAcceptance
{prob.title}{prob.difficulty}{prob.acceptance}
-
- ) -} - -export default AllProblemsPage \ No newline at end of file diff --git a/client/src/Components/HomePage/HomePage.css b/client/src/Components/HomePage/HomePage.css deleted file mode 100644 index d6f166b2..00000000 --- a/client/src/Components/HomePage/HomePage.css +++ /dev/null @@ -1,17 +0,0 @@ -.blog-box { - border: 1px solid grey; - padding: 1rem; -} -.date { - font-weight: 100; - font-size: 0.7rem; - margin: 0; -} - -.title { - margin: 10px 0; -} - -.content { - margin: 5px 0; -} \ No newline at end of file diff --git a/client/src/Components/HomePage/HomePage.jsx b/client/src/Components/HomePage/HomePage.jsx deleted file mode 100644 index f11180c3..00000000 --- a/client/src/Components/HomePage/HomePage.jsx +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react' -import "./HomePage.css" -import loremContent from './LoremPosts' - -const HomePage = () => { - return ( -
-

Blogs

- {loremContent.map((content,index) => ( -
-

{content.date}

-

{content.title}

-

{content.content}

-
- ))} - -
- ) -} - -export default HomePage \ No newline at end of file diff --git a/client/src/Components/HomePage/LoremPosts.js b/client/src/Components/HomePage/LoremPosts.js deleted file mode 100644 index 311fc974..00000000 --- a/client/src/Components/HomePage/LoremPosts.js +++ /dev/null @@ -1,39 +0,0 @@ -const loremContent = [ - { - title : "Why use C++", - date : "10 July 2023", - content : "C++ is very fast" - }, - { - title : "Why use C++", - date : "10 July 2023", - content : "C++ is very fast" - }, - { - title : "Why use C++ users hate Java", - date : "2 July 2023", - content : "Java is very verbose" - }, - { - title : "Why Java is better than C++", - date : "5 March 2023", - content : "No Pointers and cross platforms" - }, - { - title : "Why Ai will take your job", - date : "1 March 2023", - content : "Because Ai can do alot of automation, that required humans" - }, - { - title : "What jobs will Ai Create", - date : "28 Feb 2023", - content : "Ai and Ml engineering jobs" - }, - { - title : "Is Python the real chad or Javascript", - date : "15 Feb 2023", - content : "Its like asking is IronMan better than Thor or Captain America" - }, -] - -export default loremContent; \ No newline at end of file diff --git a/client/src/Components/Login/Login.css b/client/src/Components/Login/Login.css deleted file mode 100644 index b2418acb..00000000 --- a/client/src/Components/Login/Login.css +++ /dev/null @@ -1,3 +0,0 @@ -#login { - height: 100%; -} \ No newline at end of file diff --git a/client/src/Components/Login/Login.jsx b/client/src/Components/Login/Login.jsx deleted file mode 100644 index 6cc12bfe..00000000 --- a/client/src/Components/Login/Login.jsx +++ /dev/null @@ -1,44 +0,0 @@ -import React from 'react' - -import "./Login.css" -import {useState} from "react"; -import {backendUrl} from "../../constants.js"; - -const Login = () => { - const [email, setEmail] = useState(""); - const [password, setPassword] = useState(""); - - return ( -
-

Login

-
-
- - { - setEmail(e.target.value) - }} type="text" name='email' placeholder='Your Email' /> -
- -
- - setPassword(e.target.value)} type="text" name='password' placeholder='Your Password' /> -
- - -
-
- ) -} - -export default Login ; \ No newline at end of file diff --git a/client/src/Components/ProblemsPage/ProblemsPage.css b/client/src/Components/ProblemsPage/ProblemsPage.css deleted file mode 100644 index a6bc6969..00000000 --- a/client/src/Components/ProblemsPage/ProblemsPage.css +++ /dev/null @@ -1,43 +0,0 @@ -#problempage { - min-height: 91vh; - display: flex; - align-items: flex-start; -} - -.ques , .code { - width: 50%; - min-height: 65vh; - margin: 0; - display: flex; - flex-direction: column; - justify-content: flex-start; - padding: 2rem; -} - -.code-form { - height: 70vh; -} - -textarea , pre { - width: 100%; - height: 100%; - font-size: 1.3rem; - -moz-tab-size : 4; - -o-tab-size : 4; - tab-size : 4; -} - -button { - padding: 0.5rem 1rem; - margin-right: 1rem; - font-weight: 800; - border-radius: 0.5rem; - cursor: pointer; -} - -#test { - background-color: gray; -} -#submit { - background-color: rgb(68, 207, 68); -} \ No newline at end of file diff --git a/client/src/Components/ProblemsPage/ProblemsPage.jsx b/client/src/Components/ProblemsPage/ProblemsPage.jsx deleted file mode 100644 index 66cedf39..00000000 --- a/client/src/Components/ProblemsPage/ProblemsPage.jsx +++ /dev/null @@ -1,86 +0,0 @@ -import React, {useEffect, useState} from 'react' -import { useParams } from 'react-router-dom' - -import "./ProblemsPage.css" -import {backendUrl} from "../../constants.js"; - - -const ProblemsPage = () => { - const [CodeSeg, setCodeSeg] = useState("") ; - const { pid } = useParams() ; - const cleanId = pid.substring(1) ; - const [problem, setProblem] = useState(null); - const [submission, setSubmission] = useState(""); - - const init = async () => { - const response = await fetch(`${backendUrl}/problem/` + cleanId, { - method: "GET", - }); - - const json = await response.json(); - setProblem(json.problem); - } - - useEffect(() => { - init(); - }, []) - // console.log(cleanId) ; - - - const handleKey = (event) => { - if (event.key == "Tab"){ - event.preventDefault() ; - const { selectionStart , selectionEnd , value } = event.target ; - const val = value.substring(0,selectionStart) + "\t" + value.substring(selectionStart) ; - event.target.value = val; - event.target.selectionStart = event.target.selectionEnd = selectionStart+1; - } - setCodeSeg(event.value) ; - } - - return ( -
- - { - problem? ( -
-
-

{problem.title}

-
Description
-

{problem.description}

- Input : {problem.exampleIn} - Output : {problem.exampleOut} -
-
-

Code Here

-
- - -
-
-
- ) : - (
The searched Question Doesn't exist
) - } - -
- - ) -} - -export default ProblemsPage \ No newline at end of file diff --git a/client/src/Components/Signup/Signup.css b/client/src/Components/Signup/Signup.css deleted file mode 100644 index c54036d6..00000000 --- a/client/src/Components/Signup/Signup.css +++ /dev/null @@ -1,29 +0,0 @@ -#signup { - min-height: 100%; -} - -.subform { - margin: 1rem; - font-family: 'Prompt', sans-serif;; -} - -.signup-form { - height: 200px; - width: 70%; - max-width: 550px; - border: 1px solid grey; - position: relative; - overflow: hidden; - display: flex; - flex-direction: column; - justify-content: center; - border-radius: 0.5rem; - background: #fffdfd; - box-shadow: 0 8px 8px -4px lightblue; -} - -.subform > input { - position: absolute; - right: 100px; - padding: 0.3rem; -} \ No newline at end of file diff --git a/client/src/Components/Signup/Signup.jsx b/client/src/Components/Signup/Signup.jsx deleted file mode 100644 index 20ca0cfb..00000000 --- a/client/src/Components/Signup/Signup.jsx +++ /dev/null @@ -1,60 +0,0 @@ -import React, { useState } from "react"; - -import "./Signup.css"; -import { backendUrl } from "../../constants.js"; -const Signup = () => { - const [email, setEmail] = useState(""); - const [password, setPassword] = useState(""); - - return ( -
-

Signup

-
-
- - { - setEmail(e.target.value); - }} - type='text' - name='email' - placeholder='Your Email' - /> -
- -
- - setPassword(e.target.value)} - type='password' - name='password' - placeholder='Your Password' - /> -
- - -
-
- ); -}; - -export default Signup; - -// neetcode1@gmail.com diff --git a/client/src/Constants/Navbar/Navbar.css b/client/src/Constants/Navbar/Navbar.css deleted file mode 100644 index 978c4365..00000000 --- a/client/src/Constants/Navbar/Navbar.css +++ /dev/null @@ -1,7 +0,0 @@ -.logo-box { - margin-right: 2rem; -} - -.nav-options { - margin-right: 2rem; -} \ No newline at end of file diff --git a/client/src/Constants/Navbar/Navbar.jsx b/client/src/Constants/Navbar/Navbar.jsx deleted file mode 100644 index 28ecfd12..00000000 --- a/client/src/Constants/Navbar/Navbar.jsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react' -import { Link } from 'react-router-dom' - -import './Navbar.css' - -const Navbar = () => { - return ( - - ) -} - -export default Navbar diff --git a/client/src/constants.js b/client/src/constants.js deleted file mode 100644 index 2a84056f..00000000 --- a/client/src/constants.js +++ /dev/null @@ -1 +0,0 @@ -export const backendUrl = "https://api.peetcode.com"; diff --git a/client/src/index.css b/client/src/index.css deleted file mode 100644 index 609e8822..00000000 --- a/client/src/index.css +++ /dev/null @@ -1,7 +0,0 @@ -html, body, #app, #app>div { - height: 100% -} - -#root { - height: 90vh; -} \ No newline at end of file diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 00000000..a547bf36 --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,24 @@ +# 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? diff --git a/client/README.md b/frontend/README.md similarity index 100% rename from client/README.md rename to frontend/README.md diff --git a/client/index.html b/frontend/index.html similarity index 54% rename from client/index.html rename to frontend/index.html index 60ee5964..79c47019 100644 --- a/client/index.html +++ b/frontend/index.html @@ -5,9 +5,6 @@ Vite + React - - -
diff --git a/client/package-lock.json b/frontend/package-lock.json similarity index 98% rename from client/package-lock.json rename to frontend/package-lock.json index 471d46a1..4a36cfa9 100644 --- a/client/package-lock.json +++ b/frontend/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.10.0" + "react-router-dom": "^6.11.2" }, "devDependencies": { "@types/react": "^18.0.28", @@ -768,9 +768,9 @@ "dev": true }, "node_modules/@remix-run/router": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.5.0.tgz", - "integrity": "sha512-bkUDCp8o1MvFO+qxkODcbhSqRa6P2GXgrGZVpt0dCXNW2HCSCqYI0ZoAqEOSAjRWmmlKcYgFvN4B4S+zo/f8kg==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.6.2.tgz", + "integrity": "sha512-LzqpSrMK/3JBAVBI9u3NWtOhWNw5AMQfrUFYB0+bDHTSw17z++WJLsPsxAuK+oSddsxk4d7F/JcdDPM1M5YAhA==", "engines": { "node": ">=14" } @@ -1236,11 +1236,11 @@ } }, "node_modules/react-router": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.10.0.tgz", - "integrity": "sha512-Nrg0BWpQqrC3ZFFkyewrflCud9dio9ME3ojHCF/WLsprJVzkq3q3UeEhMCAW1dobjeGbWgjNn/PVF6m46ANxXQ==", + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.11.2.tgz", + "integrity": "sha512-74z9xUSaSX07t3LM+pS6Un0T55ibUE/79CzfZpy5wsPDZaea1F8QkrsiyRnA2YQ7LwE/umaydzXZV80iDCPkMg==", "dependencies": { - "@remix-run/router": "1.5.0" + "@remix-run/router": "1.6.2" }, "engines": { "node": ">=14" @@ -1250,12 +1250,12 @@ } }, "node_modules/react-router-dom": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.10.0.tgz", - "integrity": "sha512-E5dfxRPuXKJqzwSe/qGcqdwa18QiWC6f3H3cWXM24qj4N0/beCIf/CWTipop2xm7mR0RCS99NnaqPNjHtrAzCg==", + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.11.2.tgz", + "integrity": "sha512-JNbKtAeh1VSJQnH6RvBDNhxNwemRj7KxCzc5jb7zvDSKRnPWIFj9pO+eXqjM69gQJ0r46hSz1x4l9y0651DKWw==", "dependencies": { - "@remix-run/router": "1.5.0", - "react-router": "6.10.0" + "@remix-run/router": "1.6.2", + "react-router": "6.11.2" }, "engines": { "node": ">=14" @@ -1893,9 +1893,9 @@ } }, "@remix-run/router": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.5.0.tgz", - "integrity": "sha512-bkUDCp8o1MvFO+qxkODcbhSqRa6P2GXgrGZVpt0dCXNW2HCSCqYI0ZoAqEOSAjRWmmlKcYgFvN4B4S+zo/f8kg==" + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.6.2.tgz", + "integrity": "sha512-LzqpSrMK/3JBAVBI9u3NWtOhWNw5AMQfrUFYB0+bDHTSw17z++WJLsPsxAuK+oSddsxk4d7F/JcdDPM1M5YAhA==" }, "@types/prop-types": { "version": "15.7.5", @@ -2221,20 +2221,20 @@ "dev": true }, "react-router": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.10.0.tgz", - "integrity": "sha512-Nrg0BWpQqrC3ZFFkyewrflCud9dio9ME3ojHCF/WLsprJVzkq3q3UeEhMCAW1dobjeGbWgjNn/PVF6m46ANxXQ==", + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.11.2.tgz", + "integrity": "sha512-74z9xUSaSX07t3LM+pS6Un0T55ibUE/79CzfZpy5wsPDZaea1F8QkrsiyRnA2YQ7LwE/umaydzXZV80iDCPkMg==", "requires": { - "@remix-run/router": "1.5.0" + "@remix-run/router": "1.6.2" } }, "react-router-dom": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.10.0.tgz", - "integrity": "sha512-E5dfxRPuXKJqzwSe/qGcqdwa18QiWC6f3H3cWXM24qj4N0/beCIf/CWTipop2xm7mR0RCS99NnaqPNjHtrAzCg==", + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.11.2.tgz", + "integrity": "sha512-JNbKtAeh1VSJQnH6RvBDNhxNwemRj7KxCzc5jb7zvDSKRnPWIFj9pO+eXqjM69gQJ0r46hSz1x4l9y0651DKWw==", "requires": { - "@remix-run/router": "1.5.0", - "react-router": "6.10.0" + "@remix-run/router": "1.6.2", + "react-router": "6.11.2" } }, "resolve": { diff --git a/client/package.json b/frontend/package.json similarity index 92% rename from client/package.json rename to frontend/package.json index 1fc31444..208323e3 100644 --- a/client/package.json +++ b/frontend/package.json @@ -11,7 +11,7 @@ "dependencies": { "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.10.0" + "react-router-dom": "^6.11.2" }, "devDependencies": { "@types/react": "^18.0.28", diff --git a/client/public/vite.svg b/frontend/public/vite.svg similarity index 100% rename from client/public/vite.svg rename to frontend/public/vite.svg diff --git a/frontend/src/App.css b/frontend/src/App.css new file mode 100644 index 00000000..b9d355df --- /dev/null +++ b/frontend/src/App.css @@ -0,0 +1,42 @@ +#root { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + text-align: center; +} + +.logo { + height: 6em; + padding: 1.5em; + will-change: filter; + transition: filter 300ms; +} +.logo:hover { + filter: drop-shadow(0 0 2em #646cffaa); +} +.logo.react:hover { + filter: drop-shadow(0 0 2em #61dafbaa); +} + +@keyframes logo-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} + +@media (prefers-reduced-motion: no-preference) { + a:nth-of-type(2) .logo { + animation: logo-spin infinite 20s linear; + } +} + +.card { + padding: 2em; +} + +.read-the-docs { + color: #888; +} diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx new file mode 100644 index 00000000..4ba2c9b9 --- /dev/null +++ b/frontend/src/App.jsx @@ -0,0 +1,37 @@ +import { BrowserRouter, Routes, Route } from 'react-router-dom'; +import Layout from './pages/layout/Layout.jsx'; +import Home from './pages/home/Home.jsx'; +import Login from './pages/login/Login.jsx'; +import Signup from './pages/signup/Signup.jsx'; +import Problemsets from './pages/problemsets/Problemsets.jsx'; +import Problems from './pages/problems/Problems.jsx'; +/* + * Temporary problems array schema + */ + + +function App() { + + /* Add routing here, routes look like - + /login - Login page + /signup - Signup page + /problemset/all/ - All problems (see problems array above) + /problems/:problem_slug - A single problem page + */ + + return ( + + + }> + } /> + } /> + } /> + } /> + }/> + + + + ) +} + +export default App diff --git a/client/src/assets/react.svg b/frontend/src/assets/react.svg similarity index 100% rename from client/src/assets/react.svg rename to frontend/src/assets/react.svg diff --git a/frontend/src/components/userform/UserForm.css b/frontend/src/components/userform/UserForm.css new file mode 100644 index 00000000..bf730891 --- /dev/null +++ b/frontend/src/components/userform/UserForm.css @@ -0,0 +1,51 @@ +button { + width: 10rem; + font-size: 1.2rem; +} + +form { + align-items: center; + display: flex; + flex-direction: column; + justfiy-content: center; + width: 100%; +} + +label { + align-items: center; + display: flex; + font-size: 1.2rem; +} + +input { + width: 14rem; + font-size: 1.2rem; +} + +.body { + height: 720px; + align-items: center; +} + +.field { + display: flex; + justify-content: space-around; + width: 100%; +} + +.form-box { + align-items: center; + border-color: black; + border-radius: 2rem; + border-style: solid; + border-width: 0.4rem; + display: flex; + flex-direction: column; + justify-content: space-around; + width: 30rem; + height: 20rem; +} + +.form-type { + text-transform: capitalize; +} \ No newline at end of file diff --git a/frontend/src/components/userform/UserForm.jsx b/frontend/src/components/userform/UserForm.jsx new file mode 100644 index 00000000..b83f94bb --- /dev/null +++ b/frontend/src/components/userform/UserForm.jsx @@ -0,0 +1,24 @@ +import "./UserForm.css"; +import { useRef } from "react"; + +export default function UserForm( {type, onClick} ) { + const usernameRef = useRef(); + const passwordRef = useRef(); + + return ( +
+

{type}

+
+ + +
+
+ + +
+
+ +
+
+ ) +} diff --git a/frontend/src/constants/constants.js b/frontend/src/constants/constants.js new file mode 100644 index 00000000..0120a6e0 --- /dev/null +++ b/frontend/src/constants/constants.js @@ -0,0 +1,3 @@ +export const backendURL = "http://localhost:3000"; +export const languages = ["c", "python", "javascript", "java"]; + diff --git a/frontend/src/index.css b/frontend/src/index.css new file mode 100644 index 00000000..e69de29b diff --git a/client/src/main.jsx b/frontend/src/main.jsx similarity index 100% rename from client/src/main.jsx rename to frontend/src/main.jsx diff --git a/frontend/src/pages/home/BlogData.jsx b/frontend/src/pages/home/BlogData.jsx new file mode 100644 index 00000000..19c36caa --- /dev/null +++ b/frontend/src/pages/home/BlogData.jsx @@ -0,0 +1,74 @@ +const blogData = [ + { + title : "Why use C++", + date : "10 July 2023", + content : "C++ is very fast" + }, + { + title : "Why use C++", + date : "10 July 2023", + content : "C++ is very fast" + }, + { + title : "Why use C++ users hate Java", + date : "2 July 2023", + content : "Java is very verbose" + }, + { + title : "Why Java is better than C++", + date : "5 March 2023", + content : "No Pointers and cross platforms" + }, + { + title : "Why Ai will take your job", + date : "1 March 2023", + content : "Because Ai can do alot of automation, that required humans" + }, + { + title : "What jobs will Ai Create", + date : "28 Feb 2023", + content : "Ai and Ml engineering jobs" + }, + { + title : "Is Python the real chad or Javascript", + date : "15 Feb 2023", + content : "Its like asking is IronMan better than Thor or Captain America" + }, + { + title : "Why use C++", + date : "10 July 2023", + content : "C++ is very fast" + }, + { + title : "Why use C++", + date : "10 July 2023", + content : "C++ is very fast" + }, + { + title : "Why use C++ users hate Java", + date : "2 July 2023", + content : "Java is very verbose" + }, + { + title : "Why Java is better than C++", + date : "5 March 2023", + content : "No Pointers and cross platforms" + }, + { + title : "Why Ai will take your job", + date : "1 March 2023", + content : "Because Ai can do alot of automation, that required humans" + }, + { + title : "What jobs will Ai Create", + date : "28 Feb 2023", + content : "Ai and Ml engineering jobs" + }, + { + title : "Is Python the real chad or Javascript", + date : "15 Feb 2023", + content : "Its like asking is IronMan better than Thor or Captain America" + }, +] + +export default blogData; diff --git a/frontend/src/pages/home/Home.css b/frontend/src/pages/home/Home.css new file mode 100644 index 00000000..829060d3 --- /dev/null +++ b/frontend/src/pages/home/Home.css @@ -0,0 +1,29 @@ +.blog { + background-color: var(--secondary); + border-style: solid solid none solid; + border-width: 5px; + display: flex; + height: 7rem; + flex-direction: column; + justify-content: space-around; + padding: 1rem; + box-shadow: 10px 10px 8px #888888; +} +.blog:first-child { + border-radius: 1rem 1rem 0 0; +} +.blog:last-child { + border-style: solid; + border-radius: 0 0 1rem 1rem; +} + +.blogs { + margin-top: 4rem; + margin-bottom: 7rem; + +} + +.main { + width: 100%; +} + diff --git a/frontend/src/pages/home/Home.jsx b/frontend/src/pages/home/Home.jsx new file mode 100644 index 00000000..82074a00 --- /dev/null +++ b/frontend/src/pages/home/Home.jsx @@ -0,0 +1,28 @@ +import blogData from "./BlogData.jsx"; +import "./Home.css"; + +function Blogs( {blogData} ) { + const blogs = blogData.map((blog, key) => { + return ( +
  • +

    {blog.date}

    +

    {blog.title}

    +

    {blog.content}

    +
  • + ) + }) + + return ( +
      + {blogs} +
    + ) +} + +export default function Home() { + return ( +
    + +
    + ) +} diff --git a/frontend/src/pages/layout/Layout.css b/frontend/src/pages/layout/Layout.css new file mode 100644 index 00000000..60ab1f2c --- /dev/null +++ b/frontend/src/pages/layout/Layout.css @@ -0,0 +1,70 @@ +:root { + font-size: 16px; + --primary: #C4DFDF; + --secondary: #D2E9E9; +} + +* { + margin: 0; + padding: 0; +} + +a { + text-decoration: none; +} + +li { + list-style: none; +} + +.body { + display: flex; + justify-content: center; + width: 100%; + height: max-content; +} + +.container { + margin-left: auto; + margin-right: auto; + width: 90%; +} + +.fill-page { + height: 100%; +} + +.nav { + display: flex; + flex-direction: row; +} + +.navbar { + background-color: var(--primary); + display: flex; + justify-content: center; + width: 100%; + height: 5rem; +} + +.brand { + align-items: center; + display: flex; + font-size: 3rem; +} + +.nav-item { + align-items: center; + display: flex; + font-size: 1.5rem; + justify-content: center; +} + +.nav-list { + display: flex; + justify-content: space-between; + width: 24rem; + height: 100%; + margin: 0 0 0 auto; +} + diff --git a/frontend/src/pages/layout/Layout.jsx b/frontend/src/pages/layout/Layout.jsx new file mode 100644 index 00000000..abf8517e --- /dev/null +++ b/frontend/src/pages/layout/Layout.jsx @@ -0,0 +1,28 @@ +import { useState } from 'react'; +import { Outlet, Link } from 'react-router-dom'; +import './Layout.css'; + +function Navbar() { + return ( +
    +
    +
    Peetcode
    +
      +
    1. Home
    2. +
    3. Login
    4. +
    5. Signup
    6. +
    7. Problemsets
    8. +
    +
    +
    + ) +} + +export default function Layout() { + return ( + <> + + + + ) +} diff --git a/frontend/src/pages/login/Login.css b/frontend/src/pages/login/Login.css new file mode 100644 index 00000000..755ca2ad --- /dev/null +++ b/frontend/src/pages/login/Login.css @@ -0,0 +1,6 @@ +.center { + display: flex; + justify-content: center; + align-items: center; + margin-top: 13rem; +} diff --git a/frontend/src/pages/login/Login.jsx b/frontend/src/pages/login/Login.jsx new file mode 100644 index 00000000..2a389cf2 --- /dev/null +++ b/frontend/src/pages/login/Login.jsx @@ -0,0 +1,36 @@ +import { backendURL } from "../../constants/constants.js"; +import { useState } from "react"; +import UserForm from "../../components/userform/UserForm.jsx"; +import "./Login.css"; + +export default function Login() { + const [message, setMessage] = useState(""); + + async function handleLogin(username, password) { + const response = await fetch( + `${backendURL}/login`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + username: username, + password: password + }) + }) + const json = await response.json(); + localStorage.setItem("token", json.token); + setMessage(() => json.message); + } + + return ( + <> +
    + +
    +

    + {message} +

    + + ) +} diff --git a/frontend/src/pages/problems/CodeArea.jsx b/frontend/src/pages/problems/CodeArea.jsx new file mode 100644 index 00000000..bb3c9ea4 --- /dev/null +++ b/frontend/src/pages/problems/CodeArea.jsx @@ -0,0 +1,40 @@ +import { useRef, useState } from "react"; +import { backendURL, languages } from "../../constants/constants.js" +import { useParams } from 'react-router-dom'; + + +async function handleSubmit(id, language, code) { + fetch(`${backendURL}/problems/${id}`, { + method: "POST", + headers: { + "Content-Type": "application/json", + "Authorization": localStorage.getItem("token") + }, + body: JSON.stringify({ + id, + language, + code + }) + }) +} + +export default function CodeArea({ updateData }) { + const [language, setLanguage] = useState("c") + const codeRef = useRef(null); + const { id } = useParams(); + + return ( +
    + +
    +