Compare commits

...

349 Commits

Author SHA1 Message Date
Kamran Ahmed
91ad9dd5a3 Add search icon in navigation 2023-05-20 23:19:19 +01:00
Kamran Ahmed
bb23f57204 Add page filtering 2023-05-20 22:59:19 +01:00
Kamran Ahmed
80dac2f7f7 Add icons to menu 2023-05-20 22:55:59 +01:00
Kamran Ahmed
c4f3c3529d Activate on CMD+K and focus 2023-05-20 22:21:54 +01:00
Kamran Ahmed
f57b61a920 Fix responsiveness of command menu 2023-05-20 22:12:12 +01:00
Kamran Ahmed
af05d795e3 Group separation, no result handling and filtering 2023-05-20 22:07:10 +01:00
Kamran Ahmed
44e5138b32 Refactor pages and add retrieval 2023-05-20 21:55:16 +01:00
Arik Chakma
4d7cada25c chore: backend fix 2023-05-20 18:44:07 +06:00
Kamran Ahmed
b707aa02d8 On Enter open the page 2023-05-20 13:06:20 +01:00
Kamran Ahmed
c9c4516aa7 Add command k input 2023-05-20 13:01:54 +01:00
Kamran Ahmed
83057d65cd Update content for prompt engineering 2023-05-20 12:15:37 +01:00
Kamran Ahmed
b886f20570 Add pdf for prompt engineering 2023-05-20 05:13:38 +01:00
Kamran Ahmed
dacd2d898b Add prompt enginering roadmap 2023-05-20 05:12:33 +01:00
Kamran Ahmed
a2490efa80 Add content dirs for prompt engineering 2023-05-20 02:37:57 +01:00
Kamran Ahmed
e087b79ade Add prompt engineering roadmap 2023-05-20 02:10:20 +01:00
Kamran Ahmed
10b1a8cb07 Add guide about resources for llms 2023-05-19 16:06:59 +01:00
Kamran Ahmed
f2c06462fa Add assets for ambassador and GraphQL 2023-05-19 01:05:36 +01:00
Kamran Ahmed
ad7ba44a2e Add pages JSON 2023-05-18 20:03:46 +01:00
Kamran Ahmed
7a72c96e79 Remove categroy field injection 2023-05-18 19:36:39 +01:00
Kamran Ahmed
d955044a3b Add category levels to pages 2023-05-18 18:03:08 +01:00
Kamran Ahmed
b86fafd538 Update roadmap note 2023-05-18 16:23:12 +01:00
Abilio Castro
c52a4e6638 Adding link to Spring Boot roadmap from Java roadmap (#3935)
* Adding link to Spring Boot roadmap from Java roadmap

* Adding link to Spring Boot roadmap from Java roadmap

---------

Co-authored-by: Abilio Silva <asilva@descartes.com>
2023-05-18 15:47:11 +01:00
Kamran Ahmed
9d66da6bf9 Add store link in footer 2023-05-18 12:57:20 +01:00
Kamran Ahmed
4b76d0b7aa Rearrange visual 2023-05-16 16:35:18 +01:00
Kamran Ahmed
626026eebc Add guide about LLMs 2023-05-16 16:35:18 +01:00
Kamran Ahmed
fdd12acb8e Add link to full stack roadmap 2023-05-15 19:51:14 +01:00
Kamran Ahmed
02015826ff Update related roadmaps 2023-05-15 14:51:45 +01:00
Kamran Ahmed
5d07ce32d8 Change color for skipped 2023-05-14 14:57:51 +01:00
Mohammad Ostadi
3967b16d25 Fix wrong backend and devops links (#3919) 2023-05-14 13:09:38 +01:00
Kamran Ahmed
f325183691 Add keydowns in updating progerss 2023-05-14 03:31:00 +01:00
Kamran Ahmed
a029850531 Change color of skipped 2023-05-14 03:12:28 +01:00
Kamran Ahmed
d3d2ae5889 Refactor update topic progress functionality 2023-05-14 03:05:54 +01:00
Kamran Ahmed
4a049b2a7a Skip colors 2023-05-14 02:53:07 +01:00
Kamran Ahmed
fd349f2da8 Allow skipping 2023-05-14 02:41:04 +01:00
Kamran Ahmed
f338bd5ecb Refactor progress button 2023-05-13 12:44:14 +01:00
Kamran Ahmed
a3470cd844 Fix flickering issue on the profile pages 2023-05-12 22:38:14 +01:00
Kamran Ahmed
f4635d794f Refactor buttons 2023-05-12 17:26:37 +01:00
Kamran Ahmed
426fe44dc8 Add content for full stack roadmap 2023-05-12 14:14:45 +01:00
Kamran Ahmed
4ed39cec1a Update monitoring 2023-05-12 13:07:46 +01:00
Kamran Ahmed
b1f0844546 Add github action sample 2023-05-12 12:57:35 +01:00
Kamran Ahmed
88aa7e4024 Add fullstack roadmap 2023-05-12 12:51:34 +01:00
Kamran Ahmed
471f6348f1 Add isNew flag to fullstack roadmap 2023-05-12 12:51:34 +01:00
Kamran Ahmed
9dfb70c941 Add fullstack roadmap 2023-05-12 12:51:34 +01:00
Zai Santillan
6fa7e0d1c0 Update twitter username (#3907) 2023-05-11 03:41:20 +01:00
Kamran Ahmed
5ccfa654ec Add support for custom labels in ga 2023-05-10 01:18:23 +01:00
Kamran Ahmed
1c67068eab Update twitter username 2023-05-09 15:39:50 +01:00
Kamran Ahmed
f5ff2a0823 Add contribution url to topic detail popup 2023-05-09 15:28:16 +01:00
Aman Tank
58503f67f3 Fix #3882, resolves #3874 (#3882)
* F[ixed] Link in Content Delivery Networks #3881

* [Fixed] Typo #3881

* Delete package-lock.json

---------

Co-authored-by: Aman Tank <132202130+amanntank@users.noreply.github.com>
2023-05-09 15:24:21 +01:00
Kamran Ahmed
5dd0479caf Add feature image 2023-05-09 11:47:07 +01:00
Kamran Ahmed
7441f1a203 Refactor avatar implementation 2023-05-09 03:36:29 +01:00
Arik Chakma
4d3ebb0ac6 chore: placeholder image 2023-05-09 03:36:29 +01:00
Arik Chakma
47d5716238 feat: upload profile picture 2023-05-09 03:36:29 +01:00
Kamran Ahmed
94d888a61e Add avatar url config 2023-05-09 03:35:45 +01:00
bany
ddd43a1514 Add missing file android.pdf (#3899) 2023-05-09 02:22:52 +01:00
Kamran Ahmed
2cf94f981b Resource progress functionality 2023-05-09 02:14:27 +01:00
Kamran Ahmed
f1973f63c2 Rename "Mark as Done" and "Mark as Pending" 2023-05-09 01:53:18 +01:00
Arik Chakma
dfb67e17d5 chore: in progress design 2023-05-09 06:21:39 +06:00
Arik Chakma
48239772f6 fix: removing classes 2023-05-09 06:04:47 +06:00
Arik Chakma
1cea9d0e13 chore: added pending state for topics 2023-05-09 06:02:41 +06:00
Kamran Ahmed
6591c36ef4 Add visit tracker to roadmap 2023-05-08 23:06:09 +01:00
Kamran Ahmed
41de9c47b0 Add partner images 2023-05-08 22:48:45 +01:00
Kamran Ahmed
0ba1a8a1d1 Rearrange scripts 2023-05-08 22:16:27 +01:00
Kamran Ahmed
6fcb153244 Fix invalid markdown language warnings 2023-05-08 21:12:34 +01:00
Kamran Ahmed
7a8d97b1cd Refactor analytics 2023-05-08 21:06:33 +01:00
Kamran Ahmed
9e37076d0d Add preconnect for ga and api 2023-05-08 20:59:57 +01:00
Kamran Ahmed
f8e5661353 Refactor perf issues 2023-05-08 20:54:56 +01:00
Kamran Ahmed
4d4cda6cac Fix accessibility issues 2023-05-08 20:37:26 +01:00
Arik Chakma
8b528f39f2 fix: broken link (#3897) 2023-05-08 16:58:35 +01:00
Kamran Ahmed
e1a04b4a20 Update username 2023-05-08 14:36:21 +01:00
Kamran Ahmed
f0e8ffe565 Fix spelling mistake 2023-05-06 16:42:12 +01:00
Kamran Ahmed
f9c1e64235 Add docker roadmap to readme 2023-05-06 01:44:25 +01:00
Kamran Ahmed
0174c9156b Fix formatting issue 2023-05-05 22:51:38 +01:00
Kamran Ahmed
2ee81e6ff3 Add docker roadmap 2023-05-05 22:49:57 +01:00
Kamran Ahmed
42ab5a3e9e Add docker roadmpa 2023-05-05 22:49:57 +01:00
Kamran Ahmed
e9fa663410 Notify icon 2023-05-05 12:16:07 +01:00
Kamran Ahmed
2d17a267be Refactor upcoming form 2023-05-04 18:18:44 +01:00
Arik Chakma
40371cdded fix: notify for upcoming page (#3887)
* chore: upcoming login

* fix: subscribed button
2023-05-04 18:09:32 +01:00
Arik Chakma
6bb315a2fc fix: featured items heading position (#3837) 2023-05-03 14:48:21 +01:00
Kamran Ahmed
fc2c9a1439 Remove sponsors and relevant codebase 2023-05-03 12:50:15 +01:00
Kamran Ahmed
b50935ecd6 Remove delay for sponsors 2023-05-03 04:09:09 +01:00
Kamran Ahmed
9b73d60c5d Add support for multiple ads 2023-05-03 03:14:04 +01:00
Kamran Ahmed
504ee8cf5e Add support for multiple ads 2023-05-02 20:48:01 +01:00
Kamran Ahmed
057bbddd9f Add support for multiple ads 2023-05-02 20:48:01 +01:00
Joshua
4063979c2a Fix typo (#3797) 2023-05-02 20:34:17 +01:00
Rita Bradley
da391fe9ed Fix typos (#3795)
* Fix typos

- Add 's' to reason
- Change "it's" to is
- Remove unnecessary hyphen

* Fix typos

- change 'remove' to 'removing'
- change comma to semicolon

* Fix typos

- change "don't" to "doesn't"
- add "is" before "relied upon"
2023-05-02 20:33:33 +01:00
Kamran Ahmed
953ca9257c Fix typo on homepage 2023-05-01 17:02:16 +01:00
Kamran Ahmed
396bedd319 Update sponsor banners 2023-05-01 16:50:59 +01:00
The New Stack
e05269f117 Add TypeScript installation guide (#3791)
* Added 1 TNS Article

* Update src/data/roadmaps/typescript/content/100-typescript/102-install-configure/index.md

---------

Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
2023-04-27 13:58:30 +01:00
Kamran Ahmed
77c7ca8835 Update badges 2023-04-27 12:41:08 +01:00
Kamran Ahmed
e877f5c610 Add code review best practices 2023-04-27 12:39:16 +01:00
Kamran Ahmed
42e1a79697 Update code review pdf 2023-04-26 21:12:09 +01:00
Kamran Ahmed
ce32cdc8a4 Update code review texts 2023-04-26 20:54:29 +01:00
Kamran Ahmed
e2a0bd23c0 Add best practice content 2023-04-26 17:44:02 +01:00
Kamran Ahmed
98f0ebde8b Add code-review best practices 2023-04-26 17:17:39 +01:00
Kamran Ahmed
bc018f8b39 Add code review best practices 2023-04-26 15:57:32 +01:00
Kamran Ahmed
03bd478aaa Add data aggregation command 2023-04-26 13:47:19 +01:00
Kamran Ahmed
67a8582c22 Fix overlapping login and videos 2023-04-24 18:07:51 +01:00
Kamran Ahmed
7533575df9 Update PgQ (#3856) 2023-04-24 15:29:21 +01:00
Kamran Ahmed
34fcd74d93 Update ad text 2023-04-21 20:27:52 +01:00
Kamran Ahmed
1558feb734 Update liblab link 2023-04-21 19:48:38 +01:00
Kamran Ahmed
bc4d9f9e2f Add postgresql dba pdf 2023-04-19 22:11:00 +01:00
Kamran Ahmed
4142c7b51e Compress postgresql json 2023-04-19 21:55:56 +01:00
Kamran Ahmed
e36a749223 Update postgresql roadmap 2023-04-19 21:55:22 +01:00
Kamran Ahmed
e69d9b4238 Add PEV2 2023-04-19 15:28:14 +01:00
Kamran Ahmed
3132a39816 Fix sponsor opener 2023-04-19 00:57:41 +01:00
Kamran Ahmed
03f9fa51ff Update roadmap node 2023-04-18 14:36:54 +01:00
Kamran Ahmed
e2062aefe9 Update postgresql roadmap 2023-04-18 14:24:58 +01:00
Kamran Ahmed
855ba7bbfb Add postgresql roadmap 2023-04-18 14:24:58 +01:00
Kamran Ahmed
ad71b6398d Fix styling issue 2023-04-18 14:24:57 +01:00
Kamran Ahmed
0ea0629104 Add postgresql-dba content 2023-04-18 14:24:57 +01:00
Kamran Ahmed
8b2f12fcdd Improve the content writing performance 2023-04-18 14:24:57 +01:00
Kamran Ahmed
e66bff74bf Add postgresql-dba content 2023-04-18 14:24:57 +01:00
github-actions[bot]
58ea34bb49 chore: update sponsors (#3821)
Co-authored-by: kamranahmedse <kamranahmedse@users.noreply.github.com>
2023-04-17 15:01:32 +01:00
Kamran Ahmed
275c2c3c88 Add noindex pages 2023-04-17 00:57:20 +01:00
Kamran Ahmed
f13c29adad Enable github auth 2023-04-14 21:17:49 +01:00
Kamran Ahmed
ec9f836a1f Fix check icon 2023-04-14 20:56:24 +01:00
Kamran Ahmed
589d157be5 Disable github login for now 2023-04-14 20:16:38 +01:00
Kamran Ahmed
a2719bc771 feat: user accounts functionality (#3813)
* feat: integrate astro

* chore: login popup design

* chore: data-popup changed

* refactor: github and google button

* chore: signup page

* chore: login popup design

* chore: signup page design

* chore: auth divider

* feat: integrate astro

* chore: login popup design

* chore: data-popup changed

* refactor: github and google button

* chore: signup page

* chore: login popup design

* chore: signup page design

* chore: auth divider

* chore: login feature

* chore: login error message

* chore: added name in token decode return

* chore: use auth hook

* chore: logout vs login

* chore: download button link

* chore: account dropdown

* fix: dropdown z index

* chore: profile page

* Add missing content for backend roadmap

* Remove unused styles

* Add login with google

* chore: google login implementation

* chore: profile guard clause

* fix: button size

* chore: preact to astro components

* chore: preact to astro comp

* chore: github astro component

* chore: google login error handling

* chore: github login error handling

* chore: change password page

* chore: rename profile to password

* fix: change password rename

* chore: update profile page

* chore: setting sidebar

* fix: setting dropdown design

* chore: required indicator

* chore: change password form

* chore: update profile form

* chore: mobile navigation

* fix: form data empty error

* chore: email login and signup components

* chore: forgot password page

* chore: reset password page

* chore: verify account page

* chore: resend verification email

* fix: types in spinner

* chore: forgot password functionality

* fix: class -> className

* chore: reset password page

* chore: reset password functionality

* chore: login page

* fix: spacing for login and signup page

* refactor: email login form

* chore: astro spinner

* chore: pre-fill user data

* chore: dummy placeholder

* chore: forgot password link add

* fix: replaced constants

* chore: forgot password link

* chore: change password for social provider

* chore: internal pages guard

* chore: internal paths

* refactor: change password errors

* refactor: update profile errors

* chore: mark as done overlay

* fix: uncontrolled to controlled form

* fix: de-structure error

* chore: error messages

* fix: 401 error code redirect to login page

* chore: loading spinner accessibilities

* fix: remove spinner

* chore: keep spinner after success to redirect

* chore: keep the spinner

* style: resend email underline

* chore: chevron down account

* chore: roadmap pdf link download

* chore: roadmap pdf link download

* chore: best practices buttons

* fix: verify account text

* fix: topic overlay hide

* chore: base verify design

* chore: email verify page

* fix: div tag missing

* Formatting

* Refactor top navigation

* Prettier

* Update dependencies

* Refactor top navigation

* Refactor login button

* Remove captcha and add google scripts

* Refactor email sign up form

* Resend verfication email functionality

* Refactor verification pending page

* Add verify account functionality

* Update signup text

* Add login page

* Add login button in top nav

* Email login form

* Handle authenticatoin

* Show hide auth elements change

* Add ease-in on the guest elements

* Refactor logic for download and subscribe popups

* Add forgot password

* Rename fetch lib

* Add authentication popup

* Refactor logic for mark done and pending

* Handle logout

* Add route protection

* Popup opener to close the overlay

* Remember page when logging in

* Add reset password page

* Change placement of constant

* Update profile page

* Add update password form

* Update password page

* Update profile page

* Update design

* chore: toggle mark resource done api

* chore: toggle topic done

* chore: get user resource progress api

* fix: best practice topic toggle

* chore: fetch progress

* fix: query selector for topics

* Keep track of the old page before social login

* Update public api url

* Add user progress tracking

* Update topic done functionality

* Add progress loader

* Add page wide spinner

* Add spinner on setting pages

* Add fingerprint to user requests

* Use http wrapper instead of fetch

* Update fingerprint

* Minor improvements

---------

Co-authored-by: Arik Chakma <arikchangma@gmail.com>
2023-04-14 19:22:52 +01:00
Umair Raza
c5645299aa Issues: Text not showing up properly #3796 (#3802) 2023-04-12 12:09:25 +01:00
Kamran Ahmed
6aac3f296c Remove youtube banner from top 2023-04-08 13:57:32 +01:00
Haseeb Ansari
137635f11a fix: wrong MAN explanation (#3771)
Co-authored-by: haseeb.ansari <haseeb.ansari@qordata.com>
2023-04-07 18:55:53 +01:00
karthikeyantc
8487d2f443 Updated the Route Guard for Angular (#3731)
* Update 104-guards.md

Added the link for resolve route guard

* Update 103-router-events.md

Added the documentation for Router events.

---------

Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
2023-04-05 17:35:19 +01:00
github-actions[bot]
a7bee1fea7 chore: update dependencies to latest (#3744)
Co-authored-by: kamranahmedse <kamranahmedse@users.noreply.github.com>
2023-04-05 17:34:13 +01:00
CMarghin
43292de507 Fix typo, replace Interface with Inference (#3750) 2023-04-05 17:32:51 +01:00
Sanjay Singha
bee30defb5 Add content for FVM (#3759)
* Adding content for FVM

* Update src/data/roadmaps/flutter/content/101-setup-development-environment/102-fvm.md

---------

Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
2023-04-05 17:32:20 +01:00
Pedro Macedo
52649a2d3c Change react docs link (#3742) 2023-04-05 17:31:04 +01:00
Salah Eddine Mebkhouti
be47ac6573 Update invalid link (#3752)
Co-authored-by: AIpills <x9one@pop-os.localdomain>
2023-04-04 14:09:15 +01:00
Arik Chakma
24ce27090e Fix guide type (#3754) 2023-04-04 14:08:50 +01:00
Ehren Nwokocha
8dd0225720 Fix minor typo (#3756)
I replaced and with it in the Javascript versioning paragraph
2023-04-04 14:08:30 +01:00
Kamran Ahmed
9893e9f0a3 Add singlestore links 2023-04-03 22:33:03 +01:00
Kamran Ahmed
caf1cd0269 Minor update 2023-04-03 21:37:13 +01:00
Kamran Ahmed
d21c1f6d0d Add sponsors 2023-04-03 19:15:10 +01:00
Kamran Ahmed
9d38cf7650 Add liblab content 2023-04-03 15:26:15 +01:00
Kamran Ahmed
d232d3bbd0 Update sponsors 2023-04-01 01:37:24 +01:00
Dimension
366d893df9 Fix invalid link (#3734)
Co-authored-by: Hitesh <hitesh.g@smarter.codes>
2023-03-30 18:20:01 +01:00
Kamran Ahmed
ff27561765 Remove unused styles 2023-03-30 18:17:27 +01:00
Kamran Ahmed
133642e05f Add missing content for backend roadmap 2023-03-30 16:34:39 +01:00
Kamran Ahmed
7434ff71eb Run prettier 2023-03-30 01:23:01 +01:00
Arik Chakma
d081ecf5b3 tooling: prettier for astro and tailwind (#3732)
* tooling: prettier for astro and tailwind

Prettier configuration for Astro component's formatting and Tailwind CSS class sorting.

* fix: single quote for props
2023-03-30 01:10:47 +01:00
Kamran Ahmed
d8a039690b Add a button to join on discord 2023-03-28 17:53:48 +01:00
Rahul Saw
56f0df549d Removed a link (#3697)
I think there is no need to use one more link for the exact same example.
The link that I have removed, redirects the user to the old react documentation which is already listed in this md file as "Reusing Logic with Custom Hooks".
2023-03-28 17:07:43 +01:00
Kamran Ahmed
b042161e29 Broken style of code 2023-03-28 17:04:21 +01:00
Kamran Ahmed
db273210fd Fix broken build 2023-03-28 15:47:14 +01:00
Kamran Ahmed
9370e262c0 Add content for mongodb-aggreagtion 2023-03-28 15:35:11 +01:00
Kamran Ahmed
e0f9bc8456 Add mongodb content 2023-03-28 14:05:57 +01:00
Kamran Ahmed
af211ab129 Add related roadmaps 2023-03-27 23:12:06 +01:00
Kamran Ahmed
eab1fb31b2 Fix typo 2023-03-27 21:25:50 +01:00
Kamran Ahmed
c36fd71ec1 Add content for cyber-security roadmap 2023-03-27 21:20:39 +01:00
Kamran Ahmed
7d0e35d7ae Update wireframing tools 2023-03-27 14:40:35 +01:00
Kamran Ahmed
59d881a77b Update ux design roadmap description 2023-03-27 13:43:27 +01:00
Kamran Ahmed
b57e3ecc75 Add content for UX Design Roadmap 2023-03-27 13:26:14 +01:00
Kamran Ahmed
cd5c0c10a2 Add content to UX Design Roadmap 2023-03-27 12:49:19 +01:00
Kamran Ahmed
10a5e4c0ae Add content to UX Design Roadmap 2023-03-27 12:41:38 +01:00
Kamran Ahmed
432983631d Add content to UX Design Roadmap 2023-03-27 12:39:02 +01:00
Kamran Ahmed
29189062b9 Add content to UX Design Roadmap 2023-03-27 06:04:38 +01:00
Kamran Ahmed
84138d5049 Update prompt 2023-03-27 04:38:47 +01:00
Kamran Ahmed
c28ac4b078 Add content writing command 2023-03-27 04:11:34 +01:00
Kamran Ahmed
66bdbd7458 Automate the title creation in new roadmap content 2023-03-27 03:44:54 +01:00
Kamran Ahmed
907f820778 Rename roadmap/best-practice content to dirs 2023-03-27 03:08:19 +01:00
Kamran Ahmed
ec0a8a99ef Add content to UX roadmap 2023-03-27 03:04:34 +01:00
Kamran Ahmed
a7a342c8e7 Add link to UX Design Roadmap 2023-03-26 22:03:50 +01:00
Kamran Ahmed
e0e26580fa Add UX design roadmap pdf 2023-03-26 21:45:49 +01:00
Kamran Ahmed
f9d96d415f Add ux-design roadmap 2023-03-26 21:45:49 +01:00
github-actions[bot]
e1c22932be chore: update dependencies to latest (#3720)
Co-authored-by: kamranahmedse <kamranahmedse@users.noreply.github.com>
2023-03-26 00:14:53 +00:00
Chandresh Patidar
9dae1b3595 Update 114-never.md (#3716)
Replace a deprecated link with new link for `never` type documentation
2023-03-25 15:40:07 +00:00
Kamran Ahmed
cdb642c8d4 Update newsletter 2023-03-25 04:10:40 +00:00
Arik Chakma
71b43af862 fix: upcoming button overlap (#3713)
* docs: new resources for jsx and functional components

* fix: upcoming button overlap
2023-03-24 15:08:17 +00:00
github-actions[bot]
69dccb3fcc chore: update dependencies to latest (#3677)
Co-authored-by: kamranahmedse <kamranahmedse@users.noreply.github.com>
2023-03-21 23:45:15 +00:00
Akshay Jagiasi
ca6ddb4654 How Bitcoin Blockchain actually work video added (#3684)
* How Bitcoin Blockchain actually work video added

* Delete package-lock.json
2023-03-21 23:44:28 +00:00
Ivan Kibala
0ac6fc70ff Fix typo (#3686)
Fix typo
2023-03-21 23:42:54 +00:00
Sandro Fiorio de S. Júnior
5ddb021898 Add content to QA roadmap (#3688)
Co-authored-by: Sandro Fiorio <sandrofioriojr@gmail.com>
2023-03-21 23:42:38 +00:00
Julio Martins
d227603a59 feat: added description and content at FastAPI on Python Roadmap (#3678) 2023-03-20 19:41:49 +00:00
Yerkebulan
e0d70950ac Fix ORM title (#3682)
Update title. Orms to ORMs
2023-03-20 19:39:28 +00:00
Kamran Ahmed
148bfd8736 Add guide on jump servers 2023-03-20 19:37:31 +00:00
Kamran Ahmed
648985cefc Update font and page size for guide page 2023-03-20 18:13:13 +00:00
Kamran Ahmed
9321ac6aa1 Add guide on jump servers 2023-03-20 17:46:22 +00:00
Kamran Ahmed
170ab3a6cf Update git resources 2023-03-20 17:46:22 +00:00
Shreyas Karanam
708fa31998 Fix typo in FAQ (#3658)
Removed multiple AWS listings
2023-03-18 21:41:47 +00:00
Aroyan
f83a1a6c3b Update links to the latest React documentation (#3675)
* feat: add Set JavaScript content

* refactor: update links to the latest react documentation

This commit updates all links that referred to outdated(legacy) React documentation to the latest version
2023-03-18 20:39:05 +00:00
Lane Wagner
dc1d7ef226 Add the complete Docker course by Boot.dev to back-end and devops roadmaps (#3676) 2023-03-18 20:38:12 +00:00
Aroyan
808bd40cce fix: update react docs to new url (#3656)
* feat: add Set JavaScript content

* fix: update react docs and remove beta docs

* update react docs url
2023-03-17 11:15:36 +00:00
Kamran Ahmed
45ce59b10d Add guide for semantic HTML 2023-03-17 02:47:27 +00:00
wagslane
e3f41ec0e3 add updated HTTP networking course 2023-03-16 20:33:55 +00:00
Kamran Ahmed
4f821d0f1d Add PDF and image for MongoDB roadmap 2023-03-16 20:32:14 +00:00
kamranahmedse
ec1283a5dc chore: update sponsors 2023-03-16 20:27:49 +00:00
Kamran Ahmed
4da909d358 Add MongoDB roadmap link 2023-03-16 20:27:19 +00:00
Kamran Ahmed
0beb9ad239 Add MongoDB roadmap 2023-03-16 20:23:47 +00:00
Kamran Ahmed
c6213dde92 Update guides 2023-03-16 18:36:05 +00:00
Kamran Ahmed
3d655965f6 Add event tracking for done/pending 2023-03-16 02:09:26 +00:00
Kamran Ahmed
c5c2ee3b2c Update events 2023-03-16 01:54:41 +00:00
Kamran Ahmed
cad0813eb6 Add event for roadmap switch 2023-03-16 01:05:11 +00:00
Kamran Ahmed
f9c1e6e0a2 Add event tracking for topic load 2023-03-16 00:58:10 +00:00
Kamran Ahmed
d3578756d4 Add event tracking for topic load 2023-03-16 00:53:02 +00:00
Kamran Ahmed
5fe506324a Add article for secrets management 2023-03-15 23:05:33 +00:00
Kamran Ahmed
bc007dcc9b Add article for DevOps language 2023-03-15 23:04:22 +00:00
Arthur Henrique
42a5d5bba6 feat: Include atlassian tutorials in git section (#3557)
Atlassian's Git Tutorials come across the beginning up to advanced tips on git usage, a great place to dive into its understanding
2023-03-14 08:56:02 +00:00
The New Stack
f908c5371d Added TNS K8s Overview Page (#3558) 2023-03-14 08:53:46 +00:00
The New Stack
78964b9f65 Added TNS K8s Primer Article (#3559) 2023-03-14 08:53:25 +00:00
The New Stack
9f11de60ed Added TNS K8s Explainer YouTube Video (#3560) 2023-03-14 08:53:09 +00:00
The New Stack
4ba28b702b Added 2 TNS K8s Alternative Resources (#3561) 2023-03-14 08:52:39 +00:00
The New Stack
45c6fc873f Added TNS K8s Deployment Tutorial (#3562) 2023-03-14 08:52:15 +00:00
The New Stack
23b7c21502 Added TNS Article for Cluster Deployment on Ubuntu (#3564) 2023-03-14 08:52:01 +00:00
The New Stack
d474d07ebb Added 2 TNS Articles on K8s Managed Services (#3563) 2023-03-14 08:47:09 +00:00
The New Stack
7d08572d78 Added 2 TNS Articles Covering K8s Pods (#3565) 2023-03-14 08:46:28 +00:00
The New Stack
17fc85f893 Added TNS Article for K8s Sets (#3566) 2023-03-14 08:45:56 +00:00
github-actions[bot]
5ccba8d7c0 chore: update dependencies to latest (#3576)
Co-authored-by: kamranahmedse <kamranahmedse@users.noreply.github.com>
2023-03-14 08:45:14 +00:00
Alex Ivanovs
fefbb4f833 Updating resources for React Router (#3586)
I'm adding a link to a React Router cheatsheet/reference covering examples of various routes, including core components and routers introduced in v6.4.
2023-03-14 08:42:26 +00:00
The New Stack
bcbc9c9d54 Added TNS Article for Building Stateful K8s Applications (#3587) 2023-03-14 08:40:47 +00:00
The New Stack
73d1d0e389 Added TNS Article About K8s as Universal Schedular (#3588) 2023-03-14 08:40:25 +00:00
The New Stack
14856560c3 Added TNS Article on K8s Ingress for Beginners (#3589) 2023-03-14 08:39:56 +00:00
The New Stack
b097395c07 Added TNS Article on Ingress Controllers for K8s (#3590) 2023-03-14 08:39:29 +00:00
The New Stack
929be729e5 Added TNS Article on K8s Networking (#3591) 2023-03-14 08:39:07 +00:00
The New Stack
1eb8fab15e Added TNS Article on CRD and ConfigMaps (#3592) 2023-03-14 08:38:49 +00:00
The New Stack
51233c8011 Added TNS Article on Secrets Management (#3593) 2023-03-14 08:38:26 +00:00
The New Stack
0081e9059c Added 2 TNS Articles on Resource Types, Requests, Limits (#3594) 2023-03-14 08:38:02 +00:00
The New Stack
4e66148777 Added TNS Article on Namespaces (#3595) 2023-03-14 08:37:48 +00:00
The New Stack
18e430be0b Added TNS Article on Choosing Monitoring Tools (#3596) 2023-03-14 08:37:22 +00:00
The New Stack
e39d0d93e0 Added 5 TNS Articles on K8s Access Control (#3605) 2023-03-14 08:37:05 +00:00
The New Stack
9260dc36b5 Added 3 TNS Articles on K8s Network Security (#3606) 2023-03-14 08:36:16 +00:00
The New Stack
f5f846ed73 Added 2 TNS Articles on Container and Pod Security (#3607) 2023-03-14 08:35:55 +00:00
The New Stack
7518d60013 Added 2 TNS Articles on K8s Security Scanning (#3608) 2023-03-14 08:35:31 +00:00
Kamran Ahmed
59d9674d75 Add guide about SSL certificates 2023-03-13 21:49:49 +00:00
Kota Hayashi
16fb03086e Add riverpod desc (#3599)
* Add riverpod desc

* Update src/data/roadmaps/flutter/content/111-state-management/102-riverpod.md

---------

Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
2023-03-13 20:37:19 +00:00
Kamran Ahmed
c0f46c5eed Add support for ads on best-practices 2023-03-13 18:04:20 +00:00
Kamran Ahmed
b5b8b92791 Update sponsors workflow 2023-03-13 18:02:15 +00:00
kamranahmedse
8f90dac32e chore: update sponsors 2023-03-13 17:44:48 +00:00
Kamran Ahmed
e9f3a616d1 Add FAQs for DevOps 2023-03-10 01:05:41 +00:00
Kamran Ahmed
c28ed87247 Compress json 2023-03-09 17:07:04 +00:00
Kamran Ahmed
53fb6313db Add link to AWS best practices 2023-03-09 17:05:42 +00:00
Kamran Ahmed
cc933b238d Add best practices for AWS 2023-03-09 16:54:50 +00:00
github-actions[bot]
48fba932b4 chore: update dependencies to latest (#3530)
Co-authored-by: kamranahmedse <kamranahmedse@users.noreply.github.com>
2023-03-06 18:20:40 +00:00
Kamran Ahmed
9961259ffb Fix typo 2023-03-04 23:58:23 +00:00
Kamran Ahmed
cab2054c1d Add related roadmaps to each roadmap page 2023-03-04 23:55:14 +00:00
Kamran Ahmed
d34affb420 Add related roadmaps to each roadmap page 2023-03-04 23:51:40 +00:00
Kamran Ahmed
ee4f0980bc Link to best practices from roadmaps 2023-03-04 18:43:28 +00:00
Kamran Ahmed
37fdd010a8 Add Cyber Security roadmap 2023-03-04 18:28:18 +00:00
Kamran Ahmed
aa04c51a12 Add PDF url 2023-03-04 18:27:35 +00:00
Kamran Ahmed
7993f12d12 Add content for certs and ctfs 2023-03-04 18:27:03 +00:00
Kamran Ahmed
1a3265295c Add directories for content 2023-03-04 18:27:02 +00:00
Kamran Ahmed
238245431b Add cyber-security roadmap 2023-03-04 18:27:02 +00:00
rakibulhaq
48c04055d5 Fix - Typo in 3rd line of migration strategies (#3522)
Solves the issue #3520
2023-03-03 09:00:15 +00:00
Kamran Ahmed
596b8f56ac Update frontend beginner roadmap 2023-03-02 23:34:53 +00:00
Kamran Ahmed
45267693e2 Addevent on switch 2023-03-02 22:13:25 +00:00
Kamran Ahmed
f932df8627 Use query parameters for roadmap switching 2023-03-02 22:05:58 +00:00
Kamran Ahmed
8dcf4b00c4 Refactor frontend roadmap for beginners 2023-03-02 21:58:14 +00:00
Kamran Ahmed
cb32a9610d Add beginner version of frontend roadmap 2023-03-02 19:19:34 +00:00
Kamran Ahmed
01c090f62d Update renderer 2023-03-02 15:41:49 +00:00
Kamran Ahmed
60b1edcab9 Update event labels for sponsor links 2023-03-01 23:04:32 +00:00
Kamran Ahmed
d08887060f Update sponsor workflow title 2023-03-01 02:39:52 +00:00
Kamran Ahmed
24a6c4930e Update sponsors workflow 2023-03-01 02:31:18 +00:00
Kamran Ahmed
e57b889f73 Add script to update sponsors 2023-03-01 02:28:46 +00:00
Kamran Ahmed
c5d14d2543 Update dependencies 2023-03-01 02:22:49 +00:00
Kamran Ahmed
4f0b08ea93 Add sponsor action 2023-03-01 02:19:56 +00:00
github-actions[bot]
47e2dbdd12 chore: update dependencies to latest (#3445)
Co-authored-by: kamranahmedse <kamranahmedse@users.noreply.github.com>
2023-03-01 01:27:31 +00:00
Kamran Ahmed
f1ad70acd9 Update backend, js and python 2023-03-01 00:40:28 +00:00
Kamran Ahmed
ac230bbf29 Add sponsor links on the roadmaps 2023-03-01 00:40:28 +00:00
prchann
d0861711ac Fix a link issue in markdown (#3508) 2023-02-28 19:20:46 +00:00
Amin Rezaei
74b2dda7f7 Fix heading for content file (#3509)
Removed unnecessary heading <code> tag.
2023-02-28 19:17:36 +00:00
Kamran Ahmed
2b49fa3182 Add responsive widgets 2023-02-28 19:16:46 +00:00
Kamran Ahmed
e2a8240e35 Add FVM 2023-02-28 19:12:05 +00:00
Kamran Ahmed
a7f45c0af1 Fix some flutter nodes not clickable 2023-02-28 17:31:39 +00:00
Kamran Ahmed
77a6270bd7 Update flutter roadmap 2023-02-28 17:29:47 +00:00
Kamran Ahmed
64d3ad662c Add riverpod and remove getx 2023-02-28 17:18:41 +00:00
Kamran Ahmed
c8b8e12b64 Add guide for database setup 2023-02-27 10:56:39 +00:00
Tobias Uhmann
8f94a5887e Update 101-jdbc-template.md (#3478)
Clarify in the first sentence that "the JDBC core package" is about Spring
2023-02-25 18:49:54 +00:00
Aroyan
00b6217e63 feat: add urql content (#3483) 2023-02-25 18:49:33 +00:00
João
1a0d7463eb Add Interactive Git Branching Guide by pcottle (#3486)
Github repo of added resource: https://github.com/pcottle/learnGitBranching
2023-02-25 18:49:20 +00:00
Olusola Amoo
983ee44632 fix(blockchain-content): Fix typo in roadmaps > blockchain > security > tools content (#3489) 2023-02-25 18:49:03 +00:00
Olusola Amoo
f393cb186e fix(blockchain-content): fix typo in blockchain solidity content (#3490) 2023-02-25 18:48:45 +00:00
devwithsmf
70edfb0ac2 Adding content to Kubernetes Roadmap (#3477)
* Update 100-kubernetes-overview.md

* Update 101-why-kubernetes.md

* Update 102-key-concepts-terminologies.md

* Update 103-kubernetes-alternatives.md

* Update index.md

* Update 100-installing-a-local-cluster.md

* Update 101-why-kubernetes.md

* Update 102-key-concepts-terminologies.md

* Update 103-kubernetes-alternatives.md

* Update index.md

* Update 100-installing-a-local-cluster.md

* Update 101-choosing-a-managed-provider.md

* Update 102-deploying-your-first-application.md

* Update index.md

* Update 100-pods.md

* Update 101-replicasets.md

* Update 103-statefulsets.md

* Update 103-statefulsets.md

* Update 104-jobs.md

* Update index.md

* Update 100-networking-and-pod-to-pod-communication.md

* Update 101-load-balancing.md

* Update 102-external-access-to-services.md

* Update index.md

* Update 100-config-maps.md

* Update 101-secrets.md

* Update index.md

* Update 100-setting-resource-requests-and-limits.md

* Update 101-assigning-quotas-to-namespaces.md

* Update 102-monitoring-and-optimizing-resource-usage.md

* Update 102-monitoring-and-optimizing-resource-usage.md

* Update index.md

* Update 100-role-based-acccess-control.md

* Update 101-network-security.md

* Update 102-container-and-pod-security.md

* Update 103-security-scanners.md

* Update index.md

* Update 100-logs.md

* Update 101-metrics.md

* Update 102-traces.md

* Update 103-resource-health.md

* Update 104-observability-engines.md

* Update index.md

* Update 100-horizontal-pod-autoscaler.md

* Update 101-vertical-pod-autoscaler.md

* Update 102-cluster-autoscaling.md

* Update index.md

* Update 100-scheduling-basics.md

* Update 101-taints-and-tolerations.md

* Update 102-topology-spread-constraints.md

* Update 103-pod-priorities.md

* Update 104-evictions.md

* Update index.md

* Update 100-csi-drivers.md

* Update 101-stateful-applications.md

* Update index.md

* Update 100-ci-cd-integration.md

* Update 101-gitops.md

* Update 102-helm-charts.md

* Update 103-canary-deployments.md

* Update 104-blue-green-deployments.md

* Update 105-rolling-updates-rollbacks.md

* Update index.md

* Update 100-custom-controllers.md

* Update 101-custom-schedulers-extenders.md

* Update 102-custom-resource-definitions.md

* Update 103-kubernetes-extensions-and-apis.md

* Update 104-own-cluster.md

* Update 105-control-plane-installation.md

* Update 106-managing-worker-nodes.md

* Update 107-multi-cluster-management.md

* Update index.md

* Update index.md
2023-02-25 18:46:21 +00:00
Bernd Hobbie
ed07d34d64 Move 'exclude' option in tsconfig.json out of 'compilerOptions (#3479) 2023-02-25 18:44:43 +00:00
Appasaheb Nage
831521ae10 Update tsconfig (#3496) 2023-02-25 18:44:12 +00:00
Kamran Ahmed
e29289f0dc Add API Security PDF 2023-02-22 09:48:13 +00:00
Kamran Ahmed
0fd3eb0cc6 Add link to API Security Best Practices 2023-02-21 19:41:54 +00:00
Kamran Ahmed
f58a77010b Add content for API security best practices 2023-02-21 19:37:35 +00:00
Kamran Ahmed
6303e31c0e Add content for API security best practices 2023-02-21 19:22:15 +00:00
Kamran Ahmed
dfc2d39427 Add content to API security best practices 2023-02-21 15:48:03 +00:00
Kamran Ahmed
5e75026424 Add content to API security best practices 2023-02-21 15:39:34 +00:00
Kamran Ahmed
7a4c077a90 Add content for API security best practices 2023-02-21 15:16:15 +00:00
Kamran Ahmed
e45c49a404 Fix broken build 2023-02-21 12:44:44 +00:00
Kamran Ahmed
b6a0255f12 Change location for data files 2023-02-21 12:25:58 +00:00
Kamran Ahmed
b741a0e1ee Add support for link-groups 2023-02-20 16:59:02 +00:00
Kamran Ahmed
8200993af4 Update subscription 2023-02-14 14:07:49 +00:00
Kamran Ahmed
5c1d803892 Fix mistake in constructor overloading 2023-02-13 14:19:30 +00:00
Natan Yellin
dcf0f94af9 Update 101-containers.md (#3440) 2023-02-10 21:03:58 +00:00
Artem Gontar
4ad8886aa0 fix: broken link to Circuit Breaker AWS WAF (#3304) 2023-02-10 18:39:44 +00:00
Lucas Soares
a1143cd6cb Add content to Node.js roadmap (#3305) 2023-02-10 18:38:06 +00:00
mohd-e-mustafa
f130c706da Add filtering content (#3355)
* Updated 100-filtering.md added content

* Update content

---------

Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
2023-02-10 18:31:23 +00:00
mohd-e-mustafa
8068face54 Add rate-limiting content (#3364)
* Update 101-rate-limiting.md

* Update src/roadmaps/angular/content/101-rxjs-basics/104-operators/101-rate-limiting.md

---------

Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
2023-02-10 18:27:15 +00:00
Benson Arafat
39866117a6 Update Nuxt resources (#3365)
The current version of nuxt is v3.
Update source to v3
2023-02-10 18:25:32 +00:00
mohd-e-mustafa
df7aa17f86 Add content for RxJS transformation (#3369) 2023-02-10 18:22:45 +00:00
payal pagariya
ee6572660b Add resources for data structures (#3374)
Added resources related to stack, queue and recursion all implemented in JavaScript
2023-02-10 18:20:56 +00:00
Jorge Martin
9875a2d6f7 Fix spelling mistake (#3378) 2023-02-10 18:15:45 +00:00
Nikita Monastyrskiy
5b180e2597 Add content to globby (#3432) 2023-02-10 18:10:39 +00:00
Nikita Monastyrskiy
6f05972493 Add content to fs-extra (#3433) 2023-02-10 18:10:15 +00:00
Felipe Riveras
4bd182e4d0 Add MDN resources for hosting (#3436)
this articles explain very good the term and explain with clarity
2023-02-10 18:08:30 +00:00
Israni, Murli
68d319cacb Fix spelling mistake (#3439) 2023-02-10 18:08:00 +00:00
Mohammad Morakabati
3e76df8d2a Add gRPC resources (#3429) 2023-02-10 18:07:37 +00:00
Kamran Ahmed
9d69477947 Fix broken URLs 2023-02-10 17:55:18 +00:00
Kamran Ahmed
e0ead47fb1 Add kubernetes roadmap 2023-02-10 15:49:39 +00:00
Kamran Ahmed
253c88542f Upgrade dependencies 2023-02-10 15:49:39 +00:00
andran777
5bca9834fb Update Spring Boot scope content (#3398) 2023-02-08 17:42:45 +00:00
Jesse Chang
dde6e3d3df Remove beego link (#3403)
* Update 100-beego.md

New official documentation website.

* Update src/roadmaps/golang/content/104-go-web-frameworks/100-beego.md

---------

Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
2023-02-08 16:12:05 +00:00
Khushi Kothari
6fe8fee25f Add MDN link to Asynchronous JavaScript (#3404)
* Update index.md

* Update src/roadmaps/javascript/content/112-javascript-asynchronous-javascript/index.md

---------

Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
2023-02-08 16:09:55 +00:00
Hans Elde
f3622a1b1c Fix the availability numbers (#3410)
* Update 102-availability-in-numbers.md

Updated downtime #s using https://uptime.is/

* Update src/roadmaps/system-design/content/105-availability-patterns/102-availability-in-numbers.md

* Update src/roadmaps/system-design/content/105-availability-patterns/102-availability-in-numbers.md

---------

Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
2023-02-08 16:00:25 +00:00
Muhammad Kamal Fergany
a92bda38f4 Fix a typo in 103-load-balancer.md (#3414) 2023-02-08 15:58:18 +00:00
Kamran Ahmed
b194d167be Make youtube banner non-sticky 2023-02-08 12:29:30 +00:00
Kamran Ahmed
ec04b582a6 Add note for feedback 2023-02-08 12:22:09 +00:00
Kamran Ahmed
f55159a12b Update title for kubernetes page 2023-02-08 11:19:58 +00:00
Kamran Ahmed
938c7796d1 Update title for best practices pages 2023-02-08 11:19:58 +00:00
Paul Reichetanz
e04bd9db05 Fix typos in frontend/123-bonus-content.md (#3423) 2023-02-08 11:00:30 +00:00
Kamran Ahmed
7c837d14da Add link to Kubernetes roadmap 2023-02-07 20:59:11 +00:00
Kamran Ahmed
cc05587d9e Add kubernetes roadmap 2023-02-07 20:49:14 +00:00
Kamran Ahmed
2172014d6e Add dimensions 2023-02-07 20:21:03 +00:00
Kamran Ahmed
98d43e76b7 Add kubernetes roadmap 2023-02-07 20:19:39 +00:00
Kamran Ahmed
7665970813 Add kubecampus snippet 2023-02-06 21:55:55 +00:00
Kamran Ahmed
d96e5890b9 Add content to TypeScript roadmap 2023-02-06 21:26:56 +00:00
Kamran Ahmed
659bd93094 Add content to TypeScript roadmap 2023-02-06 21:26:56 +00:00
syedmouaazfarrukh
a4dddfb19b Adding content to 101-typescript-types 2023-02-06 21:26:56 +00:00
syedmouaazfarrukh
12a4be2227 Adding content to 104-undefined 2023-02-06 21:26:56 +00:00
syedmouaazfarrukh
9edcb35acb Adding content to 115-type-assertions 2023-02-06 21:26:56 +00:00
syedmouaazfarrukh
1df4e4b836 Adding content to 111-utility-types 2023-02-06 21:26:56 +00:00
syedmouaazfarrukh
49e78cf1c0 102-type-inference, 103-type-compatibility, 110-decorators 2023-02-06 21:26:56 +00:00
syedmouaazfarrukh
a4a29b4efa 114-ecosystem 2023-02-06 21:26:56 +00:00
syedmouaazfarrukh
3e49e7f91d 113-modules 2023-02-06 21:26:56 +00:00
syedmouaazfarrukh
7627bc73b5 112-advanced-types 2023-02-06 21:26:56 +00:00
syedmouaazfarrukh
26eaa40dc1 Adding content to 109-generics 2023-02-06 21:26:56 +00:00
syedmouaazfarrukh
45a0b53d5f Adding content to 108-classes 2023-02-06 21:26:56 +00:00
syedmouaazfarrukh
7bac3c3444 Adding content to 107-interfaces 2023-02-06 21:26:56 +00:00
syedmouaazfarrukh
62905bda7a Adding content to 106-functions 2023-02-06 21:26:56 +00:00
syedmouaazfarrukh
179bf366cc Adding content to 104-combining-types 2023-02-06 21:26:56 +00:00
syedmouaazfarrukh
59d47c5b1e Adding content to 100-typescript 2023-02-06 21:26:56 +00:00
syedmouaazfarrukh
d23ea8e577 Adding content to 103-running-typescript 2023-02-06 21:26:56 +00:00
syedmouaazfarrukh
07f001f8be Adding content to 102-install-configure 2023-02-06 21:26:56 +00:00
Kamran Ahmed
754a91acef Fix invalid link 2023-02-06 15:09:55 +00:00
Kamran Ahmed
16c550211b Fix invalid link 2023-02-06 15:08:33 +00:00
Kamran Ahmed
a56710c43d Remove ambassador and tigera links 2023-02-02 00:11:20 +04:00
CodeGuage
00f94e031e Add link to switch in JS Roadmap (#3380) 2023-01-31 20:56:37 +04:00
Tianzhou (天舟)
d1556c85df docs: add PostGIS and Bytebase to the postgresql-dba roadmap. (#3390) 2023-01-31 20:55:55 +04:00
tim-laue
1885d6d304 Fix broken link (#3381)
Fixed broken link
2023-01-31 20:55:13 +04:00
Zanin Andrea
3b8c8316b3 Add HTTPs content (#3384)
I have added a brief explanation of how the HTTPS protocol works and a new resource to learn more
2023-01-31 20:54:30 +04:00
mohd-e-mustafa
034fd16a1f Add combination content in RxJS (#3385) 2023-01-31 20:53:24 +04:00
Diego Kfuri
aa9bf2f263 fix typo in system designs roadmap (#3395) 2023-01-31 20:52:12 +04:00
syedmouaazfarrukh
6a5df98f4f Add content to flutter roadmap (#3389)
* Adding content to 100-dart-basics

* Adding content to 102-setup-development-environment

* Adding content to 102-styled-widgets

* Adding content to 102-widgets

* Adding content to 103-working-with-assets

* Adding content to 105-repo-hosting-services

* Adding content to 106-design-principles

* Adding content to 107-package-manager

* Adding content to 108-working-with-apis

* Adding content to 102-firebase

* Adding content to 109-storage

* Adding content to 114-reactive programming

* Adding content to 115-dev-tools

* Adding content to 116-flutter-internals

* Adding content to 117-ci-cd

* Adding content to 118-analytics

* Adding content to 119-deployment

* Adding content to 110-advanced-dart

* Adding content to 111-state-management

* Adding content to 112-animations

* Adding content to 113-testing

* Adding content to 102-flutter-bloc, 101-flutter-outline

* Update src/roadmaps/flutter/content/100-dart-basics/104-operators.md

* Update src/roadmaps/flutter/content/101-setup-development-environment/101-ides/index.md

---------

Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
2023-01-31 20:49:28 +04:00
Kamran Ahmed
ea02c8835a Add typescript roadmap reference in frontend roadmap 2023-01-31 14:23:18 +04:00
Kamran Ahmed
e13733a503 Add link to TypeScript roadmap 2023-01-31 04:28:24 +04:00
Kamran Ahmed
6f0ad58764 Add TypeScript roadmap (#3391)
* Add typescript roadmap

* Add typescript content

* Add typescript roadmap
2023-01-31 04:05:46 +04:00
Kamran Ahmed
f68c303ffa Fix canonicals on best-practices topic page 2023-01-31 01:19:54 +04:00
Kamran Ahmed
b2c79ff395 Fix canonicals on topic pages 2023-01-31 01:15:13 +04:00
4636 changed files with 61236 additions and 11984 deletions

2
.env.example Normal file
View File

@@ -0,0 +1,2 @@
PUBLIC_API_URL=http://api.roadmap.sh
PUBLIC_AVATAR_BASE_URL=https://dodrc8eu8m09s.cloudfront.net/avatars

View File

@@ -3,6 +3,8 @@ on:
push:
branches: [ master ]
env:
PUBLIC_API_URL: "https://api.roadmap.sh"
PUBLIC_AVATAR_BASE_URL: "https://dodrc8eu8m09s.cloudfront.net/avatars"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PAT: ${{ secrets.PAT }}
CI: true

5
.gitignore vendored
View File

@@ -5,7 +5,7 @@ dist/
# dependencies
node_modules/
bin/developer-roadmap
scripts/developer-roadmap
# logs
npm-debug.log*
@@ -23,4 +23,5 @@ pnpm-debug.log*
/test-results/
/playwright-report/
/playwright/.cache/
tests-examples
tests-examples
*.csv

7
.prettierignore Normal file
View File

@@ -0,0 +1,7 @@
app-dist
dist
.idea
.github
public
node_modules
pnpm-lock.yaml

18
.prettierrc.cjs Normal file
View File

@@ -0,0 +1,18 @@
module.exports = {
semi: true,
singleQuote: true,
overrides: [
{
files: '*.astro',
options: {
parser: 'astro',
singleQuote: true,
jsxSingleQuote: true,
},
},
],
plugins: [
require.resolve('prettier-plugin-astro'),
require('prettier-plugin-tailwindcss'),
],
};

6
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"prettier.documentSelectors": ["**/*.astro"],
"[astro]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}

View File

@@ -1,4 +1,5 @@
// https://astro.build/config
import preact from '@astrojs/preact';
import sitemap from '@astrojs/sitemap';
import tailwind from '@astrojs/tailwind';
import compress from 'astro-compress';
@@ -6,8 +7,9 @@ import { defineConfig } from 'astro/config';
import rehypeExternalLinks from 'rehype-external-links';
import { serializeSitemap, shouldIndexPage } from './sitemap.mjs';
// https://astro.build/config
export default defineConfig({
site: 'https://roadmap.sh',
site: 'https://roadmap.sh/',
markdown: {
shikiConfig: {
theme: 'dracula',
@@ -17,6 +19,24 @@ export default defineConfig({
rehypeExternalLinks,
{
target: '_blank',
rel: function (element) {
const href = element.properties.href;
const whiteListedStarts = [
'/',
'#',
'mailto:',
'https://github.com/kamranahmedse',
'https://thenewstack.io',
'https://cs.fyi',
'https://roadmap.sh',
];
if (whiteListedStarts.some((start) => href.startsWith(start))) {
return [];
}
return 'noopener noreferrer nofollow';
},
},
],
],
@@ -38,5 +58,6 @@ export default defineConfig({
css: false,
js: false,
}),
preact(),
],
});

View File

@@ -1,144 +0,0 @@
const fs = require('fs');
const path = require('path');
const CONTENT_DIR = path.join(__dirname, '../content');
// Directory containing the best-practices
const BEST_PRACTICE_CONTENT_DIR = path.join(__dirname, '../src/best-practices');
const bestPracticeId = process.argv[2];
const allowedBestPracticeId = fs.readdirSync(BEST_PRACTICE_CONTENT_DIR);
if (!bestPracticeId) {
console.error('bestPractice is required');
process.exit(1);
}
if (!allowedBestPracticeId.includes(bestPracticeId)) {
console.error(`Invalid best practice key ${bestPracticeId}`);
console.error(`Allowed keys are ${allowedBestPracticeId.join(', ')}`);
process.exit(1);
}
// Directory holding the best parctice content files
const bestPracticeDirName = fs
.readdirSync(BEST_PRACTICE_CONTENT_DIR)
.find((dirName) => dirName.replace(/\d+-/, '') === bestPracticeId);
if (!bestPracticeDirName) {
console.error('Best practice directory not found');
process.exit(1);
}
const bestPracticeDirPath = path.join(BEST_PRACTICE_CONTENT_DIR, bestPracticeDirName);
const bestPracticeContentDirPath = path.join(
BEST_PRACTICE_CONTENT_DIR,
bestPracticeDirName,
'content'
);
// If best practice content already exists do not proceed as it would override the files
if (fs.existsSync(bestPracticeContentDirPath)) {
console.error(`Best Practice content already exists @ ${bestPracticeContentDirPath}`);
process.exit(1);
}
function prepareDirTree(control, dirTree) {
// Directories are only created for groups
if (control.typeID !== '__group__') {
return;
}
// e.g. 104-testing-your-apps:other-options
const controlName = control?.properties?.controlName || '';
// No directory for a group without control name
if (!controlName || controlName.startsWith('check:') || controlName.startsWith('ext_link:')) {
return;
}
// e.g. ['testing-your-apps', 'other-options']
const dirParts = controlName.split(':');
// Nest the dir path in the dirTree
let currDirTree = dirTree;
dirParts.forEach((dirPart) => {
currDirTree[dirPart] = currDirTree[dirPart] || {};
currDirTree = currDirTree[dirPart];
});
const childrenControls = control.children.controls.control;
// No more children
if (childrenControls.length) {
childrenControls.forEach((childControl) => {
prepareDirTree(childControl, dirTree);
});
}
return { dirTree };
}
const bestPractice = require(path.join(__dirname, `../public/jsons/best-practices/${bestPracticeId}`));
const controls = bestPractice.mockup.controls.control;
// Prepare the dir tree that we will be creating
const dirTree = {};
controls.forEach((control) => {
prepareDirTree(control, dirTree);
});
/**
* @param parentDir Parent directory in which directory is to be created
* @param dirTree Nested dir tree to be created
* @param filePaths The mapping from groupName to file path
*/
function createDirTree(parentDir, dirTree, filePaths = {}) {
const childrenDirNames = Object.keys(dirTree);
const hasChildren = childrenDirNames.length !== 0;
// @todo write test for this, yolo for now
const groupName = parentDir
.replace(bestPracticeContentDirPath, '') // Remove base dir path
.replace(/(^\/)|(\/$)/g, '') // Remove trailing slashes
.replaceAll('/', ':') // Replace slashes with `:`
.replace(/:\d+-/, ':');
const humanizedGroupName = groupName
.split(':')
.pop()
?.replaceAll('-', ' ')
.replace(/^\w/, ($0) => $0.toUpperCase());
// If no children, create a file for this under the parent directory
if (!hasChildren) {
let fileName = `${parentDir}.md`;
fs.writeFileSync(fileName, `# ${humanizedGroupName}`);
filePaths[groupName || 'home'] = fileName.replace(CONTENT_DIR, '');
return filePaths;
}
// There *are* children, so create the parent as a directory
// and create `index.md` as the content file for this
fs.mkdirSync(parentDir);
let readmeFilePath = path.join(parentDir, 'index.md');
fs.writeFileSync(readmeFilePath, `# ${humanizedGroupName}`);
filePaths[groupName || 'home'] = readmeFilePath.replace(CONTENT_DIR, '');
// For each of the directory names, create a
// directory inside the given directory
childrenDirNames.forEach((dirName) => {
createDirTree(
path.join(parentDir, dirName),
dirTree[dirName],
filePaths
);
});
return filePaths;
}
// Create directories and get back the paths for created directories
createDirTree(bestPracticeContentDirPath, dirTree);
console.log('Created best practice content directory structure');

View File

@@ -1,28 +0,0 @@
## CLI Tools
> A bunch of CLI scripts to make the development easier
## `roadmap-links.cjs`
Generates a list of all the resources links in any roadmap file.
## `compress-jsons.cjs`
Compresses all the JSON files in the `public/jsons` folder
## `roadmap-content.cjs`
This command is used to create the content folders and files for the interactivity of the roadmap. You can use the below command to generate the roadmap skeletons inside a roadmap directory:
```bash
npm run roadmap-content [frontend|backend|devops|...]
```
For the content skeleton to be generated, we should have proper grouping, and the group names in the project files. You can follow the steps listed below in order to add the meta information to the roadmap.
- Remove all the groups from the roadmaps through the project editor. Select all and press `cmd+shift+g`
- Identify the boxes that should be clickable and group them together with `cmd+shift+g`
- Assign the name to the groups.
- Group names have the format of `[sort]-[slug]` e.g. `100-internet`. Each group name should start with a number starting from 100 which helps with sorting of the directories and the files. Groups at the same level have the sequential sorting information.
- Each groups children have a separate group and have the name similar to `[sort]-[parent-slug]:[child-slug]` where sort refers to the sorting of the `child-slug` and not the parent. Also parent-slug does not need to have the sorting information as a part of slug e.g. if parent was `100-internet` the children would be `100-internet:how-does-the-internet-work`, `101-internet:what-is-http`, `102-internet:browsers`.

View File

@@ -1,163 +0,0 @@
const fs = require('fs');
const path = require('path');
const CONTENT_DIR = path.join(__dirname, '../content');
// Directory containing the roadmaps
const ROADMAP_CONTENT_DIR = path.join(__dirname, '../src/roadmaps');
const roadmapId = process.argv[2];
const allowedRoadmapIds = fs.readdirSync(ROADMAP_CONTENT_DIR);
if (!roadmapId) {
console.error('roadmapId is required');
process.exit(1);
}
if (!allowedRoadmapIds.includes(roadmapId)) {
console.error(`Invalid roadmap key ${roadmapId}`);
console.error(`Allowed keys are ${allowedRoadmapIds.join(', ')}`);
process.exit(1);
}
// Directory holding the roadmap content files
const roadmapDirName = fs
.readdirSync(ROADMAP_CONTENT_DIR)
.find((dirName) => dirName.replace(/\d+-/, '') === roadmapId);
if (!roadmapDirName) {
console.error('Roadmap directory not found');
process.exit(1);
}
const roadmapDirPath = path.join(ROADMAP_CONTENT_DIR, roadmapDirName);
const roadmapContentDirPath = path.join(
ROADMAP_CONTENT_DIR,
roadmapDirName,
'content'
);
// If roadmap content already exists do not proceed as it would override the files
if (fs.existsSync(roadmapContentDirPath)) {
console.error(`Roadmap content already exists @ ${roadmapContentDirPath}`);
process.exit(1);
}
function prepareDirTree(control, dirTree, dirSortOrders) {
// Directories are only created for groups
if (control.typeID !== '__group__') {
return;
}
// e.g. 104-testing-your-apps:other-options
const controlName = control?.properties?.controlName || '';
// e.g. 104
const sortOrder = controlName.match(/^\d+/)?.[0];
// No directory for a group without control name
if (!controlName || !sortOrder) {
return;
}
// e.g. testing-your-apps:other-options
const controlNameWithoutSortOrder = controlName.replace(/^\d+-/, '');
// e.g. ['testing-your-apps', 'other-options']
const dirParts = controlNameWithoutSortOrder.split(':');
// Nest the dir path in the dirTree
let currDirTree = dirTree;
dirParts.forEach((dirPart) => {
currDirTree[dirPart] = currDirTree[dirPart] || {};
currDirTree = currDirTree[dirPart];
});
dirSortOrders[controlNameWithoutSortOrder] = Number(sortOrder);
const childrenControls = control.children.controls.control;
// No more children
if (childrenControls.length) {
childrenControls.forEach((childControl) => {
prepareDirTree(childControl, dirTree, dirSortOrders);
});
}
return { dirTree, dirSortOrders };
}
const roadmap = require(path.join(__dirname, `../public/jsons/roadmaps/${roadmapId}`));
const controls = roadmap.mockup.controls.control;
// Prepare the dir tree that we will be creating and also calculate the sort orders
const dirTree = {};
const dirSortOrders = {};
controls.forEach((control) => {
prepareDirTree(control, dirTree, dirSortOrders);
});
/**
* @param parentDir Parent directory in which directory is to be created
* @param dirTree Nested dir tree to be created
* @param sortOrders Mapping from groupName to sort order
* @param filePaths The mapping from groupName to file path
*/
function createDirTree(parentDir, dirTree, sortOrders, filePaths = {}) {
const childrenDirNames = Object.keys(dirTree);
const hasChildren = childrenDirNames.length !== 0;
// @todo write test for this, yolo for now
const groupName = parentDir
.replace(roadmapContentDirPath, '') // Remove base dir path
.replace(/(^\/)|(\/$)/g, '') // Remove trailing slashes
.replace(/(^\d+?-)/g, '') // Remove sorting information
.replaceAll('/', ':') // Replace slashes with `:`
.replace(/:\d+-/, ':');
const humanizedGroupName = groupName
.split(':')
.pop()
?.replaceAll('-', ' ')
.replace(/^\w/, ($0) => $0.toUpperCase());
const sortOrder = sortOrders[groupName] || '';
// Attach sorting information to dirname
// e.g. /roadmaps/100-frontend/content/internet
// ———> /roadmaps/100-frontend/content/103-internet
if (sortOrder) {
parentDir = parentDir.replace(/(.+?)([^\/]+)?$/, `$1${sortOrder}-$2`);
}
// If no children, create a file for this under the parent directory
if (!hasChildren) {
let fileName = `${parentDir}.md`;
fs.writeFileSync(fileName, `# ${humanizedGroupName}`);
filePaths[groupName || 'home'] = fileName.replace(CONTENT_DIR, '');
return filePaths;
}
// There *are* children, so create the parent as a directory
// and create `index.md` as the content file for this
fs.mkdirSync(parentDir);
let readmeFilePath = path.join(parentDir, 'index.md');
fs.writeFileSync(readmeFilePath, `# ${humanizedGroupName}`);
filePaths[groupName || 'home'] = readmeFilePath.replace(CONTENT_DIR, '');
// For each of the directory names, create a
// directory inside the given directory
childrenDirNames.forEach((dirName) => {
createDirTree(
path.join(parentDir, dirName),
dirTree[dirName],
dirSortOrders,
filePaths
);
});
return filePaths;
}
// Create directories and get back the paths for created directories
createDirTree(roadmapContentDirPath, dirTree, dirSortOrders);
console.log('Created roadmap content directory structure');

View File

@@ -14,21 +14,21 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities

View File

@@ -23,7 +23,7 @@ For the existing roadmaps, please follow the details listed for the nature of co
## Adding Content
Find [the content directory inside the relevant roadmap](https://github.com/kamranahmedse/developer-roadmap/tree/master/src/roadmaps). Please keep the following guidelines in mind when submitting content:
Find [the content directory inside the relevant roadmap](https://github.com/kamranahmedse/developer-roadmap/tree/master/src/data/roadmaps). Please keep the following guidelines in mind when submitting content:
- Content must be in English.
- Put a brief description about the topic on top of the file and the a list of links below with each link having title of the URL.

View File

@@ -8,33 +8,47 @@
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"format": "prettier --write .",
"astro": "astro",
"deploy": "NODE_DEBUG=gh-pages gh-pages -d dist -t",
"compress:jsons": "node bin/compress-jsons.cjs",
"compress:jsons": "node scripts/compress-jsons.cjs",
"upgrade": "ncu -u",
"roadmap-links": "node bin/roadmap-links.cjs",
"roadmap-content": "node bin/roadmap-content.cjs",
"best-practice-content": "node bin/best-practice-content.cjs",
"roadmap-links": "node scripts/roadmap-links.cjs",
"roadmap-dirs": "node scripts/roadmap-dirs.cjs",
"roadmap-content": "node scripts/roadmap-content.cjs",
"best-practice-dirs": "node scripts/best-practice-dirs.cjs",
"best-practice-content": "node scripts/best-practice-content.cjs",
"test:e2e": "playwright test"
},
"dependencies": {
"@astrojs/sitemap": "^1.0.0",
"@astrojs/tailwind": "^2.1.3",
"astro": "^1.9.2",
"astro-compress": "^1.1.28",
"node-html-parser": "^6.1.4",
"npm-check-updates": "^16.6.2",
"rehype-external-links": "^2.0.1",
"roadmap-renderer": "^1.0.4",
"tailwindcss": "^3.2.4"
"@astrojs/preact": "^2.2.0",
"@astrojs/sitemap": "^1.3.1",
"@astrojs/tailwind": "^3.1.3",
"@fingerprintjs/fingerprintjs": "^3.4.1",
"@nanostores/preact": "^0.4.1",
"astro": "^2.5.0",
"astro-compress": "^1.1.43",
"jose": "^4.14.4",
"js-cookie": "^3.0.5",
"nanostores": "^0.8.1",
"node-html-parser": "^6.1.5",
"npm-check-updates": "^16.10.12",
"preact": "^10.14.1",
"rehype-external-links": "^2.1.0",
"roadmap-renderer": "^1.0.6",
"tailwindcss": "^3.3.2"
},
"devDependencies": {
"@playwright/test": "^1.29.2",
"@playwright/test": "^1.33.0",
"@tailwindcss/typography": "^0.5.9",
"@types/js-cookie": "^3.0.3",
"csv-parser": "^3.0.0",
"gh-pages": "^5.0.0",
"json-to-pretty-yaml": "^1.2.2",
"js-yaml": "^4.1.0",
"markdown-it": "^13.0.1",
"prettier": "^2.8.3",
"prettier-plugin-astro": "^0.7.2"
"openai": "^3.2.1",
"prettier": "^2.8.8",
"prettier-plugin-astro": "^0.9.0",
"prettier-plugin-tailwindcss": "^0.3.0"
}
}

View File

@@ -100,7 +100,7 @@ const config: PlaywrightTestConfig = {
/* Run your local dev server before starting the tests */
webServer: {
command: 'npm run dev',
url: "http://localhost:3000",
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
},
};

3299
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 KiB

View File

@@ -1,13 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 36 36">
<path fill="#000" d="M22.25 4h-8.5a1 1 0 0 0-.96.73l-5.54 19.4a.5.5 0 0 0 .62.62l5.05-1.44a2 2 0 0 0 1.38-1.4l3.22-11.66a.5.5 0 0 1 .96 0l3.22 11.67a2 2 0 0 0 1.38 1.39l5.05 1.44a.5.5 0 0 0 .62-.62l-5.54-19.4a1 1 0 0 0-.96-.73Z"/>
<path fill="url(#gradient)" d="M18 28a7.63 7.63 0 0 1-5-2c-1.4 2.1-.35 4.35.6 5.55.14.17.41.07.47-.15.44-1.8 2.93-1.22 2.93.6 0 2.28.87 3.4 1.72 3.81.34.16.59-.2.49-.56-.31-1.05-.29-2.46 1.29-3.25 3-1.5 3.17-4.83 2.5-6-.67.67-2.6 2-5 2Z"/>
<defs>
<linearGradient id="gradient" x1="16" x2="16" y1="32" y2="24" gradientUnits="userSpaceOnUse">
<stop stop-color="#000"/>
<stop offset="1" stop-color="#000" stop-opacity="0"/>
</linearGradient>
</defs>
<style>
@media (prefers-color-scheme:dark){:root{filter:invert(100%)}}
</style>
</svg>

Before

Width:  |  Height:  |  Size: 873 B

BIN
public/guides/llms.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
public/roadmaps/docker.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 KiB

BIN
public/roadmaps/mongodb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 KiB

View File

@@ -4,16 +4,16 @@
<p align="center">Community driven roadmaps, articles and resources for developers<p>
<p align="center">
<a href="https://roadmap.sh/roadmaps">
<img src="https://img.shields.io/badge/-Roadmaps%20-0a0a0a.svg?style=flat&colorA=0a0a0a" alt="roadmaps" />
<img src="https://img.shields.io/badge/%E2%9C%A8-Roadmaps%20-0a0a0a.svg?style=flat&colorA=0a0a0a" alt="roadmaps" />
</a>
<a href="https://roadmap.sh/best-practices">
<img src="https://img.shields.io/badge/%E2%9C%A8-Best%20Practices-0a0a0a.svg?style=flat&colorA=0a0a0a" alt="best practices" />
</a>
<a href="https://youtube.com/theroadmap?sub_confirmation=1">
<img src="https://img.shields.io/badge/-Videos-0a0a0a.svg?style=flat&colorA=0a0a0a" alt="videos" />
</a>
<a href="https://github.com/kamranahmedse/developer-roadmap/tree/0471d44c8fae58b6a36a7c57bba12253916d0249/translations">
<img src="https://img.shields.io/badge/-Translations-0a0a0a.svg?style=flat&colorA=0a0a0a" alt="videos" />
<img src="https://img.shields.io/badge/%E2%9C%A8-Videos-0a0a0a.svg?style=flat&colorA=0a0a0a" alt="videos" />
</a>
<a href="https://www.youtube.com/channel/UCA0H2KIWgWTwpTFjSxp0now?sub_confirmation=1">
<img src="https://img.shields.io/badge/%E2%9D%A4-YouTube%20Channel-0a0a0a.svg?style=flat&colorA=0a0a0a" alt="roadmaps" />
<img src="https://img.shields.io/badge/%E2%9C%A8-YouTube%20Channel-0a0a0a.svg?style=flat&colorA=0a0a0a" alt="roadmaps" />
</a>
</p>
</p>
@@ -33,11 +33,13 @@ Here is the list of available roadmaps with more being actively worked upon.
- [Frontend Roadmap](https://roadmap.sh/frontend)
- [Backend Roadmap](https://roadmap.sh/backend)
- [DevOps Roadmap](https://roadmap.sh/devops)
- [Full Stack Roadmap](https://roadmap.sh/full-stack)
- [Computer Science Roadmap](https://roadmap.sh/computer-science)
- [QA Roadmap](https://roadmap.sh/qa)
- [Software Architect Roadmap](https://roadmap.sh/software-architect)
- [Software Design and Architecture Roadmap](https://roadmap.sh/software-design-architecture)
- [JavaScript Roadmap](https://roadmap.sh/javascript)
- [TypeScript Roadmap](https://roadmap.sh/typescript)
- [React Roadmap](https://roadmap.sh/react)
- [Vue Roadmap](https://roadmap.sh/vue)
- [Angular Roadmap](https://roadmap.sh/angular)
@@ -54,6 +56,18 @@ Here is the list of available roadmaps with more being actively worked upon.
- [Blockchain Roadmap](https://roadmap.sh/blockchain)
- [ASP.NET Core Roadmap](https://roadmap.sh/aspnet-core)
- [System Design Roadmap](https://roadmap.sh/system-design)
- [Kubernetes Roadmap](https://roadmap.sh/kubernetes)
- [Cyber Security Roadmap](https://roadmap.sh/cyber-security)
- [MongoDB Roadmap](https://roadmap.sh/mongodb)
- [UX Design Roadmap](https://roadmap.sh/ux-design)
- [Docker Roadmap](https://roadmap.sh/docker)
We have also added a new form of visual content covering best practices:
- [Code Review Best Practices](https://roadmap.sh/best-practices/code-review)
- [Frontend Performance Best Practices](https://roadmap.sh/best-practices/frontend-performance)
- [API Security Best Practices](https://roadmap.sh/best-practices/api-security)
- [AWS Best Practices](https://roadmap.sh/best-practices/aws)
![](https://i.imgur.com/waxVImv.png)

View File

@@ -0,0 +1,173 @@
const fs = require('fs');
const path = require('path');
const OPEN_AI_API_KEY = process.env.OPEN_AI_API_KEY;
const ALL_BEST_PRACTICES_DIR = path.join(
__dirname,
'../src/data/best-practices'
);
const BEST_PRACTICE_JSON_DIR = path.join(
__dirname,
'../public/jsons/best-practices'
);
const bestPracticeId = process.argv[2];
const bestPracticeTitle = bestPracticeId.replace(/-/g, ' ');
const allowedBestPracticeIds = fs.readdirSync(ALL_BEST_PRACTICES_DIR);
if (!bestPracticeId) {
console.error('bestPracticeId is required');
process.exit(1);
}
if (!allowedBestPracticeIds.includes(bestPracticeId)) {
console.error(`Invalid bestPractice key ${bestPracticeId}`);
console.error(`Allowed keys are ${allowedBestPracticeIds.join(', ')}`);
process.exit(1);
}
const BEST_PRACTICE_CONTENT_DIR = path.join(
ALL_BEST_PRACTICES_DIR,
bestPracticeId,
'content'
);
const { Configuration, OpenAIApi } = require('openai');
const configuration = new Configuration({
apiKey: OPEN_AI_API_KEY,
});
const openai = new OpenAIApi(configuration);
function getFilesInFolder(folderPath, fileList = {}) {
const files = fs.readdirSync(folderPath);
files.forEach((file) => {
const filePath = path.join(folderPath, file);
const stats = fs.statSync(filePath);
if (stats.isDirectory()) {
getFilesInFolder(filePath, fileList);
} else if (stats.isFile()) {
const fileUrl = filePath
.replace(BEST_PRACTICE_CONTENT_DIR, '') // Remove the content folder
.replace(/\/\d+-/g, '/') // Remove ordering info `/101-ecosystem`
.replace(/\/index\.md$/, '') // Make the `/index.md` to become the parent folder only
.replace(/\.md$/, ''); // Remove `.md` from the end of file
fileList[fileUrl] = filePath;
}
});
return fileList;
}
function writeTopicContent(topicTitle) {
let prompt = `I am reading a guide that has best practices about "${bestPracticeTitle}". I want to know more about "${topicTitle}". Write me a brief introductory paragraph about this and some tips on how I make sure of this? Behave as if you are the author of the guide.`;
console.log(`Generating '${topicTitle}'...`);
return new Promise((resolve, reject) => {
openai
.createChatCompletion({
model: 'gpt-4',
messages: [
{
role: 'user',
content: prompt,
},
],
})
.then((response) => {
const article = response.data.choices[0].message.content;
resolve(article);
})
.catch((err) => {
reject(err);
});
});
}
async function writeFileForGroup(group, topicUrlToPathMapping) {
const topicId = group?.properties?.controlName;
const topicTitle = group?.children?.controls?.control?.find(
(control) => control?.typeID === 'Label'
)?.properties?.text;
const currTopicUrl = `/${topicId}`;
if (currTopicUrl.startsWith('/check:')) {
return;
}
const contentFilePath = topicUrlToPathMapping[currTopicUrl];
if (!contentFilePath) {
console.log(`Missing file for: ${currTopicUrl}`);
process.exit(0);
return;
}
const currentFileContent = fs.readFileSync(contentFilePath, 'utf8');
const isFileEmpty = currentFileContent.replace(/^#.+/, ``).trim() === '';
if (!isFileEmpty) {
console.log(`Ignoring ${topicId}. Not empty.`);
return;
}
let newFileContent = `# ${topicTitle}`;
if (!OPEN_AI_API_KEY) {
console.log(`Writing ${topicId}..`);
fs.writeFileSync(contentFilePath, newFileContent, 'utf8');
return;
}
const topicContent = await writeTopicContent(topicTitle);
newFileContent += `\n\n${topicContent}`;
console.log(`Writing ${topicId}..`);
fs.writeFileSync(contentFilePath, newFileContent, 'utf8');
// console.log(currentFileContent);
// console.log(currTopicUrl);
// console.log(topicTitle);
// console.log(topicUrlToPathMapping[currTopicUrl]);
}
async function run() {
const topicUrlToPathMapping = getFilesInFolder(BEST_PRACTICE_CONTENT_DIR);
const bestPracticeJson = require(path.join(
BEST_PRACTICE_JSON_DIR,
`${bestPracticeId}.json`
));
const groups = bestPracticeJson?.mockup?.controls?.control?.filter(
(control) =>
control.typeID === '__group__' &&
!control.properties?.controlName?.startsWith('ext_link')
);
if (!OPEN_AI_API_KEY) {
console.log('----------------------------------------');
console.log('OPEN_AI_API_KEY not found. Skipping openai api calls...');
console.log('----------------------------------------');
}
const writePromises = [];
for (let group of groups) {
writePromises.push(writeFileForGroup(group, topicUrlToPathMapping));
}
console.log('Waiting for all files to be written...');
await Promise.all(writePromises);
}
run()
.then(() => {
console.log('Done');
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@@ -0,0 +1,155 @@
const fs = require('fs');
const path = require('path');
const CONTENT_DIR = path.join(__dirname, '../content');
// Directory containing the best-practices
const BEST_PRACTICE_CONTENT_DIR = path.join(
__dirname,
'../src/data/best-practices'
);
const bestPracticeId = process.argv[2];
const allowedBestPracticeId = fs.readdirSync(BEST_PRACTICE_CONTENT_DIR);
if (!bestPracticeId) {
console.error('bestPractice is required');
process.exit(1);
}
if (!allowedBestPracticeId.includes(bestPracticeId)) {
console.error(`Invalid best practice key ${bestPracticeId}`);
console.error(`Allowed keys are ${allowedBestPracticeId.join(', ')}`);
process.exit(1);
}
// Directory holding the best parctice content files
const bestPracticeDirName = fs
.readdirSync(BEST_PRACTICE_CONTENT_DIR)
.find((dirName) => dirName.replace(/\d+-/, '') === bestPracticeId);
if (!bestPracticeDirName) {
console.error('Best practice directory not found');
process.exit(1);
}
const bestPracticeDirPath = path.join(
BEST_PRACTICE_CONTENT_DIR,
bestPracticeDirName
);
const bestPracticeContentDirPath = path.join(
BEST_PRACTICE_CONTENT_DIR,
bestPracticeDirName,
'content'
);
// If best practice content already exists do not proceed as it would override the files
if (fs.existsSync(bestPracticeContentDirPath)) {
console.error(
`Best Practice content already exists @ ${bestPracticeContentDirPath}`
);
process.exit(1);
}
function prepareDirTree(control, dirTree) {
// Directories are only created for groups
if (control.typeID !== '__group__') {
return;
}
// e.g. 104-testing-your-apps:other-options
const controlName = control?.properties?.controlName || '';
// No directory for a group without control name
if (
!controlName ||
controlName.startsWith('check:') ||
controlName.startsWith('ext_link:')
) {
return;
}
// e.g. ['testing-your-apps', 'other-options']
const dirParts = controlName.split(':');
// Nest the dir path in the dirTree
let currDirTree = dirTree;
dirParts.forEach((dirPart) => {
currDirTree[dirPart] = currDirTree[dirPart] || {};
currDirTree = currDirTree[dirPart];
});
const childrenControls = control.children.controls.control;
// No more children
if (childrenControls.length) {
childrenControls.forEach((childControl) => {
prepareDirTree(childControl, dirTree);
});
}
return { dirTree };
}
const bestPractice = require(path.join(
__dirname,
`../public/jsons/best-practices/${bestPracticeId}`
));
const controls = bestPractice.mockup.controls.control;
// Prepare the dir tree that we will be creating
const dirTree = {};
controls.forEach((control) => {
prepareDirTree(control, dirTree);
});
/**
* @param parentDir Parent directory in which directory is to be created
* @param dirTree Nested dir tree to be created
* @param filePaths The mapping from groupName to file path
*/
function createDirTree(parentDir, dirTree, filePaths = {}) {
const childrenDirNames = Object.keys(dirTree);
const hasChildren = childrenDirNames.length !== 0;
// @todo write test for this, yolo for now
const groupName = parentDir
.replace(bestPracticeContentDirPath, '') // Remove base dir path
.replace(/(^\/)|(\/$)/g, '') // Remove trailing slashes
.replaceAll('/', ':') // Replace slashes with `:`
.replace(/:\d+-/, ':');
const humanizedGroupName = groupName
.split(':')
.pop()
?.replaceAll('-', ' ')
.replace(/^\w/, ($0) => $0.toUpperCase());
// If no children, create a file for this under the parent directory
if (!hasChildren) {
let fileName = `${parentDir}.md`;
fs.writeFileSync(fileName, `# ${humanizedGroupName}`);
filePaths[groupName || 'home'] = fileName.replace(CONTENT_DIR, '');
return filePaths;
}
// There *are* children, so create the parent as a directory
// and create `index.md` as the content file for this
fs.mkdirSync(parentDir);
let readmeFilePath = path.join(parentDir, 'index.md');
fs.writeFileSync(readmeFilePath, `# ${humanizedGroupName}`);
filePaths[groupName || 'home'] = readmeFilePath.replace(CONTENT_DIR, '');
// For each of the directory names, create a
// directory inside the given directory
childrenDirNames.forEach((dirName) => {
createDirTree(path.join(parentDir, dirName), dirTree[dirName], filePaths);
});
return filePaths;
}
// Create directories and get back the paths for created directories
createDirTree(bestPracticeContentDirPath, dirTree);
console.log('Created best practice content directory structure');

129
scripts/page-data-agg.cjs Normal file
View File

@@ -0,0 +1,129 @@
const csv = require('csv-parser');
const fs = require('fs');
const path = require('path');
const csvFilePath = path.join(__dirname, '../data.csv');
const results = {};
const pageSummary = {};
fs.createReadStream(csvFilePath)
.pipe(
csv({
separator: ',',
mapHeaders: ({ header, index }) =>
header.toLowerCase().replace(/ /g, '_'),
mapValues: ({ header, index, value }) => {
if (header === 'page') {
return (
value
.replace(/"/g, '')
.replace(/'/g, '')
.replace(/`/g, '')
.replace(/\?r=/g, '#r#')
.replace(/\?.+?$/g, '')
.replace(/#r#/g, '?r=')
.replace(/\/$/g, '') || '/'
);
}
if (header !== 'month_of_year') {
return parseInt(value, 10);
}
return value;
},
})
)
.on('data', (data) => {
const { page, month_of_year, unique_pageviews, users } = data;
const pageData = results[page] || {};
const existingPageMonthData = pageData[month_of_year] || {};
const existingViews = existingPageMonthData.views || 0;
const existingUsers = existingPageMonthData.users || 0;
const newViews = existingViews + unique_pageviews;
const newUsers = existingUsers + users;
pageData[month_of_year] = {
views: newViews,
users: newUsers,
};
results[page] = pageData;
pageSummary[page] = pageSummary[page] || { views: 0, users: 0 };
pageSummary[page].views += unique_pageviews;
pageSummary[page].users += users;
})
.on('end', () => {
const csvHeader = [
'Page',
'Jan 2022',
'Feb 2022',
'Mar 2022',
'Apr 2022',
'May 2022',
'Jun 2022',
'Jul 2022',
'Aug 2022',
'Sep 2022',
'Oct 2022',
'Nov 2022',
'Dec 2022',
'Jan 2023',
'Feb 2023',
'Mar 2023',
'Apr 2023',
'May 2023',
'Jun 2023',
'Jul 2023',
'Aug 2023',
'Sep 2023',
'Oct 2023',
'Nov 2023',
'Dec 2023',
];
const csvRows = Object.keys(pageSummary)
.filter(pageUrl => pageSummary[pageUrl].views > 10)
.filter(pageUrl => !['/upcoming', '/pdfs', '/signup', '/login', '/@'].includes(pageUrl))
.sort((pageA, pageB) => {
const aViews = pageSummary[pageA].views;
const bViews = pageSummary[pageB].views;
return bViews - aViews;
})
.map((pageUrl) => {
const rawPageResult = results[pageUrl];
const pageResultCsvRow = [];
csvHeader.forEach((csvHeaderItem) => {
if (csvHeaderItem === 'Page') {
pageResultCsvRow.push(pageUrl);
return;
}
const csvHeaderItemAlt = csvHeaderItem
.replace(/ /g, '_')
.toLowerCase();
const result = rawPageResult[csvHeaderItem || csvHeaderItemAlt] || {};
const views = result.views || 0;
const users = result.users || 0;
pageResultCsvRow.push(users);
});
return pageResultCsvRow;
});
const finalCsvRows = [csvHeader, ...csvRows];
const csvRowStrings = finalCsvRows.map((row) => {
return row.join(',');
});
const csvString = csvRowStrings.join('\n');
fs.writeFileSync(path.join(__dirname, '../data-agg.csv'), csvString);
});

37
scripts/readme.md Normal file
View File

@@ -0,0 +1,37 @@
## CLI Tools
> A bunch of CLI scripts to make the development easier
## `roadmap-links.cjs`
Generates a list of all the resources links in any roadmap file.
## `compress-jsons.cjs`
Compresses all the JSON files in the `public/jsons` folder
## `update-sponsors.cjs`
Updates the sponsor ads on each roadmap page with the latest sponsor information in the Excel sheet.
## `roadmap-content.cjs`
Currently, for any new roadmaps that we add, we do create the interactive roadmap but we end up leaving the content empty in the roadmap till we get time to fill it up manually.
This script populates all the content files with some minimal content from OpenAI so that the users visiting the website have something to read in the interactive roadmap till we get time to fill it up manually.
## `roadmap-dirs.cjs`
This command is used to create the content folders and files for the interactivity of the roadmap. You can use the below command to generate the roadmap skeletons inside a roadmap directory:
```bash
npm run roadmap-dirs [frontend|backend|devops|...]
```
For the content skeleton to be generated, we should have proper grouping, and the group names in the project files. You can follow the steps listed below in order to add the meta information to the roadmap.
- Remove all the groups from the roadmaps through the project editor. Select all and press `cmd+shift+g`
- Identify the boxes that should be clickable and group them together with `cmd+shift+g`
- Assign the name to the groups.
- Group names have the format of `[sort]-[slug]` e.g. `100-internet`. Each group name should start with a number starting from 100 which helps with sorting of the directories and the files. Groups at the same level have the sequential sorting information.
- Each groups children have a separate group and have the name similar to `[sort]-[parent-slug]:[child-slug]` where sort refers to the sorting of the `child-slug` and not the parent. Also parent-slug does not need to have the sorting information as a part of slug e.g. if parent was `100-internet` the children would be `100-internet:how-does-the-internet-work`, `101-internet:what-is-http`, `102-internet:browsers`.

171
scripts/roadmap-content.cjs Normal file
View File

@@ -0,0 +1,171 @@
const fs = require('fs');
const path = require('path');
const OPEN_AI_API_KEY = process.env.OPEN_AI_API_KEY;
const ALL_ROADMAPS_DIR = path.join(__dirname, '../src/data/roadmaps');
const ROADMAP_JSON_DIR = path.join(__dirname, '../public/jsons/roadmaps');
const roadmapId = process.argv[2];
const allowedRoadmapIds = fs.readdirSync(ALL_ROADMAPS_DIR);
if (!roadmapId) {
console.error('roadmapId is required');
process.exit(1);
}
if (!allowedRoadmapIds.includes(roadmapId)) {
console.error(`Invalid roadmap key ${roadmapId}`);
console.error(`Allowed keys are ${allowedRoadmapIds.join(', ')}`);
process.exit(1);
}
const ROADMAP_CONTENT_DIR = path.join(ALL_ROADMAPS_DIR, roadmapId, 'content');
const { Configuration, OpenAIApi } = require('openai');
const configuration = new Configuration({
apiKey: OPEN_AI_API_KEY,
});
const openai = new OpenAIApi(configuration);
function getFilesInFolder(folderPath, fileList = {}) {
const files = fs.readdirSync(folderPath);
files.forEach((file) => {
const filePath = path.join(folderPath, file);
const stats = fs.statSync(filePath);
if (stats.isDirectory()) {
getFilesInFolder(filePath, fileList);
} else if (stats.isFile()) {
const fileUrl = filePath
.replace(ROADMAP_CONTENT_DIR, '') // Remove the content folder
.replace(/\/\d+-/g, '/') // Remove ordering info `/101-ecosystem`
.replace(/\/index\.md$/, '') // Make the `/index.md` to become the parent folder only
.replace(/\.md$/, ''); // Remove `.md` from the end of file
fileList[fileUrl] = filePath;
}
});
return fileList;
}
function writeTopicContent(currTopicUrl) {
const [parentTopic, childTopic] = currTopicUrl
.replace(/^\d+-/g, '/')
.replace(/:/g, '/')
.replace(/^\//, '')
.split('/')
.slice(-2)
.map((topic) => topic.replace(/-/g, ' '));
const roadmapTitle = roadmapId.replace(/-/g, ' ');
let prompt = `I am reading a guide about "${roadmapTitle}". I am on the topic "${parentTopic}". I want to know more about "${childTopic}". Write me a brief summary for that topic. Content should be in markdown. Behave as if you are the author of the guide.`;
if (!childTopic) {
prompt = `I am reading a guide about "${roadmapTitle}". I am on the topic "${parentTopic}". I want to know more about "${parentTopic}". Write me a brief summary for that topic. Content should be in markdown. Behave as if you are the author of the guide.`;
}
console.log(`Generating '${childTopic || parentTopic}'...`);
return new Promise((resolve, reject) => {
openai
.createChatCompletion({
model: 'gpt-4',
messages: [
{
role: 'user',
content: prompt,
},
],
})
.then((response) => {
const article = response.data.choices[0].message.content;
resolve(article);
})
.catch((err) => {
reject(err);
});
});
}
async function writeFileForGroup(group, topicUrlToPathMapping) {
const topicId = group?.properties?.controlName;
const topicTitle = group?.children?.controls?.control?.find(
(control) => control?.typeID === 'Label'
)?.properties?.text;
const currTopicUrl = topicId?.replace(/^\d+-/g, '/')?.replace(/:/g, '/');
if (!currTopicUrl) {
return;
}
const contentFilePath = topicUrlToPathMapping[currTopicUrl];
if (!contentFilePath) {
console.log(`Missing file for: ${currTopicUrl}`);
return;
}
const currentFileContent = fs.readFileSync(contentFilePath, 'utf8');
const isFileEmpty = currentFileContent.replace(/^#.+/, ``).trim() === '';
if (!isFileEmpty) {
console.log(`Ignoring ${topicId}. Not empty.`);
return;
}
let newFileContent = `# ${topicTitle}`;
if (!OPEN_AI_API_KEY) {
console.log(`Writing ${topicId}..`);
fs.writeFileSync(contentFilePath, newFileContent, 'utf8');
return;
}
const topicContent = await writeTopicContent(currTopicUrl);
newFileContent += `\n\n${topicContent}`;
console.log(`Writing ${topicId}..`);
fs.writeFileSync(contentFilePath, newFileContent, 'utf8');
// console.log(currentFileContent);
// console.log(currTopicUrl);
// console.log(topicTitle);
// console.log(topicUrlToPathMapping[currTopicUrl]);
}
async function run() {
const topicUrlToPathMapping = getFilesInFolder(ROADMAP_CONTENT_DIR);
const roadmapJson = require(path.join(ROADMAP_JSON_DIR, `${roadmapId}.json`));
const groups = roadmapJson?.mockup?.controls?.control?.filter(
(control) =>
control.typeID === '__group__' &&
!control.properties?.controlName?.startsWith('ext_link')
);
if (!OPEN_AI_API_KEY) {
console.log('----------------------------------------');
console.log('OPEN_AI_API_KEY not found. Skipping openai api calls...');
console.log('----------------------------------------');
}
const writePromises = [];
for (let group of groups) {
writePromises.push(writeFileForGroup(group, topicUrlToPathMapping));
}
console.log('Waiting for all files to be written...');
await Promise.all(writePromises);
}
run()
.then(() => {
console.log('Done');
})
.catch((err) => {
console.error(err);
process.exit(1);
});

166
scripts/roadmap-dirs.cjs Normal file
View File

@@ -0,0 +1,166 @@
const fs = require('fs');
const path = require('path');
const CONTENT_DIR = path.join(__dirname, '../content');
// Directory containing the roadmaps
const ROADMAP_CONTENT_DIR = path.join(__dirname, '../src/data/roadmaps');
const roadmapId = process.argv[2];
const allowedRoadmapIds = fs.readdirSync(ROADMAP_CONTENT_DIR);
if (!roadmapId) {
console.error('roadmapId is required');
process.exit(1);
}
if (!allowedRoadmapIds.includes(roadmapId)) {
console.error(`Invalid roadmap key ${roadmapId}`);
console.error(`Allowed keys are ${allowedRoadmapIds.join(', ')}`);
process.exit(1);
}
// Directory holding the roadmap content files
const roadmapDirName = fs
.readdirSync(ROADMAP_CONTENT_DIR)
.find((dirName) => dirName.replace(/\d+-/, '') === roadmapId);
if (!roadmapDirName) {
console.error('Roadmap directory not found');
process.exit(1);
}
const roadmapDirPath = path.join(ROADMAP_CONTENT_DIR, roadmapDirName);
const roadmapContentDirPath = path.join(
ROADMAP_CONTENT_DIR,
roadmapDirName,
'content'
);
// If roadmap content already exists do not proceed as it would override the files
if (fs.existsSync(roadmapContentDirPath)) {
console.error(`Roadmap content already exists @ ${roadmapContentDirPath}`);
process.exit(1);
}
function prepareDirTree(control, dirTree, dirSortOrders) {
// Directories are only created for groups
if (control.typeID !== '__group__') {
return;
}
// e.g. 104-testing-your-apps:other-options
const controlName = control?.properties?.controlName || '';
// e.g. 104
const sortOrder = controlName.match(/^\d+/)?.[0];
// No directory for a group without control name
if (!controlName || !sortOrder) {
return;
}
// e.g. testing-your-apps:other-options
const controlNameWithoutSortOrder = controlName.replace(/^\d+-/, '');
// e.g. ['testing-your-apps', 'other-options']
const dirParts = controlNameWithoutSortOrder.split(':');
// Nest the dir path in the dirTree
let currDirTree = dirTree;
dirParts.forEach((dirPart) => {
currDirTree[dirPart] = currDirTree[dirPart] || {};
currDirTree = currDirTree[dirPart];
});
dirSortOrders[controlNameWithoutSortOrder] = Number(sortOrder);
const childrenControls = control.children.controls.control;
// No more children
if (childrenControls.length) {
childrenControls.forEach((childControl) => {
prepareDirTree(childControl, dirTree, dirSortOrders);
});
}
return { dirTree, dirSortOrders };
}
const roadmap = require(path.join(
__dirname,
`../public/jsons/roadmaps/${roadmapId}`
));
const controls = roadmap.mockup.controls.control;
// Prepare the dir tree that we will be creating and also calculate the sort orders
const dirTree = {};
const dirSortOrders = {};
controls.forEach((control) => {
prepareDirTree(control, dirTree, dirSortOrders);
});
/**
* @param parentDir Parent directory in which directory is to be created
* @param dirTree Nested dir tree to be created
* @param sortOrders Mapping from groupName to sort order
* @param filePaths The mapping from groupName to file path
*/
function createDirTree(parentDir, dirTree, sortOrders, filePaths = {}) {
const childrenDirNames = Object.keys(dirTree);
const hasChildren = childrenDirNames.length !== 0;
// @todo write test for this, yolo for now
const groupName = parentDir
.replace(roadmapContentDirPath, '') // Remove base dir path
.replace(/(^\/)|(\/$)/g, '') // Remove trailing slashes
.replace(/(^\d+?-)/g, '') // Remove sorting information
.replaceAll('/', ':') // Replace slashes with `:`
.replace(/:\d+-/, ':');
const humanizedGroupName = groupName
.split(':')
.pop()
?.replaceAll('-', ' ')
.replace(/^\w/, ($0) => $0.toUpperCase());
const sortOrder = sortOrders[groupName] || '';
// Attach sorting information to dirname
// e.g. /roadmaps/100-frontend/content/internet
// ———> /roadmaps/100-frontend/content/103-internet
if (sortOrder) {
parentDir = parentDir.replace(/(.+?)([^\/]+)?$/, `$1${sortOrder}-$2`);
}
// If no children, create a file for this under the parent directory
if (!hasChildren) {
let fileName = `${parentDir}.md`;
fs.writeFileSync(fileName, `# ${humanizedGroupName}`);
filePaths[groupName || 'home'] = fileName.replace(CONTENT_DIR, '');
return filePaths;
}
// There *are* children, so create the parent as a directory
// and create `index.md` as the content file for this
fs.mkdirSync(parentDir);
let readmeFilePath = path.join(parentDir, 'index.md');
fs.writeFileSync(readmeFilePath, `# ${humanizedGroupName}`);
filePaths[groupName || 'home'] = readmeFilePath.replace(CONTENT_DIR, '');
// For each of the directory names, create a
// directory inside the given directory
childrenDirNames.forEach((dirName) => {
createDirTree(
path.join(parentDir, dirName),
dirTree[dirName],
dirSortOrders,
filePaths
);
});
return filePaths;
}
// Create directories and get back the paths for created directories
createDirTree(roadmapContentDirPath, dirTree, dirSortOrders);
console.log('Created roadmap content directory structure');

View File

@@ -6,7 +6,7 @@ if (!roadmapId) {
console.error('Error: roadmapId is required');
}
const fullPath = path.join(__dirname, `../src/roadmaps/${roadmapId}`);
const fullPath = path.join(__dirname, `../src/data/roadmaps/${roadmapId}`);
if (!fs.existsSync(fullPath)) {
console.error(`Error: path not found: ${fullPath}!`);
process.exit(1);

167
scripts/update-sponsors.cjs Normal file
View File

@@ -0,0 +1,167 @@
const path = require('path');
const fs = require('fs');
const yaml = require('js-yaml');
const apiKey = process.env.SPONSOR_SHEET_API_KEY;
const sheetId = process.env.SPONSOR_SHEET_ID;
if (!apiKey || !sheetId) {
console.error('Missing API key or sheet ID');
process.exit(1);
}
const sheetRange = 'A3:I1001';
const sheetUrl = `https://sheets.googleapis.com/v4/spreadsheets/${sheetId}/values/${sheetRange}?key=${apiKey}`;
function removeAllSponsors(baseContentDir) {
console.log('------------------------');
console.log('Removing sponsors from: ', baseContentDir);
console.log('------------------------');
const dataDirPath = path.join(__dirname, '../src/data');
const contentDirPath = path.join(dataDirPath, baseContentDir);
const contentDir = fs.readdirSync(contentDirPath);
contentDir.forEach((content) => {
console.log('Removing sponsors from: ', content);
const pageFilePath = path.join(contentDirPath, content, `${content}.md`);
const pageFileContent = fs.readFileSync(pageFilePath, 'utf8');
const frontMatterRegex = /---\n([\s\S]*?)\n---/;
const existingFrontmatter = pageFileContent.match(frontMatterRegex)[1];
const contentWithoutFrontmatter = pageFileContent
.replace(frontMatterRegex, ``)
.trim();
let frontmatterObj = yaml.load(existingFrontmatter);
delete frontmatterObj.sponsors;
const newFrontmatter = yaml.dump(frontmatterObj, {
lineWidth: 10000,
forceQuotes: true,
quotingType: "'",
});
const newContent = `---\n${newFrontmatter}---\n${contentWithoutFrontmatter}`;
fs.writeFileSync(pageFilePath, newContent, 'utf8');
});
}
function addPageSponsor({
pageUrl,
company,
redirectUrl,
imageUrl,
adTitle,
adDescription,
}) {
const urlPart = pageUrl
.replace('https://roadmap.sh/', '')
.replace(/\?.+?$/, '');
const parentDir = urlPart.startsWith('best-practices/')
? 'best-practices'
: 'roadmaps';
const pageId = urlPart.replace(`${parentDir}/`, '');
const pageFilePath = path.join(
__dirname,
`../src/data/${parentDir}`,
`${pageId}/${pageId}.md`
);
if (!fs.existsSync(pageFilePath)) {
console.error(`Page file not found: ${pageFilePath}`);
process.exit(1);
}
console.log(`Updating page: ${urlPart}`);
const pageFileContent = fs.readFileSync(pageFilePath, 'utf8');
const frontMatterRegex = /---\n([\s\S]*?)\n---/;
const existingFrontmatter = pageFileContent.match(frontMatterRegex)[1];
const contentWithoutFrontmatter = pageFileContent
.replace(frontMatterRegex, ``)
.trim();
let frontmatterObj = yaml.load(existingFrontmatter);
const sponsors = frontmatterObj.sponsors || [];
const frontmatterValues = Object.entries(frontmatterObj);
const roadmapLabel = frontmatterObj.briefTitle;
sponsors.push({
url: redirectUrl,
title: adTitle,
imageUrl,
description: adDescription,
page: roadmapLabel,
company,
});
// Insert sponsor data at 10 index i.e. after
// roadmap dimensions in the frontmatter
frontmatterValues.splice(10, 0, ['sponsors', sponsors]);
frontmatterObj = Object.fromEntries(frontmatterValues);
const newFrontmatter = yaml.dump(frontmatterObj, {
lineWidth: 10000,
forceQuotes: true,
quotingType: "'",
});
const newContent = `---\n${newFrontmatter}---\n\n${contentWithoutFrontmatter}`;
fs.writeFileSync(pageFilePath, newContent, 'utf8');
}
// Remove sponsors from all roadmaps
removeAllSponsors('roadmaps');
removeAllSponsors('best-practices');
console.log('------------------------');
console.log('Adding sponsors');
console.log('------------------------');
fetch(sheetUrl)
.then((res) => res.json())
.then((rawData) => {
const rows = rawData.values;
rows.map((row) => {
// prettier-ignore
const [
pageUrl,
company,
redirectUrl,
imageUrl,
adTitle,
adDescription,
startDate,
endDate,
isActive,
] = row;
const isConfiguredActive = isActive?.toLowerCase() === 'yes';
const currentDate = new Date();
const isDateInRange =
currentDate >= new Date(startDate) && currentDate <= new Date(endDate);
if (!isConfiguredActive || !isDateInRange) {
return;
}
addPageSponsor({
pageUrl,
company,
redirectUrl,
imageUrl,
adTitle,
adDescription,
startDate,
endDate,
isActive,
});
});
});

View File

@@ -2,20 +2,21 @@ import path from 'node:path';
import fs from 'node:fs/promises';
async function getRoadmapIds() {
return fs.readdir(path.join(process.cwd(), 'src/roadmaps'));
return fs.readdir(path.join(process.cwd(), 'src/data/roadmaps'));
}
async function getBestPracticesIds() {
return fs.readdir(path.join(process.cwd(), 'src/best-practices'));
return fs.readdir(path.join(process.cwd(), 'src/data/best-practices'));
}
export function shouldIndexPage(page) {
export function shouldIndexPage(pageUrl) {
return ![
'https://roadmap.sh/404',
'https://roadmap.sh/terms',
'https://roadmap.sh/privacy',
'https://roadmap.sh/pdfs',
].includes(page);
'https://roadmap.sh/g',
].includes(pageUrl);
}
export async function serializeSitemap(item) {
@@ -26,8 +27,13 @@ export async function serializeSitemap(item) {
'https://roadmap.sh/best-practices',
'https://roadmap.sh/guides',
'https://roadmap.sh/videos',
...(await getRoadmapIds()).flatMap((id) => [`https://roadmap.sh/${id}`, `https://roadmap.sh/${id}/topics`]),
...(await getBestPracticesIds()).map((id) => `https://roadmap.sh/best-practices/${id}`),
...(await getRoadmapIds()).flatMap((id) => [
`https://roadmap.sh/${id}`,
`https://roadmap.sh/${id}/topics`,
]),
...(await getBestPracticesIds()).map(
(id) => `https://roadmap.sh/best-practices/${id}`
),
];
// Roadmaps and other high priority pages
@@ -43,7 +49,10 @@ export async function serializeSitemap(item) {
}
// Guide and video pages
if (item.url.startsWith('https://roadmap.sh/guides') || item.url.startsWith('https://roadmap.sh/videos')) {
if (
item.url.startsWith('https://roadmap.sh/guides') ||
item.url.startsWith('https://roadmap.sh/videos')
) {
return {
...item,
// @ts-ignore

View File

@@ -1,12 +0,0 @@
# Stylesheet Complexity
> Analyzing your stylesheets can help you to flag issues, redundancies and duplicate CSS selectors.
Sometimes you may have redundancies or validation errors in your CSS, analysing your CSS files and removed these complexities can help you to speed up your CSS files (because your browser will read them faster).
Your CSS should be organized, using a CSS preprocessor can help you with that. Some online tools listed below can also help you analysing and correct your code.
- [TestMyCSS | Optimize and Check CSS Performance](http://www.testmycss.com/)
- [CSS Stats](https://cssstats.com/)
- [macbre/analyze-css: CSS selectors complexity and performance analyzer](https://github.com/macbre/analyze-css)
- [Project Wallace](https://www.projectwallace.com/) is like CSS Stats but stores stats over time so you can track your changes

View File

@@ -1,9 +0,0 @@
# Avoid Inline CSS
> Avoid using embed or inline CSS inside your `<body>` (Not valid for HTTP/2)
One of the first reason it's because it's a good practice to separate content from design. It also helps you have a more maintainable code and keep your site accessible. But regarding performance, it's simply because it decreases the file-size of your HTML pages and the load time.
Always use external stylesheets or embed CSS in your `<head>` (and follow the others CSS performance rules)
- [Observe CSS Best Practices: Avoid CSS Inline Styles](https://www.lifewire.com/avoid-inline-styles-for-css-3466846)

View File

@@ -1,5 +0,0 @@
# Page Speed Insights
Page Speed Insights is a free tool from Google that analyzes the performance of a web page and provides suggestions for improvements.
- [Page Speed Insights](https://pagespeed.web.dev/)

View File

@@ -1,90 +0,0 @@
# Recommended Guides
> Optimize the critical rendering path:
* [Critical CSS? Not So Fast!](https://csswizardry.com/2022/09/critical-css-not-so-fast/)
* [Priority Hints - What Your Browser Doesnt Know (Yet)](https://www.etsy.com/codeascraft/priority-hints-what-your-browser-doesnt-know-yet)
* [Optimizing resource loading with Priority Hints](https://web.dev/priority-hints/)
* [Chrome Resource Priorities and Scheduling](https://docs.google.com/document/d/1bCDuq9H1ih9iNjgzyAL0gpwNFiEP4TZS-YLRp_RuMlc/edit?usp=sharing)
* [How To Optimize CSS for Peak Site Performance](https://kinsta.com/blog/optimize-css/)
* [Eliminate render blocking CSS to improve start render time](https://www.jeffreyknox.dev/blog/eliminate-render-blocking-css-to-improve-start-render-time/)
* [Small Bundles, Fast Pages: What To Do With Too Much JavaScript](https://calibreapp.com/blog/bundle-size-optimization)
* [How to Eliminate Render-Blocking Resources: a Deep Dive](https://sia.codes/posts/render-blocking-resources/)
* [The Critical Request: How to Prioritise Requests to Improve Speed](https://calibreapp.com/blog/critical-request)
* [How to Improve CSS Performance](https://calibreapp.com/blog/css-performance)
* [The Simplest Way to Load CSS Asynchronously](https://www.filamentgroup.com/lab/load-css-simpler/)
* [CSS audit](https://css-tricks.com/a-quick-css-audit-and-general-notes-about-design-systems/)
* [Measuring the Critical Rendering Path](https://developers.google.com/web/fundamentals/performance/critical-rendering-path/measure-crp)
* [Inlining or Caching? Both Please!](https://www.filamentgroup.com/lab/inlining-cache.html)
* [CSS and Network Performance](https://csswizardry.com/2018/11/css-and-network-performance/)
* [Analyzing Critical Rendering Path Performance](https://developers.google.com/web/fundamentals/performance/critical-rendering-path/analyzing-crp)
* [Front-End Performance Checklist](https://github.com/thedaviddias/Front-End-Performance-Checklist)
* [The PRPL Pattern](https://developers.google.com/web/fundamentals/performance/prpl-pattern/)
* [Now You See Me: How To Defer, Lazy-Load And Act With IntersectionObserver](https://www.smashingmagazine.com/2018/01/deferring-lazy-loading-intersection-observer-api/)
* [Optimising the front end for the browser](https://hackernoon.com/optimising-the-front-end-for-the-browser-f2f51a29c572)
* [Prefer DEFER Over ASYNC](https://calendar.perfplanet.com/2016/prefer-defer-over-async/)
* [A comprehensive guide to font loading strategies](https://www.zachleat.com/web/comprehensive-webfonts/)
* [Understanding the critical rendering path, rendering pages in 1 second](https://medium.com/@luisvieira_gmr/understanding-the-critical-rendering-path-rendering-pages-in-1-second-735c6e45b47a)
* [More Weight Doesnt Mean More Wait](https://www.filamentgroup.com/lab/weight-wait.html)
> JavaScript Rendering Performance
* [Five Data-Loading Patterns To Boost Web Performance](https://www.smashingmagazine.com/2022/09/data-loading-patterns-improve-frontend-performance/)
* [Optimize long tasks](https://web.dev/optimize-long-tasks/)
* [The impact of removing jQuery on our web performance](https://insidegovuk.blog.gov.uk/2022/08/15/the-impact-of-removing-jquery-on-our-web-performance/)
* [Profiling & Optimizing the runtime performance with the DevTools Performance tab](iamtk.co/profiling-and-optimizing-the-runtime-performance-with-the-devtools-performance-tab)
* [Don't fight the browser preload scanner](https://web.dev/preload-scanner/)
* [The Web Performance impact of jQuery](https://twitter.com/TheRealNooshu/status/1509487050122276864)
* [Have Single-Page Apps Ruined the Web? | Transitional Apps](https://www.youtube.com/watch?v=860d8usGC0o)
* [Improve how you architect webapps](https://www.patterns.dev/)
* [Nuxt SSR Optimizing Tips](https://vueschool.io/articles/vuejs-tutorials/nuxt-ssr-optimizing-tips/, Filip Rakowski
* [GPU accelerated JavaScript](https://gpu.rocks/#/)
* [Introducing Partytown 🎉: Run Third-Party Scripts From a Web Worker](https://dev.to/adamdbradley/introducing-partytown-run-third-party-scripts-from-a-web-worker-2cnp)
* [Astro: Astro is a fresh but familiar approach to building websites. Astro combines decades of proven performance best practices with the DX improvements of the component-oriented era. Use your favorite JavaScript framework and automatically ship the bare-minimum amount of JavaScript—by default.](https://docs.astro.build/getting-started/)
* [Minimising Layout and Layout thrashing for 60 FPS](https://www.charistheo.io/blog/2021/09/dom-reflow-and-layout-thrashing/)
* [Does shadow DOM improve style performance?](https://nolanlawson.com/2021/08/15/does-shadow-dom-improve-style-performance/)
* [Debugging memory leaks - HTTP 203](https://www.youtube.com/watch?v=YDU_3WdfkxA)
* [Explore JavaScript Dependencies With Lighthouse Treemap](https://sia.codes/posts/lighthouse-treemap/)
* [The real cost of Javascript dependencies (and the state of JS package quality)](https://medium.com/voodoo-engineering/the-real-cost-of-javascript-dependencies-and-the-state-of-js-package-quality-a8dacd74c0ec)
* [The State Of Web Workers In 2021](https://www.smashingmagazine.com/2021/06/web-workers-2021/)
* [Techniques for developing high-performance animations](https://web.dev/animations/)
* [Building a Faster Web Experience with the postTask Scheduler](https://medium.com/airbnb-engineering/building-a-faster-web-experience-with-the-posttask-scheduler-276b83454e91), Callie (Airbnb Engineering & Data Science)
* [Dont attach tooltips to document.body Learn how the browser works Debug forced reflow](https://atfzl.com/don-t-attach-tooltips-to-document-body)
* [How to Create and Fix Memory Leaks With Chrome DevTools](https://betterprogramming.pub/build-me-an-angular-app-with-memory-leaks-please-36302184e658)
* [JavaScript performance beyond bundle size](https://nolanlawson.com/2021/02/23/javascript-performance-beyond-bundle-size/)
* [The Import On Interaction Pattern](https://addyosmani.com/blog/import-on-interaction/)
* [The “Live DOM” Is Not “Slow”, “Bad”, Or “Wrong”. Web Developers Are.](https://levelup.gitconnected.com/the-live-dom-is-not-slow-bad-or-wrong-web-developers-are-2bf86c3b9e2e)
* [Prevent layout shifts with CSS grid stacks](https://www.hsablonniere.com/prevent-layout-shifts-with-css-grid-stacks--qcj5jo/)
* [content-visibility: the new CSS property that boosts your rendering performance](https://web.dev/content-visibility/)
* [Preact vs React - Updating React at Etsy](https://github.com/mq2thez/blog/blob/main/upgrade-react-etsy/preact-vs-react.md)
* [The Cost of Javascript Frameworks](https://timkadlec.com/remembers/2020-04-21-the-cost-of-javascript-frameworks/)
* [Fixing memory leaks in web applications](https://nolanlawson.com/2020/02/19/fixing-memory-leaks-in-web-applications/)
* [How to load polyfills only when needed](https://3perf.com/blog/polyfills/)
* [Responsible JavaScript: Part III - Third parties](https://alistapart.com/article/responsible-javascript-part-3/)
* [The cost of JavaScript in 2019](https://v8.dev/blog/cost-of-javascript-2019)
* [When should you be using Web Workers?](https://dassur.ma/things/when-workers/)
* [Responsible Javascript: Part II - Code Bundle](https://alistapart.com/article/responsible-javascript-part-2/)
* [Faster script loading with BinaryAST?](https://blog.cloudflare.com/binary-ast/)
* [Svelte 3: Rethinking reactivity](https://svelte.dev/blog/svelte-3-rethinking-reactivity)
* [Responsible Javascript: Part I - Web platform over frameworks](https://alistapart.com/article/responsible-javascript-part-1/)
* [JavaScript Loading Priorities in Chrome](https://addyosmani.com/blog/script-priorities/)
* [Idle Until Urgent](https://philipwalton.com/articles/idle-until-urgent/)
* [Browser painting and considerations for web performance](https://css-tricks.com/browser-painting-and-considerations-for-web-performance/)
* [The Cost Of JavaScript In 2018](https://medium.com/@addyosmani/the-cost-of-javascript-in-2018-7d8950fbb5d4) ([Video](https://www.youtube.com/watch?v=i5R7giitymk))
* [Examining Web Worker Performance](https://www.loxodrome.io/post/web-worker-performance/)
* [Front-End Performance Checklist](https://github.com/thedaviddias/Front-End-Performance-Checklist)
* [jankfree](http://jankfree.org/)
* [What forces layout/reflow?](https://gist.github.com/paulirish/5d52fb081b3570c81e3a)
* [Using requestIdleCallback](https://developers.google.com/web/updates/2015/08/using-requestidlecallback)
* [Optimize Javascript Execution](https://developers.google.com/web/fundamentals/performance/rendering/optimize-javascript-execution)
* [Why Web Developers Need to Care about Interactivity](https://philipwalton.com/articles/why-web-developers-need-to-care-about-interactivity/)
* [Improving Performance with the Paint Timing API](https://www.sitepen.com/blog/2017/10/06/improving-performance-with-the-paint-timing-api)
* [Deploying ES2015+ Code in Production Today](https://philipwalton.com/articles/deploying-es2015-code-in-production-today/)
* [Performant Web Animations and Interactions: Achieving 60 FPS](https://blog.algolia.com/performant-web-animations/)
* [JavaScript Start-up Performance](https://medium.com/reloading/javascript-start-up-performance-69200f43b201)
* [Performant Parallaxing](https://developers.google.com/web/updates/2016/12/performant-parallaxing)
* [The Anatomy of a Frame](https://aerotwist.com/blog/the-anatomy-of-a-frame/)
* [The future of loading CSS](https://jakearchibald.com/2016/link-in-body/)
* [4 Types of Memory Leaks in JavaScript and How to Get Rid Of Them](https://auth0.com/blog/four-types-of-leaks-in-your-javascript-code-and-how-to-get-rid-of-them/)
* [The cost of frameworks](https://aerotwist.com/blog/the-cost-of-frameworks/)
* [FLIP Your Animations](https://aerotwist.com/blog/flip-your-animations/)

View File

@@ -1,6 +0,0 @@
# Use CDN
Use a CDN to serve your static assets. This will reduce the load on your server and improve the performance of your site.
- [10 Tips to Optimize CDN Performance - CDN Planet](https://www.cdnplanet.com/blog/10-tips-optimize-cdn-performance/)
- [HTTP Caching | Web Fundamentals | Google Developers](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching)

View File

@@ -1,8 +0,0 @@
# Use Service Workers
You are using Service Workers in your PWA to cache data or execute possible heavy tasks without impacting the user experience of your application.
- [Service Workers: an Introduction | Web Fundamentals | Google Developers](https://developers.google.com/web/fundamentals/primers/service-workers/)
- [Measuring the Real-world Performance Impact of Service Workers | Web | Google Developers](https://developers.google.com/web/showcase/2016/service-worker-perf)
- [What Are Service Workers and How They Help Improve Performance](https://www.keycdn.com/blog/service-workers/)
- [How does a service worker work? - YouTube](https://www.youtube.com/watch?v=__xAtWgfzvc)

View File

@@ -1,29 +0,0 @@
---
jsonUrl: "/jsons/best-practices/frontend-performance.json"
pdfUrl: "/pdfs/best-practices/frontend-performance.pdf"
order: 1
featuredTitle: "Frontend Performance"
featuredDescription: "Frontend Performance Best Practices"
isNew: true
isUpcoming: false
title: "Frontend Performance"
description: "Detailed list of best practices to improve your frontend performance"
dimensions:
width: 968
height: 1270.89
schema:
headline: "Frontend Performance Best Practices"
description: "Detailed list of best practices to improve the frontend performance of your website. Each best practice carries further details and how to implement that best practice."
imageUrl: "https://roadmap.sh/best-practices/frontend-performance.png"
datePublished: "2023-01-23"
dateModified: "2023-01-23"
seo:
title: "Frontend Performance Best Practices"
description: "Detailed list of best practices to improve the frontend performance of your website. Each best practice carries further details and how to implement that best practice."
keywords:
- "frontend performance"
- "frontend performance best practices"
- "frontend performance checklist"
- "frontend checklist"
- "make performant frontends"
---

View File

@@ -1,41 +1,17 @@
---
---
<script src='./analytics.js'></script>
<script src='./analytics.ts'></script>
<script async src='https://www.googletagmanager.com/gtag/js?id=UA-139582634-1'
></script>
<script is:inline>
// @ts-nocheck
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-139582634-1');
document.addEventListener('click', (e) => {
let trackEl = e.target;
if (!trackEl.getAttribute('ga-category')) {
trackEl = trackEl.closest('[ga-category]');
}
if (!trackEl) {
return;
}
const category = trackEl.getAttribute('ga-category');
const action = trackEl.getAttribute('ga-action');
const label = trackEl.getAttribute('ga-label');
if (!category) {
return;
}
window.fireEvent({
category,
action,
label,
});
});
</script>

View File

@@ -1,32 +1,32 @@
export {};
declare global {
interface Window {
gtag: any;
fireEvent: (props: GAEventType) => void;
fireEvent: (props: {
action: string;
category: string;
label?: string;
value?: string;
}) => void;
}
}
export type GAEventType = {
action: string;
category: string;
label?: string;
value?: string;
};
/**
* Tracks the event on google analytics
* @see https://developers.google.com/analytics/devguides/collection/gtagjs/events
* @param props Event properties
* @returns void
*/
window.fireEvent = (props: GAEventType) => {
window.fireEvent = (props) => {
const { action, category, label, value } = props;
if (!window.gtag) {
console.warn('Missing GTAG - Analytics disabled');
return;
}
if (import.meta.env.DEV) {
console.log('Analytics event fired', props);
}
window.gtag('event', action, {
event_category: category,
event_label: label,

View File

@@ -0,0 +1,38 @@
---
import { parse } from 'node-html-parser';
import type { Attributes } from 'node-html-parser/dist/nodes/html';
export interface Props {
icon: string;
class?: string;
}
async function getSVG(name: string) {
const filepath = `/src/icons/${name}.svg`;
const files = import.meta.glob<string>('/src/icons/**/*.svg', {
eager: true,
as: 'raw',
});
if (!(filepath in files)) {
throw new Error(`${filepath} not found`);
}
const root = parse(files[filepath]);
const svg = root.querySelector('svg');
return {
attributes: svg?.attributes,
innerHTML: svg?.innerHTML,
};
}
const { icon, ...attributes } = Astro.props as Props;
const { attributes: baseAttributes, innerHTML } = await getSVG(icon);
const svgAttributes = { ...baseAttributes, ...attributes };
---
<svg {...svgAttributes} set:html={innerHTML}></svg>

View File

@@ -0,0 +1,5 @@
<div class='flex w-full items-center gap-2 py-6 text-sm text-slate-600'>
<div class='h-px w-full bg-slate-200'></div>
OR
<div class='h-px w-full bg-slate-200'></div>
</div>

View File

@@ -0,0 +1,100 @@
import Cookies from 'js-cookie';
import type { FunctionComponent } from 'preact';
import { useState } from 'preact/hooks';
import { httpPost } from '../../lib/http';
import { TOKEN_COOKIE_NAME } from '../../lib/jwt';
const EmailLoginForm: FunctionComponent<{}> = () => {
const [email, setEmail] = useState<string>('');
const [password, setPassword] = useState<string>('');
const [error, setError] = useState('');
const [isLoading, setIsLoading] = useState<boolean>(false);
const handleFormSubmit = async (e: Event) => {
e.preventDefault();
setIsLoading(true);
setError('');
const { response, error } = await httpPost<{ token: string }>(
`${import.meta.env.PUBLIC_API_URL}/v1-login`,
{
email,
password,
}
);
// Log the user in and reload the page
if (response?.token) {
Cookies.set(TOKEN_COOKIE_NAME, response.token);
window.location.reload();
return;
}
// @todo use proper types
if ((error as any).type === 'user_not_verified') {
window.location.href = `/verification-pending?email=${encodeURIComponent(
email
)}`;
return;
}
setIsLoading(false);
setError(error?.message || 'Something went wrong. Please try again later.');
};
return (
<form className="w-full" onSubmit={handleFormSubmit}>
<label htmlFor="email" className="sr-only">
Email address
</label>
<input
name="email"
type="email"
autoComplete="email"
required
className="block w-full rounded-lg border border-gray-300 px-3 py-2 shadow-sm outline-none placeholder:text-gray-400 focus:ring-2 focus:ring-black focus:ring-offset-1"
placeholder="Email Address"
value={email}
onInput={(e) => setEmail(String((e.target as any).value))}
/>
<label htmlFor="password" className="sr-only">
Password
</label>
<input
name="password"
type="password"
autoComplete="current-password"
required
className="mt-2 block w-full rounded-lg border border-gray-300 px-3 py-2 shadow-sm outline-none placeholder:text-gray-400 focus:ring-2 focus:ring-black focus:ring-offset-1"
placeholder="Password"
value={password}
onInput={(e) => setPassword(String((e.target as any).value))}
/>
<p class="mb-3 mt-2 text-sm text-gray-500">
<a
href="/forgot-password"
className="text-blue-800 hover:text-blue-600"
>
Reset your password?
</a>
</p>
{error && (
<p className="mb-2 rounded-md bg-red-100 p-2 text-red-800">{error}</p>
)}
<button
type="submit"
disabled={isLoading}
className="inline-flex w-full items-center justify-center rounded-lg bg-black p-2 py-3 text-sm font-medium text-white outline-none focus:ring-2 focus:ring-black focus:ring-offset-1 disabled:bg-gray-400"
>
{isLoading ? 'Please wait...' : 'Continue'}
</button>
</form>
);
};
export default EmailLoginForm;

View File

@@ -0,0 +1,103 @@
import type { FunctionComponent } from 'preact';
import { useState } from 'preact/hooks';
import { httpPost } from '../../lib/http';
const EmailSignupForm: FunctionComponent = () => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [name, setName] = useState('');
const [error, setError] = useState('');
const [isLoading, setIsLoading] = useState(false);
const onSubmit = async (e: Event) => {
e.preventDefault();
setIsLoading(true);
setError('');
const { response, error } = await httpPost<{ status: 'ok' }>(
`${import.meta.env.PUBLIC_API_URL}/v1-register`,
{
email,
password,
name,
}
);
if (error || response?.status !== 'ok') {
setIsLoading(false);
setError(
error?.message || 'Something went wrong. Please try again later.'
);
return;
}
window.location.href = `/verification-pending?email=${encodeURIComponent(
email
)}`;
};
return (
<form className="flex w-full flex-col gap-2" onSubmit={onSubmit}>
<label htmlFor="name" className="sr-only">
Name
</label>
<input
name="name"
type="text"
autoComplete="name"
min={3}
max={50}
required
className="block w-full rounded-lg border border-gray-300 px-3 py-2 outline-none placeholder:text-gray-400 focus:ring-2 focus:ring-black focus:ring-offset-1"
placeholder="Full Name"
value={name}
onInput={(e) => setName(String((e.target as any).value))}
/>
<label htmlFor="email" className="sr-only">
Email address
</label>
<input
name="email"
type="email"
autoComplete="email"
required
className="block w-full rounded-lg border border-gray-300 px-3 py-2 outline-none placeholder:text-gray-400 focus:ring-2 focus:ring-black focus:ring-offset-1"
placeholder="Email Address"
value={email}
onInput={(e) => setEmail(String((e.target as any).value))}
/>
<label htmlFor="password" className="sr-only">
Password
</label>
<input
name="password"
type="password"
autoComplete="current-password"
min={6}
max={50}
required
className="block w-full rounded-lg border border-gray-300 px-3 py-2 outline-none placeholder:text-gray-400 focus:ring-2 focus:ring-black focus:ring-offset-1"
placeholder="Password"
value={password}
onInput={(e) => setPassword(String((e.target as any).value))}
/>
{error && (
<p className="rounded-lg bg-red-100 p-2 text-red-700">{error}.</p>
)}
<button
type="submit"
disabled={isLoading}
className="inline-flex w-full items-center justify-center rounded-lg bg-black p-2 py-3 text-sm font-medium text-white outline-none focus:ring-2 focus:ring-black focus:ring-offset-1 disabled:bg-gray-400"
>
{isLoading ? 'Please wait...' : 'Continue to Verify Email'}
</button>
</form>
);
};
export default EmailSignupForm;

View File

@@ -0,0 +1,64 @@
import { useState } from 'preact/hooks';
import { httpPost } from '../../lib/http';
export function ForgotPasswordForm() {
const [email, setEmail] = useState('');
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState('');
const [success, setSuccess] = useState('');
const handleSubmit = async (e: Event) => {
e.preventDefault();
setIsLoading(true);
setError('');
const { response, error } = await httpPost(
`${import.meta.env.PUBLIC_API_URL}/v1-forgot-password`,
{
email,
}
);
setIsLoading(false);
if (error) {
setError(error.message);
} else {
setEmail('');
setSuccess('Check your email for a link to reset your password.');
}
};
return (
<form onSubmit={handleSubmit} class="w-full">
<input
type="email"
name="email"
className="mt-2 block w-full appearance-none rounded-lg border border-gray-300 px-3 py-2 shadow-sm outline-none transition duration-150 ease-in-out placeholder:text-gray-400 focus:ring-2 focus:ring-black focus:ring-offset-1"
required
placeholder="Email Address"
value={email}
onInput={(e) => setEmail((e.target as HTMLInputElement).value)}
/>
{error && (
<p className="mt-2 rounded-lg bg-red-100 p-2 text-sm text-red-700">
{error}
</p>
)}
{success && (
<p className="mt-2 rounded-lg bg-green-100 p-2 text-sm text-green-700">
{success}
</p>
)}
<button
type="submit"
disabled={isLoading}
className="mt-3 inline-flex w-full items-center justify-center rounded-lg bg-black p-2 py-3 text-sm font-medium text-white outline-none focus:ring-2 focus:ring-black focus:ring-offset-1 disabled:bg-gray-400"
>
{isLoading ? 'Please wait...' : 'Continue'}
</button>
</form>
);
}

View File

@@ -0,0 +1,116 @@
import { useEffect, useState } from 'preact/hooks';
import GitHubIcon from '../../icons/github.svg';
import SpinnerIcon from '../../icons/spinner.svg';
import Cookies from 'js-cookie';
import { TOKEN_COOKIE_NAME } from '../../lib/jwt';
import { httpGet } from '../../lib/http';
type GitHubButtonProps = {};
const GITHUB_REDIRECT_AT = 'githubRedirectAt';
const GITHUB_LAST_PAGE = 'githubLastPage';
export function GitHubButton(props: GitHubButtonProps) {
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState('');
const icon = isLoading ? SpinnerIcon : GitHubIcon;
useEffect(() => {
const urlParams = new URLSearchParams(window.location.search);
const code = urlParams.get('code');
const state = urlParams.get('state');
const provider = urlParams.get('provider');
if (!code || !state || provider !== 'github') {
return;
}
setIsLoading(true);
httpGet<{ token: string }>(
`${import.meta.env.PUBLIC_API_URL}/v1-github-callback${
window.location.search
}`
)
.then(({ response, error }) => {
if (!response?.token) {
const errMessage = error?.message || 'Something went wrong.';
setError(errMessage);
setIsLoading(false);
return;
}
let redirectUrl = '/';
const gitHubRedirectAt = localStorage.getItem(GITHUB_REDIRECT_AT);
const lastPageBeforeGithub = localStorage.getItem(GITHUB_LAST_PAGE);
// If the social redirect is there and less than 30 seconds old
// redirect to the page that user was on before they clicked the github login button
if (gitHubRedirectAt && lastPageBeforeGithub) {
const socialRedirectAtTime = parseInt(gitHubRedirectAt, 10);
const now = Date.now();
const timeSinceRedirect = now - socialRedirectAtTime;
if (timeSinceRedirect < 30 * 1000) {
redirectUrl = lastPageBeforeGithub;
}
}
localStorage.removeItem(GITHUB_REDIRECT_AT);
localStorage.removeItem(GITHUB_LAST_PAGE);
Cookies.set(TOKEN_COOKIE_NAME, response.token);
window.location.href = redirectUrl;
})
.catch((err) => {
setError('Something went wrong. Please try again later.');
setIsLoading(false);
});
}, []);
const handleClick = async () => {
setIsLoading(true);
const { response, error } = await httpGet<{ loginUrl: string }>(
`${import.meta.env.PUBLIC_API_URL}/v1-github-login`
);
if (error || !response?.loginUrl) {
setError(
error?.message || 'Something went wrong. Please try again later.'
);
setIsLoading(false);
return;
}
// For non authentication pages, we want to redirect back to the page
// the user was on before they clicked the social login button
if (!['/login', '/signup'].includes(window.location.pathname)) {
localStorage.setItem(GITHUB_REDIRECT_AT, Date.now().toString());
localStorage.setItem(GITHUB_LAST_PAGE, window.location.pathname);
}
window.location.href = response.loginUrl;
};
return (
<>
<button
class="inline-flex h-10 w-full items-center justify-center gap-2 rounded border border-slate-300 bg-white p-2 text-sm font-medium text-black outline-none focus:ring-2 focus:ring-[#333] focus:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-60"
disabled={isLoading}
onClick={handleClick}
>
<img
src={icon}
alt="GitHub"
class={`h-[18px] w-[18px] ${isLoading ? 'animate-spin' : ''}`}
/>
Continue with GitHub
</button>
{error && (
<p className="mb-2 mt-1 text-sm font-medium text-red-600">{error}</p>
)}
</>
);
}

View File

@@ -0,0 +1,116 @@
import { useEffect, useState } from 'preact/hooks';
import Cookies from 'js-cookie';
import GoogleIcon from '../../icons/google.svg';
import SpinnerIcon from '../../icons/spinner.svg';
import { TOKEN_COOKIE_NAME } from '../../lib/jwt';
import { httpGet } from '../../lib/http';
type GoogleButtonProps = {};
const GOOGLE_REDIRECT_AT = 'googleRedirectAt';
const GOOGLE_LAST_PAGE = 'googleLastPage';
export function GoogleButton(props: GoogleButtonProps) {
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState('');
const icon = isLoading ? SpinnerIcon : GoogleIcon;
useEffect(() => {
const urlParams = new URLSearchParams(window.location.search);
const code = urlParams.get('code');
const state = urlParams.get('state');
const provider = urlParams.get('provider');
if (!code || !state || provider !== 'google') {
return;
}
setIsLoading(true);
httpGet<{ token: string }>(
`${import.meta.env.PUBLIC_API_URL}/v1-google-callback${
window.location.search
}`
)
.then(({ response, error }) => {
if (!response?.token) {
setError(error?.message || 'Something went wrong.');
setIsLoading(false);
return;
}
let redirectUrl = '/';
const googleRedirectAt = localStorage.getItem(GOOGLE_REDIRECT_AT);
const lastPageBeforeGoogle = localStorage.getItem(GOOGLE_LAST_PAGE);
// If the social redirect is there and less than 30 seconds old
// redirect to the page that user was on before they clicked the github login button
if (googleRedirectAt && lastPageBeforeGoogle) {
const socialRedirectAtTime = parseInt(googleRedirectAt, 10);
const now = Date.now();
const timeSinceRedirect = now - socialRedirectAtTime;
if (timeSinceRedirect < 30 * 1000) {
redirectUrl = lastPageBeforeGoogle;
}
}
localStorage.removeItem(GOOGLE_REDIRECT_AT);
localStorage.removeItem(GOOGLE_LAST_PAGE);
Cookies.set(TOKEN_COOKIE_NAME, response.token);
window.location.href = redirectUrl;
})
.catch((err) => {
setError('Something went wrong. Please try again later.');
setIsLoading(false);
});
}, []);
const handleClick = () => {
setIsLoading(true);
httpGet<{ loginUrl: string }>(
`${import.meta.env.PUBLIC_API_URL}/v1-google-login`
)
.then(({ response, error }) => {
if (!response?.loginUrl) {
setError(error?.message || 'Something went wrong.');
setIsLoading(false);
return;
}
// For non authentication pages, we want to redirect back to the page
// the user was on before they clicked the social login button
if (!['/login', '/signup'].includes(window.location.pathname)) {
localStorage.setItem(GOOGLE_REDIRECT_AT, Date.now().toString());
localStorage.setItem(GOOGLE_LAST_PAGE, window.location.pathname);
}
window.location.href = response.loginUrl;
})
.catch((err) => {
setError('Something went wrong. Please try again later.');
setIsLoading(false);
});
};
return (
<>
<button
class="inline-flex h-10 w-full items-center justify-center gap-2 rounded border border-slate-300 bg-white p-2 text-sm font-medium text-black outline-none focus:ring-2 focus:ring-[#333] focus:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-60"
disabled={isLoading}
onClick={handleClick}
>
<img
src={icon}
alt="Google"
class={`h-[18px] w-[18px] ${isLoading ? 'animate-spin' : ''}`}
/>
Continue with Google
</button>
{error && (
<p className="mb-2 mt-1 text-sm font-medium text-red-600">{error}</p>
)}
</>
);
}

View File

@@ -0,0 +1,32 @@
---
import Popup from '../Popup/Popup.astro';
import EmailLoginForm from './EmailLoginForm';
import Divider from './Divider.astro';
import { GitHubButton } from './GitHubButton';
import { GoogleButton } from './GoogleButton';
---
<Popup id='login-popup' title='' subtitle=''>
<div class='text-center'>
<h2 class='mb-3 text-2xl font-semibold leading-5 text-slate-900'>
Login to your account
</h2>
<p class='mt-2 text-sm leading-4 text-slate-600'>
You must be logged in to perform this action.
</p>
</div>
<div class='mt-7 flex flex-col gap-2'>
<GitHubButton client:load />
<GoogleButton client:load />
</div>
<Divider />
<EmailLoginForm client:load />
<div class='mt-6 text-center text-sm text-slate-600'>
Don't have an account?{' '}
<a href='/signup' class='font-medium text-[#4285f4]'>Sign up</a>
</div>
</Popup>

View File

@@ -0,0 +1,97 @@
import { useEffect, useState } from 'preact/hooks';
import { httpPost } from '../../lib/http';
import Cookies from 'js-cookie';
import {TOKEN_COOKIE_NAME} from "../../lib/jwt";
export default function ResetPasswordForm() {
const [code, setCode] = useState('');
const [password, setPassword] = useState('');
const [passwordConfirm, setPasswordConfirm] = useState('');
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState('');
useEffect(() => {
const urlParams = new URLSearchParams(window.location.search);
const code = urlParams.get('code');
if (!code) {
window.location.href = '/login';
} else {
setCode(code);
}
}, []);
const handleSubmit = async (e: Event) => {
e.preventDefault();
setIsLoading(true);
if (password !== passwordConfirm) {
setIsLoading(false);
setError('Passwords do not match.');
return;
}
const { response, error } = await httpPost(
`${import.meta.env.PUBLIC_API_URL}/v1-reset-forgotten-password`,
{
newPassword: password,
confirmPassword: passwordConfirm,
code,
}
);
if (error?.message) {
setIsLoading(false);
setError(error.message);
return;
}
if (!response?.token) {
setIsLoading(false);
setError('Something went wrong. Please try again later.');
return;
}
const token = response.token;
Cookies.set(TOKEN_COOKIE_NAME, token);
window.location.href = '/';
};
return (
<form className="mx-auto w-full" onSubmit={handleSubmit}>
<input
type="password"
className="mb-2 mt-2 block w-full appearance-none rounded-lg border border-gray-300 px-3 py-2 shadow-sm outline-none transition duration-150 ease-in-out placeholder:text-gray-400 focus:ring-2 focus:ring-black focus:ring-offset-1"
required
minLength={6}
placeholder="New Password"
value={password}
onInput={(e) => setPassword((e.target as HTMLInputElement).value)}
/>
<input
type="password"
className="mt-2 block w-full appearance-none rounded-lg border border-gray-300 px-3 py-2 shadow-sm outline-none transition duration-150 ease-in-out placeholder:text-gray-400 focus:ring-2 focus:ring-black focus:ring-offset-1"
required
minLength={6}
placeholder="Confirm New Password"
value={passwordConfirm}
onInput={(e) =>
setPasswordConfirm((e.target as HTMLInputElement).value)
}
/>
{error && (
<p className="mt-2 rounded-lg bg-red-100 p-2 text-red-700">{error}</p>
)}
<button
type="submit"
disabled={isLoading}
className="mt-2 inline-flex w-full items-center justify-center rounded-lg bg-black p-2 py-3 text-sm font-medium text-white outline-none focus:ring-2 focus:ring-black focus:ring-offset-1 disabled:bg-gray-400"
>
{isLoading ? 'Please wait...' : 'Reset Password'}
</button>
</form>
);
}

View File

@@ -0,0 +1,79 @@
import SpinnerIcon from '../../icons/spinner.svg';
import ErrorIcon from '../../icons/error.svg';
import { useEffect, useState } from 'preact/hooks';
import Cookies from 'js-cookie';
import { TOKEN_COOKIE_NAME } from '../../lib/jwt';
import { httpPost } from '../../lib/http';
export function TriggerVerifyAccount() {
const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState('');
const triggerVerify = (code: string) => {
setIsLoading(true);
httpPost<{ token: string }>(
`${import.meta.env.PUBLIC_API_URL}/v1-verify-account`,
{
code,
}
)
.then(({ response, error }) => {
if (!response?.token) {
setError(error?.message || 'Something went wrong. Please try again.');
setIsLoading(false);
return;
}
Cookies.set(TOKEN_COOKIE_NAME, response.token);
window.location.href = '/';
})
.catch((err) => {
setIsLoading(false);
setError('Something went wrong. Please try again.');
});
};
useEffect(() => {
const urlParams = new URLSearchParams(window.location.search);
const code = urlParams.get('code')!;
if (!code) {
setIsLoading(false);
setError('Something went wrong. Please try again later.');
return;
}
triggerVerify(code);
}, []);
return (
<div className="mx-auto flex max-w-md flex-col items-center pt-0 sm:pt-12">
<div className="mx-auto max-w-md text-center">
{isLoading && (
<img
alt={'Please wait.'}
src={SpinnerIcon}
class={'mx-auto h-16 w-16 animate-spin'}
/>
)}
{error && (
<img
alt={'Please wait.'}
src={ErrorIcon}
className={'mx-auto h-16 w-16'}
/>
)}
<h2 className="mb-1 mt-4 text-center text-xl font-semibold sm:mb-3 sm:mt-4 sm:text-2xl">
Verifying your account
</h2>
<div className="text-sm sm:text-base">
{isLoading && <p>Please wait while we verify your account..</p>}
{error && <p class="text-red-700">{error}</p>}
</div>
</div>
</div>
);
}

View File

@@ -0,0 +1,85 @@
import VerifyLetterIcon from '../../icons/verify-letter.svg';
import { useEffect, useState } from 'preact/hooks';
import { httpPost } from '../../lib/http';
export function VerificationEmailMessage() {
const [email, setEmail] = useState('..');
const [error, setError] = useState('');
const [isLoading, setIsLoading] = useState(false);
const [isEmailResent, setIsEmailResent] = useState(false);
useEffect(() => {
const urlParams = new URLSearchParams(window.location.search);
setEmail(urlParams.get('email')!);
}, []);
const resendVerificationEmail = () => {
httpPost(`${import.meta.env.PUBLIC_API_URL}/v1-send-verification-email`, {
email,
})
.then(({ response, error }) => {
if (error) {
setIsEmailResent(false);
setError(error?.message || 'Something went wrong.');
setIsLoading(false);
return;
}
setIsEmailResent(true);
})
.catch(() => {
setIsEmailResent(false);
setIsLoading(false);
setError('Something went wrong. Please try again later.');
});
};
return (
<div className="mx-auto max-w-md text-center">
<img
alt="Verify Email"
src={VerifyLetterIcon}
class="mx-auto mb-4 h-20 w-40 sm:h-40"
/>
<h2 class="my-2 text-center text-xl font-semibold sm:my-5 sm:text-2xl">
Verify your email address
</h2>
<div class="text-sm sm:text-base">
<p>
We have sent you an email at{' '}
<span className="font-bold">{email}</span>. Please click the link to
verify your account. This link will expire shortly, so please verify
soon!
</p>
<hr class="my-4" />
{!isEmailResent && (
<>
{isLoading && <p className="text-gray-400">Sending the email ..</p>}
{!isLoading && !error && (
<p>
Please make sure to check your spam folder. If you still don't
have the email click to{' '}
<button
disabled={!email}
className="inline text-blue-700"
onClick={resendVerificationEmail}
>
resend verification email.
</button>
</p>
)}
{error && <p class="text-red-700">{error}</p>}
</>
)}
{isEmailResent && (
<p class="text-green-700">Verification email has been sent!</p>
)}
</div>
</div>
);
}

View File

@@ -0,0 +1,4 @@
---
---
<script src='./authenticator.ts'></script>

View File

@@ -0,0 +1,79 @@
import Cookies from 'js-cookie';
import { TOKEN_COOKIE_NAME } from '../../lib/jwt';
function easeInElement(el: Element) {
el.classList.add('opacity-0', 'transition-opacity', 'duration-300');
el.classList.remove('hidden');
setTimeout(() => {
el.classList.remove('opacity-0');
});
}
function showHideAuthElements(hideOrShow: 'hide' | 'show' = 'hide') {
document.querySelectorAll('[data-auth-required]').forEach((el) => {
if (hideOrShow === 'hide') {
el.classList.add('hidden');
} else {
easeInElement(el);
}
});
}
function showHideGuestElements(hideOrShow: 'hide' | 'show' = 'hide') {
document.querySelectorAll('[data-guest-required]').forEach((el) => {
if (hideOrShow === 'hide') {
el.classList.add('hidden');
} else {
easeInElement(el);
}
});
}
// Prepares the UI for the user who is logged in
function handleGuest() {
const authenticatedRoutes = [
'/settings/update-profile',
'/settings/update-password',
];
showHideAuthElements('hide');
showHideGuestElements('show');
// If the user is on an authenticated route, redirect them to the home page
if (authenticatedRoutes.includes(window.location.pathname)) {
window.location.href = '/';
}
}
// Prepares the UI for the user who is logged out
function handleAuthenticated() {
const guestRoutes = [
'/login',
'/signup',
'/verify-account',
'/verification-pending',
'/reset-password',
'/forgot-password',
];
showHideGuestElements('hide');
showHideAuthElements('show');
// If the user is on a guest route, redirect them to the home page
if (guestRoutes.includes(window.location.pathname)) {
window.location.href = '/';
}
}
export function handleAuthRequired() {
const token = Cookies.get(TOKEN_COOKIE_NAME);
if (token) {
handleAuthenticated();
} else {
handleGuest();
}
}
window.setTimeout(() => {
handleAuthRequired();
}, 0);

Some files were not shown because too many files have changed in this diff Show More