{"id":19878846,"url":"https://github.com/jakubkorytko/web-tools","last_synced_at":"2026-06-15T07:31:46.048Z","repository":{"id":213352105,"uuid":"661720648","full_name":"JakubKorytko/web-tools","owner":"JakubKorytko","description":"A toolkit for simplifying the digital realm, offering lightning-fast link shortening and seamless file hosting","archived":false,"fork":false,"pushed_at":"2023-12-29T14:15:00.000Z","size":2030,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-11T17:49:14.113Z","etag":null,"topics":["file-hosting","jwt","mit-license","open-source","url-shortener"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JakubKorytko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-03T13:49:45.000Z","updated_at":"2023-12-21T14:06:08.000Z","dependencies_parsed_at":"2023-12-27T14:43:36.769Z","dependency_job_id":"897359e3-8eab-4938-a2ba-c25f7bf1ec7e","html_url":"https://github.com/JakubKorytko/web-tools","commit_stats":null,"previous_names":["jakubkorytko/web-tools"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakubKorytko%2Fweb-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakubKorytko%2Fweb-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakubKorytko%2Fweb-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakubKorytko%2Fweb-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JakubKorytko","download_url":"https://codeload.github.com/JakubKorytko/web-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241309093,"owners_count":19941722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["file-hosting","jwt","mit-license","open-source","url-shortener"],"created_at":"2024-11-12T17:06:52.225Z","updated_at":"2026-06-15T07:31:40.998Z","avatar_url":"https://github.com/JakubKorytko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web Tools\n\n[![Version](https://img.shields.io/github/v/tag/JakubKorytko/web-tools?style=for-the-badge\u0026label=version)](https://img.shields.io/github/v/tag/JakubKorytko/web-tools?style=for-the-badge\u0026label=version)\n[![License](https://img.shields.io/github/license/JakubKorytko/web-tools?style=for-the-badge)](https://img.shields.io/github/license/JakubKorytko/web-tools?style=for-the-badge\u0026label=license)\n\n![React](https://img.shields.io/badge/react-%2320232a.svg?style=for-the-badge\u0026logo=react\u0026logoColor=%2361DAFB)\n![React Router](https://img.shields.io/badge/React_Router-CA4245?style=for-the-badge\u0026logo=react-router\u0026logoColor=white)\n![JavaScript](https://img.shields.io/badge/javascript-%23323330.svg?style=for-the-badge\u0026logo=javascript\u0026logoColor=%23F7DF1E)\n![Bootstrap](https://img.shields.io/badge/bootstrap-%238511FA.svg?style=for-the-badge\u0026logo=bootstrap\u0026logoColor=white)\n![React Testing-Library](https://img.shields.io/badge/-React_Testing_Library-%23E33332?style=for-the-badge\u0026logo=testing-library\u0026logoColor=white)\n![Jest](https://img.shields.io/badge/-jest-%23C21325?style=for-the-badge\u0026logo=jest\u0026logoColor=white)\n![HTML5](https://img.shields.io/badge/html5-%23E34F26.svg?style=for-the-badge\u0026logo=html5\u0026logoColor=white)\n![CSS3](https://img.shields.io/badge/css3-%231572B6.svg?style=for-the-badge\u0026logo=css3\u0026logoColor=white)\n![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge\u0026logo=node.js\u0026logoColor=white)\n![NPM](https://img.shields.io/badge/NPM-%23CB3837.svg?style=for-the-badge\u0026logo=npm\u0026logoColor=white)\n![Express.js](https://img.shields.io/badge/express.js-%23404d59.svg?style=for-the-badge\u0026logo=express\u0026logoColor=%2361DAFB)\n![jQuery](https://img.shields.io/badge/jquery-%230769AD.svg?style=for-the-badge\u0026logo=jquery\u0026logoColor=white)\n![ESLint](https://img.shields.io/badge/ESLint-4B3263?style=for-the-badge\u0026logo=eslint\u0026logoColor=white)\n![SQLite](https://img.shields.io/badge/sqlite-%2307405e.svg?style=for-the-badge\u0026logo=sqlite\u0026logoColor=white)\n![Stylelint](https://img.shields.io/badge/stylelint-%23FFFFFF.svg?style=for-the-badge\u0026logo=stylelint\u0026logoColor=%23000000)\n![JWT](https://img.shields.io/badge/JWT-black?style=for-the-badge\u0026logo=JSON%20web%20tokens)\n![Create React App](https://img.shields.io/badge/Create_React_App-%2320232a.svg?style=for-the-badge\u0026logo=react\u0026logoColor=%2309D3AC)\n\n## Table of Contents\n\n- [Web Tools](#web-tools)\n  - [Table of Contents](#table-of-contents)\n  - [Introduction](#introduction)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n    - [Client installation](#client-installation)\n    - [Server installation](#server-installation)\n  - [Demo mode](#demo-mode)\n  - [Sample user](#sample-user)\n  - [Endpoints](#endpoints)\n    - [Client endpoints](#client-endpoints)\n      - [Client endpoints protected by authentication](#client-endpoints-protected-by-authentication)\n    - [Server endpoints](#server-endpoints)\n      - [Server authentication protected endpoints](#server-authentication-protected-endpoints)\n  - [Production build](#production-build)\n  - [Tests](#tests)\n  - [Troubleshooting](#troubleshooting)\n  - [Contributing](#contributing)\n  - [Contact](#contact)\n  - [License](#license)\n  - [TODO / Upcoming features](#todo--upcoming-features)\n\n## Introduction\n\nWelcome to the Web Tools digital toolkit – a powerful solution designed to simplify your online experience. This project is crafted with the aim of providing lightning-fast link shortening and seamless file hosting, making your digital interactions smoother and more efficient.\n\nIn an era where the digital realm is vast and ever-expanding, managing links and files can become a cumbersome task. This toolkit is here to change that. Whether you're looking to share concise links or host files effortlessly, this project offers a robust set of tools to streamline your online activities.\n\n## Prerequisites\n\n**Note:** Versions stated below are the ones used during development. Other versions may work as well, but they have not been tested.\n\n- [Node.js](https://nodejs.org/en/) `v20.10.0`\n- [NPM](https://www.npmjs.com/) `v10.2.3`\n\n## Installation\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/JakubKorytko/web-tools\n    ```\n\n1. Enter the project directory:\n\n    ```bash\n    cd web-tools\n    ```\n\n**Note:** Install \u0026 run the client and the server apps (next steps) in separate terminals starting from the project directory.\nRunning the apps will freeze the terminal until you stop them.\n\n### Client installation\n\n1. Enter the client directory:\n\n    ```bash\n    cd client\n    ```\n\n1. Create `.env` file (or set environment variables manually):\n\n    ```bash\n    REACT_APP_SERVER_URL= # URL of the server app\n    REACT_APP_SHORT_URL_PATH= # path to the link shortening endpoint, e.g. /short\n    REACT_APP_FILE_URL_PATH= # path to the file hosting endpoint, e.g. /file\n    REACT_APP_DEMO= # true if you want to use the demo mode, false otherwise (see below)\n    ```\n\n    *Refer to the [`client/.env.example`](client/.env.example) file for an example.*\n\n1. Install dependencies:\n\n    ```bash\n    npm install\n    ```\n\n1. Start the app:\n\n    ```bash\n    npm start\n    ```\n\n### Server installation\n\n1. Enter the server directory:\n\n    ```bash\n    cd server\n    ```\n\n1. Create `.env` file (or set environment variables manually):\n\n    ```bash\n    SECRET= # secret used to sign JWT tokens\n    PORT= # port on which the server will run\n    URI= # whole URI of the server, e.g. http://localhost:3000\n    DEMO= # true if you want to use the demo mode, false otherwise (see below)\n    ```\n\n    *Refer to the [`server/.env.example`](server/.env.example) file for an example.*\n\n1. Install dependencies:\n\n    ```bash\n    npm install\n    ```\n\n1. Start the app:\n\n    ```bash\n    npm start\n    ```\n\n**Note:** Both the client and the server apps need to be running for the project to work.\n\n## Demo mode\n\nIn the environment variables, you can set the `DEMO` (`REACT_APP_DEMO` in the client app) variable to `true` to use the demo mode.\nIn the demo mode, many features are disabled (e.g. you cannot add new links or files to the database or delete existing ones).\nThis setting is designed strictly for future demo of the repository and does not provide any real functionality.\n**You should always set it to `false` if you want to use the app normally.**\nThis setting will have its default value set to `false` in one of the next patches so that you don't have to worry about it.\n\n## Sample user\n\nThe app comes with a sample user that you can use to log in and test the app.\\\nThe user is hardcoded at the moment, but this will change in the future.\n\n- username: `johndoe`\n- password: `qwerty123`\n\nTo change the user credentials, edit the `server/src/auth.js` file.\nSet the value of `CREDENTIALS` (line 3) to base64-encoded `id|username|password` string.\n\n## Endpoints\n\n### Client endpoints\n\n- `GET /login` - login page\n- `GET /link/:link` - redirect to the link from the database, params:\n  - `link` - string, link to use\n- `GET /file/:link` - get file from the database, params:\n  - `link` - string, link to use\n\n#### Client endpoints protected by authentication\n\nThese endpoints are protected by authentication. To access them, you need to log in first.\nIf you try to access them without logging in, you will be redirected to the login page.\n\n- `GET /` - home page\n- `GET /files` - file hosting page\n- `GET /links` - link shortening page\n\n### Server endpoints\n\nThe client app uses the server app for authentication and data storage.\nThere is no need to use the server app directly, but if you want to (or want to use the API for something else),\nhere are the available endpoints:\n\n- `GET /get` - get table data, payload:\n  - `table` - string, table name\n- `GET /file/:link` - get file from the database, params:\n  - `link` - string, link to use\n- `GET /short/:link` - get link from the database, params:\n  - `link` - string, link to use\n- `POST /login` - login endpoint, payload:\n  - `username` - string\n  - `password` - string\n\n#### Server authentication protected endpoints\n\nThese endpoints require a valid JWT token to work. The token should be passed in the `Authorization` header.\n\n- `GET /` - temporary endpoint, returns a \"WebTools API\" message\n- `POST /auth` - authentication endpoint, returns a username if the token is valid\n- `POST /add` - add new link to the database, payload:\n  - `src` - string, link to shorten\n  - `link` - string, link to use\n- `POST /addFile` - add new file to the database, payload (form-data):\n  - `file` - file, file to upload\n  - `link` - string, link to use\n- `POST /del` - delete table data, payload:\n  - `table` - string, table name\n  - `id` - integer, row ID\n\n## Production build\n\nTo build the app for production, run the following command **in the `client` directory**:\n\n```bash\nnpm run build\n```\n\nThis will create a production build of the app in the `client/build` directory.\n\nAs for the server, remember to set the `NODE_ENV` environment variable to `production` before running the app.\n\n## Tests\n\n---\n\n**As for the `v0.1.1` version, the tests do not cover the majority of the code, and most of the existing tests do not pass due to changes in the project structure. This will be fixed in the next patch.**\n\n---\n\nTo run the tests, use the following command **in the `client` or `server` directory** (depending on which tests you want to run):\n\n```bash\nnpm test\n```\n\nOr, run the following command **in the root directory**:\n\n```bash\nnpm test --prefix app\n```\n\nWhere `app` is the name of the directory containing the tests (either `client` or `server`)\n\n## Troubleshooting\n\nIf you are using Windows or your git client converts line endings to CRLF,\nyou may encounter the following error when trying to run the app:\n\n```bash\nerror Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style\n```\n\nThis is caused by the fact that the project uses the eslint.\nTo fix this, you can either:\n\n- change the line endings to LF (recommended)\n  - by simply running `npm run eslint -- --fix` in the both `client` and `server` directories\n- disable (or change) the eslint rule\n  - read more about it [here](https://eslint.style/rules/js/linebreak-style)\n\nNote that if you change the line endings to LF and decide not to disable the eslint rule,\nyour editor or git client may convert them back to CRLF.\nMake sure your editor and git config are set up correctly.\n\n## Contributing\n\nIf you find issues or have suggestions for improvements,\nfeel free to open an issue or submit a pull request.\nContributions are welcome!\n\n## Contact\n\nIf you have any questions, feel free to contact me at \u003cjakub@korytko.me\u003e.\n\n## License\n\nThis project is released under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## TODO / Upcoming features\n\nThis is a list of features that lead to the `v0.2.0` release:\n\n(This list is not exhaustive and may change at any time.\nPatch versions may and probably will be released in the meantime.\nKeep in mind that the order of the items is not necessarily the order in which they will be implemented.)\n\n- [ ] Add more tests and fix the existing ones\n- [ ] Improve the existing API structure\n- [ ] Improve the UI\n- [ ] Clean up the code\n- [ ] Add new technologies (for both the client and the server) and refactor the code accordingly\n- [ ] Implement CI/CD\n- [ ] Look for and fix potential security issues, vulnerabilities, and bugs\n- [ ] Use TypeScript\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakubkorytko%2Fweb-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakubkorytko%2Fweb-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakubkorytko%2Fweb-tools/lists"}