diff --git a/.gitignore b/.gitignore index 3902259..8922a3e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,7 @@ !.vscode/launch.json # FILES -.env +.env* +!.env.template src/data/*.json +example.html diff --git a/README.md b/README.md index c7f3ded..fbb0ed9 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,36 @@ -# API Getonboard +# API Jobs Dev -API Rest para buscar empleos desde la pagina de [Getonboard](https://www.getonbrd.com/). Creado con Deno 🦕 +![deno compatibility](https://shield.deno.dev/deno/1.31.1) + +API Rest para buscar empleo en el desarrollo de software. Creado con Deno 🦕 ## Inicio Para iniciar el proyecto debe escribir uno de los siguientes comandos. -```bash + +```sh # Inicia el servidor en modo desarrollo deno task dev # Inicia el servidor en modo producción deno task start ``` -Para cambiar la configuración por defecto debe crear un archivo `.env` en la raiz del proyecto, para esto compie la plantilla incorporada y cambie las variables que desee. -```bash + +Para cambiar la configuración por defecto debe crear un archivo `.env` en la raiz del proyecto, para esto compie la +plantilla incorporada y cambie las variables que desee. + +```sh cp .env.template .env ``` -## API +## Endpoints -| Nombre | Método | Ruta | -| -------- | ------ | --------- | -| Get Jobs | GET | /api/jobs | +| Método | Ruta | Descripción | +| ------ | --------- | ------------------------------------------------ | +| GET | /api/jobs | Obtener todas las ofertas de trabajo | +| GET | /api/docs | Página de documentación de la api (Proximamente) | -Ejemplo de respuesta. +Ejemplo de respuesta para `GET: /api/jobs` ```json { @@ -56,15 +63,19 @@ Ejemplo de respuesta. ] } ``` -## Demo -En la ruta [/demo](./demo/) se encuentra el código fuente de una página de demostración la cual consume la API y muestra los resultados en una interfaz elegante. Esta página ha sido creada con el framework `fresh` y puede ser ejecutada con el comando: -```bash -deno task demo -``` +## Base de Datos Temporal + +Usando el comando `Deno task prepare:db` se crea una base de datos temporal en un archivo json ubicado en +[./src/data/](./src/data/) donde se almacenan todas las ofertas de trabajo recopiladas desde las siguientes fuentes: + +- [x] Get On Board [https://www.getonbrd.com/](https://www.getonbrd.com/) + +- [ ] LinkedIn [https://www.linkedin.com/](https://www.linkedin.com/) ## Lista de Comandos -```bash + +```sh # Prepara los datos e inicia el servidor en modo desarrollo deno task dev @@ -72,13 +83,13 @@ deno task dev deno task start # Prepara los datos necesarios que consumirá la API -deno task scrape +deno task prepare:db # Actualiza deno.lock para sincronizarlo con ./deps.ts -deno task update-lock +deno task update:lock # Prepara husky en el proyecto -deno task prepare-husky +deno task prepare:husky # Ejcuta la página de demostración en el puerto 8000 deno task demo @@ -88,13 +99,16 @@ deno task demo - Primeo realizar un fork a este repositorio en el branch `main`. -- Antes de empezar a crear commits en el proyecto deberá ejecutar el siguiente comando (una única vez) para preparar husky, esto permitirá mantener el codigo siempre limpio antes de subir cambios. -```bash +- Antes de empezar a crear commits en el proyecto deberá ejecutar el siguiente comando (una única vez) para preparar + husky, esto permitirá mantener el codigo siempre limpio antes de subir cambios. + +```sh deno task prepare-husky ``` - Agregue los cambios y cree sus commits. -```bash + +```sh git add . # Para agregar una nueva característica, escriba: @@ -108,7 +122,6 @@ git push origin main - Por último deberá crear un PR al branch `dev`. - ## Licencia [MIT](https://github.com/EdixonAlberto/api-getonboard/blob/main/LICENSE) © Edixon Piña diff --git a/demo/components/Header.tsx b/demo/components/Header.tsx deleted file mode 100644 index 022f47c..0000000 --- a/demo/components/Header.tsx +++ /dev/null @@ -1,9 +0,0 @@ -export function Header() { - return ( -
-

JobsDev

- - icon menu -
- ) -} diff --git a/demo/components/Icons.tsx b/demo/components/Icons.tsx deleted file mode 100644 index 42fbb33..0000000 --- a/demo/components/Icons.tsx +++ /dev/null @@ -1,66 +0,0 @@ -interface IIconProps { - color?: string - size?: number -} - -const COLOR_DEFAULT = '#000' -const SIZE_DEFAULT = 25 - -export function IconHome({ color = COLOR_DEFAULT, size = SIZE_DEFAULT }: IIconProps) { - return ( - - - - ) -} - -export function IconChart({ color = COLOR_DEFAULT, size = SIZE_DEFAULT }: IIconProps) { - return ( - - - - ) -} - -export function IconWallet({ color = COLOR_DEFAULT, size = SIZE_DEFAULT }: IIconProps) { - return ( - - - - ) -} - -export function IconUser({ color = COLOR_DEFAULT, size = SIZE_DEFAULT }: IIconProps) { - return ( - - - - ) -} diff --git a/demo/components/layouts/LayoutMain.tsx b/demo/components/layouts/LayoutMain.tsx deleted file mode 100644 index 8222f96..0000000 --- a/demo/components/layouts/LayoutMain.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { Head } from '$fresh/runtime.ts' -import { JSX } from 'preact' -import { Header } from '$front/components/Header.tsx' -import Tabs from '$front/islands/Tabs.tsx' - -export function LayoutMain({ children }: JSX.ElementChildrenAttribute) { - return ( - <> - - - - - - - -
- {children} - - - ) -} diff --git a/demo/deno.json b/demo/deno.json deleted file mode 100644 index 90bfc5c..0000000 --- a/demo/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "importMap": "../import_map.json", - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "preact" - } -} diff --git a/demo/deno.lock b/demo/deno.lock deleted file mode 100644 index 61ece37..0000000 --- a/demo/deno.lock +++ /dev/null @@ -1,117 +0,0 @@ -{ - "version": "2", - "remote": { - "https://deno.land/std@0.140.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74", - "https://deno.land/std@0.140.0/_util/os.ts": "3b4c6e27febd119d36a416d7a97bd3b0251b77c88942c8f16ee5953ea13e2e49", - "https://deno.land/std@0.140.0/fs/_util.ts": "0fb24eb4bfebc2c194fb1afdb42b9c3dda12e368f43e8f2321f84fc77d42cb0f", - "https://deno.land/std@0.140.0/fs/ensure_dir.ts": "9dc109c27df4098b9fc12d949612ae5c9c7169507660dcf9ad90631833209d9d", - "https://deno.land/std@0.140.0/fs/expand_glob.ts": "0c10130d67c9b02164b03df8e43c6d6defbf8e395cb69d09e84a8586e6d72ac3", - "https://deno.land/std@0.140.0/fs/walk.ts": "117403ccd21fd322febe56ba06053b1ad5064c802170f19b1ea43214088fe95f", - "https://deno.land/std@0.140.0/path/_constants.ts": "df1db3ffa6dd6d1252cc9617e5d72165cd2483df90e93833e13580687b6083c3", - "https://deno.land/std@0.140.0/path/_interface.ts": "ee3b431a336b80cf445441109d089b70d87d5e248f4f90ff906820889ecf8d09", - "https://deno.land/std@0.140.0/path/_util.ts": "c1e9686d0164e29f7d880b2158971d805b6e0efc3110d0b3e24e4b8af2190d2b", - "https://deno.land/std@0.140.0/path/common.ts": "bee563630abd2d97f99d83c96c2fa0cca7cee103e8cb4e7699ec4d5db7bd2633", - "https://deno.land/std@0.140.0/path/glob.ts": "cb5255638de1048973c3e69e420c77dc04f75755524cb3b2e160fe9277d939ee", - "https://deno.land/std@0.140.0/path/mod.ts": "d3e68d0abb393fb0bf94a6d07c46ec31dc755b544b13144dee931d8d5f06a52d", - "https://deno.land/std@0.140.0/path/posix.ts": "293cdaec3ecccec0a9cc2b534302dfe308adb6f10861fa183275d6695faace44", - "https://deno.land/std@0.140.0/path/separator.ts": "fe1816cb765a8068afb3e8f13ad272351c85cbc739af56dacfc7d93d710fe0f9", - "https://deno.land/std@0.140.0/path/win32.ts": "31811536855e19ba37a999cd8d1b62078235548d67902ece4aa6b814596dd757", - "https://deno.land/std@0.150.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74", - "https://deno.land/std@0.150.0/_util/os.ts": "3b4c6e27febd119d36a416d7a97bd3b0251b77c88942c8f16ee5953ea13e2e49", - "https://deno.land/std@0.150.0/async/abortable.ts": "87aa7230be8360c24ad437212311c9e8d4328854baec27b4c7abb26e85515c06", - "https://deno.land/std@0.150.0/async/deadline.ts": "48ac998d7564969f3e6ec6b6f9bf0217ebd00239b1b2292feba61272d5dd58d0", - "https://deno.land/std@0.150.0/async/debounce.ts": "564273ef242bcfcda19a439132f940db8694173abffc159ea34f07d18fc42620", - "https://deno.land/std@0.150.0/async/deferred.ts": "bc18e28108252c9f67dfca2bbc4587c3cbf3aeb6e155f8c864ca8ecff992b98a", - "https://deno.land/std@0.150.0/async/delay.ts": "cbbdf1c87d1aed8edc7bae13592fb3e27e3106e0748f089c263390d4f49e5f6c", - "https://deno.land/std@0.150.0/async/mod.ts": "9852cd8ed897ab2d41a8fbee611d574e97898327db5c19d9d58e41126473f02c", - "https://deno.land/std@0.150.0/async/mux_async_iterator.ts": "5b4aca6781ad0f2e19ccdf1d1a1c092ccd3e00d52050d9c27c772658c8367256", - "https://deno.land/std@0.150.0/async/pool.ts": "ef9eb97b388543acbf0ac32647121e4dbe629236899586c4d4311a8770fbb239", - "https://deno.land/std@0.150.0/async/tee.ts": "bcfae0017ebb718cf4eef9e2420e8675d91cb1bcc0ed9b668681af6e6caad846", - "https://deno.land/std@0.150.0/flags/mod.ts": "594472736e24b2f2afd3451cf7ccd58a21706ce91006478a544fdfa056c69697", - "https://deno.land/std@0.150.0/fs/_util.ts": "2cf50bfb1081c2d5f2efec10ac19abbc2baf478e51cd1b057d0da2f30585b6ba", - "https://deno.land/std@0.150.0/fs/walk.ts": "6ce8d87fbaeda23383e979599ad27f3f94b3e5ff0c0cd976b5fc5c2aa0df7d92", - "https://deno.land/std@0.150.0/http/http_status.ts": "897575a7d6bc2b9123f6a38ecbc0f03d95a532c5d92029315dc9f508e12526b8", - "https://deno.land/std@0.150.0/http/server.ts": "0b0a9f3abfcfecead944b31ee9098a0c11a59b0495bf873ee200eb80e7441483", - "https://deno.land/std@0.150.0/media_types/_util.ts": "ce9b4fc4ba1c447dafab619055e20fd88236ca6bdd7834a21f98bd193c3fbfa1", - "https://deno.land/std@0.150.0/media_types/mod.ts": "2d4b6f32a087029272dc59e0a55ae3cc4d1b27b794ccf528e94b1925795b3118", - "https://deno.land/std@0.150.0/media_types/vendor/mime-db.v1.52.0.ts": "724cee25fa40f1a52d3937d6b4fbbfdd7791ff55e1b7ac08d9319d5632c7f5af", - "https://deno.land/std@0.150.0/path/_constants.ts": "df1db3ffa6dd6d1252cc9617e5d72165cd2483df90e93833e13580687b6083c3", - "https://deno.land/std@0.150.0/path/_interface.ts": "ee3b431a336b80cf445441109d089b70d87d5e248f4f90ff906820889ecf8d09", - "https://deno.land/std@0.150.0/path/_util.ts": "c1e9686d0164e29f7d880b2158971d805b6e0efc3110d0b3e24e4b8af2190d2b", - "https://deno.land/std@0.150.0/path/common.ts": "bee563630abd2d97f99d83c96c2fa0cca7cee103e8cb4e7699ec4d5db7bd2633", - "https://deno.land/std@0.150.0/path/glob.ts": "cb5255638de1048973c3e69e420c77dc04f75755524cb3b2e160fe9277d939ee", - "https://deno.land/std@0.150.0/path/mod.ts": "4945b430b759b0b3d98f2a278542cbcf95e0ad2bd8eaaed3c67322b306b2b346", - "https://deno.land/std@0.150.0/path/posix.ts": "c1f7afe274290ea0b51da07ee205653b2964bd74909a82deb07b69a6cc383aaa", - "https://deno.land/std@0.150.0/path/separator.ts": "fe1816cb765a8068afb3e8f13ad272351c85cbc739af56dacfc7d93d710fe0f9", - "https://deno.land/std@0.150.0/path/win32.ts": "bd7549042e37879c68ff2f8576a25950abbfca1d696d41d82c7bca0b7e6f452c", - "https://deno.land/std@0.150.0/semver/mod.ts": "4a5195fa81b4aede8875a386550a1119f01fb58d74aea899b2cfb136c05a7310", - "https://deno.land/std@0.152.0/async/abortable.ts": "87aa7230be8360c24ad437212311c9e8d4328854baec27b4c7abb26e85515c06", - "https://deno.land/std@0.152.0/async/deadline.ts": "48ac998d7564969f3e6ec6b6f9bf0217ebd00239b1b2292feba61272d5dd58d0", - "https://deno.land/std@0.152.0/async/debounce.ts": "564273ef242bcfcda19a439132f940db8694173abffc159ea34f07d18fc42620", - "https://deno.land/std@0.152.0/async/deferred.ts": "bc18e28108252c9f67dfca2bbc4587c3cbf3aeb6e155f8c864ca8ecff992b98a", - "https://deno.land/std@0.152.0/async/delay.ts": "cbbdf1c87d1aed8edc7bae13592fb3e27e3106e0748f089c263390d4f49e5f6c", - "https://deno.land/std@0.152.0/async/mod.ts": "dd0a8ed4f3984ffabe2fcca7c9f466b7932d57b1864ffee148a5d5388316db6b", - "https://deno.land/std@0.152.0/async/mux_async_iterator.ts": "5b4aca6781ad0f2e19ccdf1d1a1c092ccd3e00d52050d9c27c772658c8367256", - "https://deno.land/std@0.152.0/async/pool.ts": "ef9eb97b388543acbf0ac32647121e4dbe629236899586c4d4311a8770fbb239", - "https://deno.land/std@0.152.0/async/tee.ts": "bcfae0017ebb718cf4eef9e2420e8675d91cb1bcc0ed9b668681af6e6caad846", - "https://deno.land/std@0.152.0/http/server.ts": "0b0a9f3abfcfecead944b31ee9098a0c11a59b0495bf873ee200eb80e7441483", - "https://deno.land/x/code_block_writer@11.0.3/mod.ts": "2c3448060e47c9d08604c8f40dee34343f553f33edcdfebbf648442be33205e5", - "https://deno.land/x/code_block_writer@11.0.3/utils/string_utils.ts": "60cb4ec8bd335bf241ef785ccec51e809d576ff8e8d29da43d2273b69ce2a6ff", - "https://deno.land/x/denoflate@1.2.1/mod.ts": "f5628e44b80b3d80ed525afa2ba0f12408e3849db817d47a883b801f9ce69dd6", - "https://deno.land/x/denoflate@1.2.1/pkg/denoflate.js": "b9f9ad9457d3f12f28b1fb35c555f57443427f74decb403113d67364e4f2caf4", - "https://deno.land/x/denoflate@1.2.1/pkg/denoflate_bg.wasm.js": "d581956245407a2115a3d7e8d85a9641c032940a8e810acbd59ca86afd34d44d", - "https://deno.land/x/esbuild@v0.14.51/mod.d.ts": "c142324d0383c39de0d7660cd207a7f7f52c7198a13d7d3281c0d636a070f441", - "https://deno.land/x/esbuild@v0.14.51/mod.js": "7432566c71fac77637822dc230319c7392a2d2fef51204c9d12c956d7093c279", - "https://deno.land/x/esbuild@v0.14.51/wasm.d.ts": "c142324d0383c39de0d7660cd207a7f7f52c7198a13d7d3281c0d636a070f441", - "https://deno.land/x/esbuild@v0.14.51/wasm.js": "afc1b6927543b664af60ce452c4929e5dc2bb9a0f4ed47b446a6431847c7598e", - "https://deno.land/x/esbuild_deno_loader@0.5.2/deps.ts": "bf83c27b7787b2f245fa0bc0b99f5041aa949c000a81c016cfe828d06b476d37", - "https://deno.land/x/esbuild_deno_loader@0.5.2/mod.ts": "bc111a68f323dbdb6edec68dd558ab732b27866d2ef304708872d763387b65d7", - "https://deno.land/x/esbuild_deno_loader@0.5.2/src/deno.ts": "0e83ccabbe2b004389288e38df2031b79eb347df2d139fce9394d8e88a11f259", - "https://deno.land/x/esbuild_deno_loader@0.5.2/src/native_loader.ts": "343854a566cf510cf25144f7c09fc0c1097780a31830305142a075d12bb697ba", - "https://deno.land/x/esbuild_deno_loader@0.5.2/src/portable_loader.ts": "35b6c526eed8c2c781a3256b23c30aa7cce69c0ef1d583c15528663287ba18a3", - "https://deno.land/x/esbuild_deno_loader@0.5.2/src/shared.ts": "b64749cd8c0f6252a11498bd8758ef1220003e46b2c9b68e16da63fd7e92b13a", - "https://deno.land/x/fresh@1.1.3/dev.ts": "a66c7d64be35bcd6a8e12eec9c27ae335044c70363a241f2e36ee776db468622", - "https://deno.land/x/fresh@1.1.3/runtime.ts": "b02ec1e2e32cf73a33d262b7c9dcab9468ce16cd89fd424196c71003698a4ab0", - "https://deno.land/x/fresh@1.1.3/server.ts": "f379c9aad24471a71e58fb887fa57e5cc27ad9df035987eb260541c78df38e84", - "https://deno.land/x/fresh@1.1.3/src/dev/deps.ts": "de5470828c17839c0b52c328e6709f3477740b9800deaf724d6569b64b1d3872", - "https://deno.land/x/fresh@1.1.3/src/dev/error.ts": "21a38d240c00279662e6adde41367f1da0ae7e2836d993f818ea94aabab53e7b", - "https://deno.land/x/fresh@1.1.3/src/dev/mod.ts": "f5836b2eccd0efd7c0a726a121f174a974daefc22058f759f07d4df56c46e978", - "https://deno.land/x/fresh@1.1.3/src/runtime/csp.ts": "9ee900e9b0b786057b1009da5976298c202d1b86d1f1e4d2510bde5f06530ac9", - "https://deno.land/x/fresh@1.1.3/src/runtime/head.ts": "0f9932874497ab6e57ed1ba01d549e843523df4a5d36ef97460e7a43e3132fdc", - "https://deno.land/x/fresh@1.1.3/src/runtime/utils.ts": "8320a874a44bdd5905c7d4b87a0e7a14a6c50a2ed133800e72ae57341e4d4faa", - "https://deno.land/x/fresh@1.1.3/src/server/bundle.ts": "7fb20c084948894b8eca90984ef92c3f6d12a194910ecb9adee21ace9f1607bb", - "https://deno.land/x/fresh@1.1.3/src/server/constants.ts": "ad10dda1bc20c25c2926f6a8cfd79ef4368d70b4b03a645f65c04b3fa7d93a8c", - "https://deno.land/x/fresh@1.1.3/src/server/context.ts": "bf16ec4b6deccf0b588a294814d636bc1648647860ade31dbfdb8dc3e3435634", - "https://deno.land/x/fresh@1.1.3/src/server/default_error_page.ts": "9a1a595a1a2b31c9b724b04db82b8af256285536db272658d831ac9ef1d3d448", - "https://deno.land/x/fresh@1.1.3/src/server/deps.ts": "1b467e4d00109356b06117a9f2e5a21a2b48353a0e573b25cdbbfe7e9cfccb34", - "https://deno.land/x/fresh@1.1.3/src/server/htmlescape.ts": "834ac7d0caa9fc38dffd9b8613fb47aeecd4f22d5d70c51d4b20a310c085835c", - "https://deno.land/x/fresh@1.1.3/src/server/mod.ts": "72d213444334dd2e94c757a0eee0fc486c0919399ea9184d07ad042f34edd00d", - "https://deno.land/x/fresh@1.1.3/src/server/render.ts": "6f50707bd1f6e33ed84bb71ae3b0996d202b953cefc4285f5356524c7b21f01f", - "https://deno.land/x/fresh@1.1.3/src/server/types.ts": "dde992ab4ee635df71a7fc96fe4cd85943c1a9286ea8eb586563d5f5ca154955", - "https://deno.land/x/importmap@0.2.1/_util.ts": "ada9a9618b537e6c0316c048a898352396c882b9f2de38aba18fd3f2950ede89", - "https://deno.land/x/importmap@0.2.1/mod.ts": "ae3d1cd7eabd18c01a4960d57db471126b020f23b37ef14e1359bbb949227ade", - "https://deno.land/x/rutt@0.0.14/mod.ts": "5027b8e8b12acca48b396a25aee74ad7ee94a25c24cda75571d7839cbd41113c", - "https://deno.land/x/ts_morph@16.0.0/common/DenoRuntime.ts": "537800e840d0994f9055164e11bf33eadf96419246af0d3c453793c3ae67bdb3", - "https://deno.land/x/ts_morph@16.0.0/common/mod.ts": "01985d2ee7da8d1caee318a9d07664774fbee4e31602bc2bb6bb62c3489555ed", - "https://deno.land/x/ts_morph@16.0.0/common/ts_morph_common.d.ts": "39f2ddefd4995e4344236c44c2bf296069149f45ef6f00440b56e7b32cb2b3bd", - "https://deno.land/x/ts_morph@16.0.0/common/ts_morph_common.js": "7d908bf4f416aa96de956dc11ecc83b585bed297e16418d496ca04a3481067e0", - "https://deno.land/x/ts_morph@16.0.0/common/typescript.d.ts": "df7dd83543f14081ca74918d5a80ff60f634f465746cf2aff8924b28bcc3b152", - "https://deno.land/x/ts_morph@16.0.0/common/typescript.js": "5c59651248a4c41b25fa7beee8e0d0d0fab5f439fa72d478e65abd8241aa533c", - "https://deno.land/x/ts_morph@16.0.0/mod.ts": "adba9b82f24865d15d2c78ef6074b9a7457011719056c9928c800f130a617c93", - "https://deno.land/x/ts_morph@16.0.0/ts_morph.d.ts": "38668b0e3780282a56a805425494490b0045d1928bd040c47a94095749dab8c3", - "https://deno.land/x/ts_morph@16.0.0/ts_morph.js": "9fc0f3d6a3997c2df023fabc4e529d2117d214ffd4fd04247ca2f56c4e9cd470", - "https://esm.sh/*preact-render-to-string@5.2.4": "a4b191d09671af764e91a4cd6a79c357f79632910d78f69baec4148d6983fdd5", - "https://esm.sh/preact@10.11.0": "e888b244446037c56f1881173fb51d1f5fa7aae5599e6c5154619346a6a5094e", - "https://esm.sh/preact@10.11.0/hooks": "2b8ec155eb8b87501663f074acff1d55a9114fa7d88f0b39da06c940af1ff736", - "https://esm.sh/preact@10.11.0/jsx-runtime": "5c123264f19799ab243211132dded45f6d42d594b5c78dd585f947d07bf20eae", - "https://esm.sh/stable/preact@10.11.0/deno/hooks.js": "48b7674c1f0c2a0f8a0f758b786f5bc15ba0f7a4f3a356ecc783848f1e4a1c55", - "https://esm.sh/stable/preact@10.11.0/deno/jsx-runtime.js": "b5a8e96758c20b5dea05802c6f6962b8a95bfdbd476eb4ea51cf3234f6e09271", - "https://esm.sh/stable/preact@10.11.0/deno/preact.js": "071b515099e5dff2fe56768be62644e32fab702b194171357ccc4d7d1210144a", - "https://esm.sh/v102/preact-render-to-string@5.2.4/X-ZS8q/deno/preact-render-to-string.js": "75aad97b00d5ad63383de7f729a3f1fea59e69a9b876db5551d9c746ed372f82", - "https://esm.sh/v102/preact-render-to-string@5.2.4/X-ZS8q/src/index.d.ts": "b1d73703252c8570fdf2952475805f5808ba3511fefbd93a3e7bd8406de7dcd0", - "https://esm.sh/v102/preact@10.11.0/hooks/src/index.d.ts": "5c29febb624fc25d71cb0e125848c9b711e233337a08f7eacfade38fd4c14cc3", - "https://esm.sh/v102/preact@10.11.0/jsx-runtime/src/index.d.ts": "e153460ed2b3fe2ad8b93696ecd48fbf73cd628b0b0ea6692b71804a3af69dfd", - "https://esm.sh/v102/preact@10.11.0/src/index.d.ts": "1a5c331227be54be6515b0c92a469d352834fa413963ae84a39a05a3177111f6", - "https://esm.sh/v102/preact@10.11.0/src/jsx.d.ts": "c423715fd7992b2e1446fea11d2d04e8adbd66c1edca1ce5e85f90e0d26a2eb2" - } -} diff --git a/demo/dev.ts b/demo/dev.ts deleted file mode 100755 index c3fc7b7..0000000 --- a/demo/dev.ts +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env -S deno run -A --watch=static/,routes/ - -import dev from '$fresh/dev.ts' - -await dev(import.meta.url, './main.ts') diff --git a/demo/fresh.gen.ts b/demo/fresh.gen.ts deleted file mode 100644 index bd77282..0000000 --- a/demo/fresh.gen.ts +++ /dev/null @@ -1,26 +0,0 @@ -// DO NOT EDIT. This file is generated by fresh. -// This file SHOULD be checked into source version control. -// This file is automatically updated during development when running `dev.ts`. - -import config from './deno.json' assert { type: 'json' } -import * as $0 from './routes/index.tsx' -import * as $1 from './routes/profile.tsx' -import * as $$0 from './islands/Jobs.tsx' -import * as $$1 from './islands/Search.tsx' -import * as $$2 from './islands/Tabs.tsx' - -const manifest = { - routes: { - './routes/index.tsx': $0, - './routes/profile.tsx': $1, - }, - islands: { - './islands/Jobs.tsx': $$0, - './islands/Search.tsx': $$1, - './islands/Tabs.tsx': $$2, - }, - baseUrl: import.meta.url, - config, -} - -export default manifest diff --git a/demo/islands/Jobs.tsx b/demo/islands/Jobs.tsx deleted file mode 100644 index 14dcce1..0000000 --- a/demo/islands/Jobs.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { useEffect, useState } from 'preact/hooks' -import Search from '$front/islands/Search.tsx' -import { IJob, TResponseAPI } from '$types' - -export default function Jobs() { - const [jobs, setJobs] = useState([]) - - useEffect(() => { - getJobs() - }, []) - - async function getJobs(): Promise { - const response = await fetch('http://localhost:4000/api/jobs', { - headers: { - 'Authorization': 'Bearer 123', - }, - }) - const data = await response.json() as TResponseAPI<{ total: number; data: IJob[] }> - if (data.response) { - const jobs = data.response.data.filter((job) => job.details.postulations < 10) - setJobs(jobs) - } else { - // TODO: loading false - } - } - - return ( -
-
-

JobsDev es el destino número uno para buscar y listar increibles ofertas de trabajo remoto.

- -

Últimos Trabajos

-
- -
    - {jobs.length - ? jobs.map((job: IJob) => ( -
  • -
    - {job.title} - {job.isNew && Nuevo} -
    - -
    -
    - icon company - {job.companyName} -
    - -
    - icon location - {job.location} -
    - - Ver Detalles -
    -
  • - )) - :

    No hay trabajos publicados

    } -
-
- ) -} diff --git a/demo/islands/Search.tsx b/demo/islands/Search.tsx deleted file mode 100644 index d0e59f5..0000000 --- a/demo/islands/Search.tsx +++ /dev/null @@ -1,13 +0,0 @@ -export default function Search() { - return ( - - ) -} diff --git a/demo/islands/Tabs.tsx b/demo/islands/Tabs.tsx deleted file mode 100644 index c5b0c7b..0000000 --- a/demo/islands/Tabs.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { useState } from 'preact/hooks' -import { IconChart, IconHome, IconUser, IconWallet } from '$front/components/Icons.tsx' - -export default function Tabs() { - const [tab, setTab] = useState('') - - return ( -
-
    -
  • setTab('')}> - - Inicio -
  • - -
  • setTab('statistics')}> - - Estadisticas -
  • - -
  • setTab('subs')}> - - Subscripción -
  • - -
  • setTab('profile')}> - - Perfil -
  • -
-
- ) -} diff --git a/demo/main.ts b/demo/main.ts deleted file mode 100644 index 7b09c13..0000000 --- a/demo/main.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// -/// -/// -/// -/// - -import { start } from '$fresh/server.ts' -import manifest from './fresh.gen.ts' - -await start(manifest) diff --git a/demo/routes/index.tsx b/demo/routes/index.tsx deleted file mode 100644 index 35f0e1c..0000000 --- a/demo/routes/index.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { Head } from '$fresh/runtime.ts' -import { LayoutMain } from '$front/components/layouts/LayoutMain.tsx' -import Jobs from '$front/islands/Jobs.tsx' - -export default function Home() { - return ( - <> - - JobsDev - - - - - - - ) -} diff --git a/demo/routes/profile.tsx b/demo/routes/profile.tsx deleted file mode 100644 index df7c0b2..0000000 --- a/demo/routes/profile.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { LayoutMain } from '$front/components/layouts/LayoutMain.tsx' -import { Head } from '$fresh/runtime.ts' - -export default function profile() { - return ( - - - JobsDev | Perfil - - -
- Profile -
-
- ) -} diff --git a/demo/static/favicon.ico b/demo/static/favicon.ico deleted file mode 100644 index 1cfaaa2..0000000 Binary files a/demo/static/favicon.ico and /dev/null differ diff --git a/demo/static/fonts/ProductSansBold.ttf b/demo/static/fonts/ProductSansBold.ttf deleted file mode 100644 index d847195..0000000 Binary files a/demo/static/fonts/ProductSansBold.ttf and /dev/null differ diff --git a/demo/static/fonts/ProductSansRegular.ttf b/demo/static/fonts/ProductSansRegular.ttf deleted file mode 100644 index c0442ee..0000000 Binary files a/demo/static/fonts/ProductSansRegular.ttf and /dev/null differ diff --git a/demo/static/styles/components/general.css b/demo/static/styles/components/general.css deleted file mode 100644 index 5eb9812..0000000 --- a/demo/static/styles/components/general.css +++ /dev/null @@ -1,35 +0,0 @@ -.jd__icon { - display: block; - width: 25px; - height: 25px; -} - -.jd__input { - height: 58px; - width: auto; - display: flex; - align-items: center; - justify-content: space-around; - border-radius: 10px; -} - -.jd__input input { - height: 100%; - width: 100%; - padding: 0; - outline: none; - border: none; - border-radius: inherit; - background: inherit; - color: var(--color-grey); - font-size: 16px; - font-family: 'ProductSans'; - font-weight: 400; -} - -.search__input input::placeholder { - color: var(--color-grey); - font-size: 16px; - font-family: 'ProductSans'; - font-weight: 400; -} diff --git a/demo/static/styles/components/header.css b/demo/static/styles/components/header.css deleted file mode 100644 index eec1979..0000000 --- a/demo/static/styles/components/header.css +++ /dev/null @@ -1,19 +0,0 @@ -.jd__headers { - height: 80px; - width: 100%; - padding: 0 40px; - position: fixed; - display: flex; - align-items: flex-end; - justify-content: space-between; - z-index: 1000; -} - -.header__title { - margin: 0; - text-align: left; -} - -.header__icon { - cursor: pointer; -} diff --git a/demo/static/styles/components/jobs.css b/demo/static/styles/components/jobs.css deleted file mode 100644 index a289fbd..0000000 --- a/demo/static/styles/components/jobs.css +++ /dev/null @@ -1,109 +0,0 @@ -.jobs { - padding-top: 80px; - overflow-y: hidden; -} - -.jobs__header { - padding: 40px 40px 10px 40px; - position: relative; - text-align: center; - border-radius: 0 0 90px; - z-index: 2; -} - -.jobs__header::before { - content: ''; - height: calc(100% + 80px); - width: 100%; - position: absolute; - top: -80px; - left: 0; - right: 0; - background: var(--color-green-dark); - background: linear-gradient(300deg, var(--color-green-lite) 0%, var(--color-green-dark) 50%); - z-index: 0; -} - -.jobs__header p { - margin-top: 0; - position: relative; - font-size: 18px; - color: var(--color-grey-dark); -} - -.jobs__header__title { - margin-top: 40px; - position: relative; - text-align: left; - font-size: 18px; - z-index: 2; -} - -.jobs__main__container { - list-style: none; - height: calc(100vh - 80px - 250px); - margin: 0; - padding: 20px 40px 0 40px; - background: var(--color-grey-lite); - overflow-y: scroll; -} - -.jobs__main__container::-webkit-scrollbar { - /* display: none; */ -} - -.jobs__container__card { - margin-bottom: 15px; - padding: 20px 40px; - position: relative; - border: none; - border-radius: 10px; - box-shadow: 0px 2px 2px 0px #ededed; - background: #fff; - z-index: 2; - transition: 0.25s ease-in 0s transform; -} - -.jobs__container__card:hover { - transform: scale(1.1); -} - -.jobs__card__title { - display: flex; - align-items: center; - justify-content: space-between; -} - -.jobs__card__title span:nth-child(1) { - font-size: 15px; - font-weight: 700; -} - -.jobs__card__title span:nth-child(2) { - background: #fdfd23; - padding: 5px; - font-size: 12px; - font-weight: 700; - border-radius: 1px; -} - -.jobs__card__content { - margin: 10px 0; -} - -.jobs__card__content__item { - margin-bottom: 2px; - display: flex; - align-items: center; - justify-content: flex-start; - column-gap: 8px; -} - -.jobs__card__content__item .jd__icon { - height: 14px; - width: 14px; -} - -.jobs__card__content__item span { - font-size: 14px; -} diff --git a/demo/static/styles/components/search.css b/demo/static/styles/components/search.css deleted file mode 100644 index 9c6d348..0000000 --- a/demo/static/styles/components/search.css +++ /dev/null @@ -1,26 +0,0 @@ -.search { - position: relative; -} - -.search__input { - background: #fff; -} - -.search__input input { - width: calc(100% - 20% - 35px); -} - -.search__icon { - height: 35px; - width: 35px; - border-radius: 50%; - background: var(--color-yellow); - display: flex; - align-items: center; - justify-content: center; -} - -.search__icon img { - height: 12px; - width: 12px; -} diff --git a/demo/static/styles/components/tabs.css b/demo/static/styles/components/tabs.css deleted file mode 100644 index 2177f67..0000000 --- a/demo/static/styles/components/tabs.css +++ /dev/null @@ -1,43 +0,0 @@ -.tabs { - user-select: none; - height: calc(85px + 20px); - width: auto; - margin: auto; - position: fixed; - bottom: 0; - left: 0; - right: 0; - background: #fff; - box-shadow: 0px -4px 20px -14px #000; - z-index: 1000; -} - -.tabs__items { - list-style: none; - height: 100%; - width: 100%; - padding: 0; - margin: 0; - display: flex; - align-items: center; - justify-content: space-between; -} - -.tabs__items__tab { - height: 100%; - width: 100%; - padding: 0 10px; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - row-gap: 10px; -} - -.tabs__items__tab.active { - background: var(--color-green-dark); -} - -.tabs__items__tab.active span { - font-weight: 600; -} diff --git a/demo/static/styles/main.css b/demo/static/styles/main.css deleted file mode 100644 index 4ba8510..0000000 --- a/demo/static/styles/main.css +++ /dev/null @@ -1,12 +0,0 @@ -@import './utils/normalize.css'; -@import './utils/variables.css'; -@import './utils/typography.css'; - -@import './components/general.css'; -@import './components/header.css'; -@import './components/search.css'; -@import './components/tabs.css'; -@import './components/jobs.css'; -@import './components/jobs.css'; - -@import './pages/profile.css'; diff --git a/demo/static/styles/pages/profile.css b/demo/static/styles/pages/profile.css deleted file mode 100644 index 9380cf7..0000000 --- a/demo/static/styles/pages/profile.css +++ /dev/null @@ -1,3 +0,0 @@ -.profile { - padding-top: 80px; -} diff --git a/demo/static/styles/utils/normalize.css b/demo/static/styles/utils/normalize.css deleted file mode 100644 index bf23764..0000000 --- a/demo/static/styles/utils/normalize.css +++ /dev/null @@ -1,12 +0,0 @@ -* { - /* DEV */ - /* outline: 1px solid red; */ - box-sizing: border-box; -} - -body { - margin: 0; - padding: 0; - background: var(--color-grey-lite); - overflow-y: hidden; -} diff --git a/demo/static/styles/utils/typography.css b/demo/static/styles/utils/typography.css deleted file mode 100644 index 9ee426c..0000000 --- a/demo/static/styles/utils/typography.css +++ /dev/null @@ -1,26 +0,0 @@ -@font-face { - src: url('../../fonts/ProductSansBold.ttf') format('truetype'); - font-family: 'ProductSans'; - font-weight: 700; -} - -@font-face { - src: url('../../fonts/ProductSansRegular.ttf') format('truetype'); - font-family: 'ProductSans'; - font-weight: 400; -} - -body { - font-family: 'ProductSans'; -} - -.fd-title { - font-size: 25px; - font-weight: 700; -} - -.fd-text { - font-size: 15px; - font-weight: 400; - color: #000; -} diff --git a/demo/static/styles/utils/variables.css b/demo/static/styles/utils/variables.css deleted file mode 100644 index a059404..0000000 --- a/demo/static/styles/utils/variables.css +++ /dev/null @@ -1,8 +0,0 @@ -:root { - --color-yellow: #ffe70a; - --color-grey: #9f9f9f; - --color-grey-lite: #f6f6f6; - --color-grey-dark: #4d4d4d; - --color-green-lite: #c1ffe2; - --color-green-dark: rgb(79, 255, 170); -} diff --git a/demo/static/svgs/company.svg b/demo/static/svgs/company.svg deleted file mode 100644 index 9566891..0000000 --- a/demo/static/svgs/company.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/demo/static/svgs/location.svg b/demo/static/svgs/location.svg deleted file mode 100644 index 67b8710..0000000 --- a/demo/static/svgs/location.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/demo/static/svgs/menu.svg b/demo/static/svgs/menu.svg deleted file mode 100644 index a31f55e..0000000 --- a/demo/static/svgs/menu.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/demo/static/svgs/search.svg b/demo/static/svgs/search.svg deleted file mode 100644 index 6dd7852..0000000 --- a/demo/static/svgs/search.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/deno.json b/deno.json index fcf1135..999eba1 100644 --- a/deno.json +++ b/deno.json @@ -2,11 +2,10 @@ "tasks": { "dev": "deno run --allow-env --allow-read --allow-net --watch src/main.ts", "start": "deno run --allow-env --allow-read --allow-net src/main.ts", - "scrape": "deno run --allow-env --allow-read --allow-net --allow-write ./src/scraping/jobs.ts", - "update-lock": "deno cache --lock=deno.lock --lock-write ./deps.ts", - "prepare-husky": "deno run --allow-env --allow-read --allow-write --allow-run ./tools/prepare-husky.ts", - "test": "deno test --allow-env --allow-read --allow-net", - "demo": "deno run -A --watch=demo/static/,demo/routes/ demo/dev.ts" + "prepare:db": "deno run --allow-env --allow-read --allow-net --allow-write ./src/scraping/jobs.ts", + "update:lock": "deno cache --lock=deno.lock --lock-write ./deps.ts", + "prepare:husky": "deno run --allow-env --allow-read --allow-write --allow-run ./tools/prepare-husky.ts", + "test": "deno test --allow-env --allow-read --allow-net" }, "importMap": "./import_map.json", "compilerOptions": { diff --git a/import_map.json b/import_map.json index c887e37..336a90a 100644 --- a/import_map.json +++ b/import_map.json @@ -6,12 +6,7 @@ "$DTOs": "./src/dto/index.ts", "$front/": "./demo/", "husky": "npm:husky", - "superoak": "https://deno.land/x/superoak@4.7.0/mod.ts", - "$fresh/": "https://deno.land/x/fresh@1.1.3/", - "preact": "https://esm.sh/preact@10.11.0", - "preact/": "https://esm.sh/preact@10.11.0/", - "preact-render-to-string": "https://esm.sh/*preact-render-to-string@5.2.4", - "@preact/signals": "https://esm.sh/*@preact/signals@1.0.3", - "@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.0.1" + "cheerio/types": "https://esm.sh/cheerio@1.0.0-rc.12", + "superoak": "https://deno.land/x/superoak@4.7.0/mod.ts" } } diff --git a/tools/prepare-husky.ts b/tools/prepare-husky.ts index a42afb9..f45a3f3 100644 --- a/tools/prepare-husky.ts +++ b/tools/prepare-husky.ts @@ -2,4 +2,4 @@ import { install, set } from 'husky'; install(); -set('.husky/pre-commit', 'deno fmt && deno lint && deno task test && deno task update-lock'); +set('.husky/pre-commit', 'deno fmt && deno lint && deno task test && deno task update:lock');