├── .env.sample
├── .eslintrc.js
├── .gitignore
├── .prettierrc
├── README.md
├── jsconfig.json
├── next-env.d.ts
├── next.config.js
├── package-lock.json
├── package.json
├── postcss.config.js
├── public
├── assets
│ ├── email
│ │ ├── absurd
│ │ │ ├── 01.png
│ │ │ ├── 02.png
│ │ │ ├── 03.png
│ │ │ ├── 04.png
│ │ │ ├── 05.png
│ │ │ ├── 06.png
│ │ │ ├── 07.png
│ │ │ ├── 08.png
│ │ │ ├── 09.png
│ │ │ ├── 10.png
│ │ │ └── 11.png
│ │ └── email-logo-black.png
│ ├── icons
│ │ ├── thefullstack-circle.webp
│ │ ├── thefullstack-dark-circle.webp
│ │ ├── thefullstack-dark-square.webp
│ │ ├── thefullstack-dark.webp
│ │ ├── thefullstack-light-circle.webp
│ │ ├── thefullstack-light-square.webp
│ │ └── thefullstack-light.webp
│ ├── landing
│ │ ├── about
│ │ │ ├── ei.webp
│ │ │ ├── henrique.webp
│ │ │ ├── jamie.webp
│ │ │ ├── ndrc.webp
│ │ │ ├── nodes.webp
│ │ │ ├── noel.webp
│ │ │ └── phil.webp
│ │ ├── engineers
│ │ │ ├── logo-fb.webp
│ │ │ ├── logo-meta.webp
│ │ │ ├── preview-poster.webp
│ │ │ ├── testimonial-adityar.webp
│ │ │ ├── testimonial-ciaran.webp
│ │ │ ├── testimonial-cjcon90.jpeg
│ │ │ ├── testimonial-davide.webp
│ │ │ ├── testimonial-dylan.webp
│ │ │ ├── testimonial-eric.webp
│ │ │ ├── testimonial-foodcloud.png
│ │ │ ├── testimonial-foodcloud.webp
│ │ │ ├── testimonial-griffin.webp
│ │ │ ├── testimonial-gyanendra.webp
│ │ │ ├── testimonial-sands.webp
│ │ │ ├── testimonial-seth.webp
│ │ │ ├── testimonial-sojin.webp
│ │ │ ├── testimonial-takanomedev.webp
│ │ │ └── testimonial-xinor.webp
│ │ ├── fordevelopers
│ │ │ ├── crying-face.png
│ │ │ ├── handshake.png
│ │ │ ├── laughing-face.png
│ │ │ ├── nerd-face.png
│ │ │ ├── raising-hands.png
│ │ │ ├── screen-hangout.webp
│ │ │ ├── screen-profile.webp
│ │ │ ├── screen-project.webp
│ │ │ ├── screen-showcase.webp
│ │ │ ├── screen-teams.webp
│ │ │ ├── screen1.webp
│ │ │ ├── smiling-face.png
│ │ │ ├── thinking-face.png
│ │ │ ├── thumbs-down.png
│ │ │ ├── thumbs-up.png
│ │ │ └── worried-face.png
│ │ ├── forteams
│ │ │ ├── screen-jobs.webp
│ │ │ ├── screen-teammates.webp
│ │ │ ├── screen-teams.webp
│ │ │ └── screen-tools.webp
│ │ ├── hackathon
│ │ │ ├── competition-cover.webp
│ │ │ ├── og.webp
│ │ │ └── voting-cover.gif
│ │ └── main
│ │ │ ├── computer2.webp
│ │ │ └── dev-portfolio-og.webp
│ ├── og-thefullstack-2.png
│ ├── og-thefullstack.png
│ ├── profile
│ │ └── user
│ │ │ ├── avatar-notfound.webp
│ │ │ └── user-not-exist.png
│ ├── thefullstack-dark-new-icon.png
│ ├── thefullstack-dark-new.png
│ ├── thefullstack-icon.webp
│ └── wallet
│ │ └── money.gif
├── favicon.ico
├── icons
│ ├── icon-192x192.png
│ ├── icon-256x256.png
│ ├── icon-384x384.png
│ └── icon-512x512.png
├── logo.svg
├── manifest.json
├── robots.txt
└── sitemap.xml
├── scripts
└── detect-unused.js
├── src
├── components
│ ├── common
│ │ ├── buttons
│ │ │ ├── Award.js
│ │ │ ├── Bookmark.js
│ │ │ ├── Chat.js
│ │ │ ├── Comment.js
│ │ │ ├── Connect.js
│ │ │ ├── Follow.js
│ │ │ ├── Like.js
│ │ │ ├── Mode.js
│ │ │ ├── Report.js
│ │ │ ├── Share.js
│ │ │ └── Vote.js
│ │ ├── cards
│ │ │ ├── FollowingCard.js
│ │ │ ├── PollCard.js
│ │ │ ├── PostCard.js
│ │ │ ├── ProjectCard.js
│ │ │ └── TeamCard.js
│ │ ├── elements
│ │ │ ├── Avatar.js
│ │ │ ├── CodeBlock.js
│ │ │ ├── CountrySelect.js
│ │ │ ├── DividerShowMore.js
│ │ │ ├── Icon.js
│ │ │ ├── Loader.js
│ │ │ ├── MarkdownContent.js
│ │ │ ├── SearchUsersInput.js
│ │ │ ├── SelectEmoji.js
│ │ │ ├── SignOutPrompt.js
│ │ │ ├── SignUpPrompt.js
│ │ │ ├── SocialShareLinks.js
│ │ │ ├── Toast.js
│ │ │ ├── ToolTip.js
│ │ │ └── mux
│ │ │ │ ├── ErrorMessage.js
│ │ │ │ ├── ProfileVideoPlayer.js
│ │ │ │ ├── UploadIntroVideo.js
│ │ │ │ ├── UploadPostVideo.js
│ │ │ │ ├── UploadProjectVideo.js
│ │ │ │ └── VideoPlayer.js
│ │ ├── layout
│ │ │ ├── Drawer.js
│ │ │ ├── Footer.js
│ │ │ ├── Header.js
│ │ │ ├── Layout.js
│ │ │ ├── LayoutLoggedIn.js
│ │ │ ├── MobileNavigation.js
│ │ │ ├── MobileProfileMenu.js
│ │ │ ├── PopoverPanel.js
│ │ │ ├── ProfilePopoverPanel.js
│ │ │ └── constants.js
│ │ ├── modals
│ │ │ ├── ModalAlert.js
│ │ │ └── ModalDialog.js
│ │ ├── partials
│ │ │ └── Metadata.js
│ │ └── tags
│ │ │ ├── TagPostType.js
│ │ │ └── TagStack.js
│ └── modules
│ │ ├── account
│ │ ├── dashboard
│ │ │ ├── Followers.js
│ │ │ ├── Following.js
│ │ │ ├── Main.js
│ │ │ ├── Projects.js
│ │ │ └── Saved.js
│ │ ├── network
│ │ │ ├── Connection.js
│ │ │ └── Main.js
│ │ ├── profile
│ │ │ ├── About.js
│ │ │ ├── EditProfile.js
│ │ │ ├── Interests.js
│ │ │ ├── InviteFriends.js
│ │ │ ├── Socials.js
│ │ │ ├── Tech.js
│ │ │ └── VideoIntro.js
│ │ ├── settings
│ │ │ ├── Archive.js
│ │ │ ├── DangerZone.js
│ │ │ ├── JobPreferences.js
│ │ │ ├── Main.js
│ │ │ ├── NotificationsPanel.js
│ │ │ ├── NotificationsPreferences.js
│ │ │ └── SignOut.js
│ │ ├── teams
│ │ │ ├── CreateJob.js
│ │ │ ├── EditJob.js
│ │ │ ├── InviteMembers.js
│ │ │ ├── Jobs.js
│ │ │ ├── Members.js
│ │ │ ├── Menu.js
│ │ │ ├── TeamProfile.js
│ │ │ ├── TeamTech.js
│ │ │ └── constants.js
│ │ └── wallet
│ │ │ └── Main.js
│ │ ├── auth
│ │ ├── ForgotPassword.js
│ │ ├── Login.js
│ │ ├── LoginModal.js
│ │ ├── ResetEmail.js
│ │ └── ResetPassword.js
│ │ ├── chat
│ │ ├── BottomBar.js
│ │ ├── Main.js
│ │ ├── Message.js
│ │ ├── Notifications.js
│ │ ├── Profile.js
│ │ ├── SideBar.js
│ │ └── TopBar.js
│ │ ├── comments
│ │ ├── CommentReplies.js
│ │ ├── EditComment.js
│ │ ├── LikeComment.js
│ │ ├── ListComments.js
│ │ ├── NewComment.js
│ │ └── ReplyToComment.js
│ │ ├── create
│ │ ├── CreatePostModal.js
│ │ ├── Form.js
│ │ ├── Header.js
│ │ ├── ImportFromGitHub.js
│ │ ├── Main.js
│ │ ├── ProjectCategory.js
│ │ ├── ProjectSettings.js
│ │ ├── ProjectTechStack.js
│ │ └── ValidationErrors.js
│ │ ├── explore
│ │ ├── Categories.js
│ │ ├── Feed.js
│ │ ├── FilterPopoverPanel.js
│ │ ├── Filters.js
│ │ ├── HackathonProjectGallery.js
│ │ ├── Main.js
│ │ ├── ProjectGallery.js
│ │ ├── StackPopoverPanel.js
│ │ └── constants.js
│ │ ├── hangout
│ │ ├── Activity.js
│ │ ├── CreatePost.js
│ │ ├── EditPost.js
│ │ ├── Feed.js
│ │ ├── Main.js
│ │ ├── PinnedPost.js
│ │ ├── TagTechStack.js
│ │ ├── Topics.js
│ │ ├── WhoToFollow.js
│ │ └── constants.js
│ │ ├── home
│ │ ├── Discover.js
│ │ ├── HackathonCarousel.js
│ │ ├── Highlight.js
│ │ ├── Main.js
│ │ └── ProjectCarousel.js
│ │ ├── post
│ │ ├── Actions.js
│ │ ├── Container.js
│ │ ├── Content.js
│ │ ├── Detail.js
│ │ ├── Insights.js
│ │ ├── OpenGraphPreview.js
│ │ └── Poll.js
│ │ ├── profile
│ │ ├── Actions.js
│ │ ├── Main.js
│ │ ├── Menu.js
│ │ ├── NotFound.js
│ │ └── sections
│ │ │ ├── Accounts.js
│ │ │ ├── Articles.js
│ │ │ ├── Goals.js
│ │ │ ├── Intro.js
│ │ │ ├── Overview.js
│ │ │ ├── Projects.js
│ │ │ ├── Snippets.js
│ │ │ ├── Social.js
│ │ │ └── Sparks.js
│ │ ├── project
│ │ ├── Actions.js
│ │ ├── Container.js
│ │ ├── Contributors.js
│ │ ├── GitHubStats.js
│ │ ├── Main.js
│ │ ├── Modal.js
│ │ └── Reactions.js
│ │ ├── signup
│ │ ├── Footer.js
│ │ ├── Header.js
│ │ ├── Main.js
│ │ ├── ProgressBar.js
│ │ ├── StepFive.js
│ │ ├── StepFour.js
│ │ ├── StepOne.js
│ │ ├── StepThree.js
│ │ ├── StepTwo.js
│ │ └── constants.js
│ │ ├── static
│ │ ├── ForDevelopers.js
│ │ ├── ForTeams.js
│ │ ├── OurStory.js
│ │ ├── TeamsFaq.js
│ │ ├── hackathon
│ │ │ ├── Page.js
│ │ │ └── competition1
│ │ │ │ └── Page.js
│ │ ├── policies
│ │ │ ├── CodeOfConduct.js
│ │ │ ├── CookiePolicy.js
│ │ │ └── PrivacyPolicy.js
│ │ └── shared
│ │ │ ├── NewsletterSection.js
│ │ │ ├── TestimonialsSection.js
│ │ │ └── constants.js
│ │ └── teams
│ │ ├── CreateTeam.js
│ │ ├── Faq.js
│ │ ├── FilterTeams.js
│ │ ├── JobDetails.js
│ │ ├── ListJobs.js
│ │ ├── ListTeams.js
│ │ ├── Main.js
│ │ ├── TeamMembers.js
│ │ └── TeamProfile.js
├── context
│ └── user.js
├── firebase
│ ├── firebaseApp.js
│ ├── firebasePresence.js
│ └── initFirebaseApp.js
├── hooks
│ └── useUserProfile.js
├── lib
│ ├── ga
│ │ └── index.js
│ └── gtag.js
├── pages
│ ├── 404.js
│ ├── 500.js
│ ├── [userId]
│ │ ├── [postId].js
│ │ ├── index.js
│ │ └── project
│ │ │ └── [projectId].js
│ ├── _app.js
│ ├── _document.js
│ ├── about
│ │ └── our-story.js
│ ├── account
│ │ ├── dashboard
│ │ │ └── index.js
│ │ ├── network.js
│ │ ├── profile
│ │ │ └── invite.js
│ │ ├── settings.js
│ │ ├── settings
│ │ │ ├── archive.js
│ │ │ ├── danger.js
│ │ │ ├── jobpreferences.js
│ │ │ ├── notifications.js
│ │ │ └── signout.js
│ │ ├── signup
│ │ │ ├── step1.js
│ │ │ ├── step2.js
│ │ │ ├── step3.js
│ │ │ ├── step4.js
│ │ │ ├── step5.js
│ │ │ └── verify-email.js
│ │ ├── teams
│ │ │ ├── jobs
│ │ │ │ ├── [teamId].js
│ │ │ │ ├── edit
│ │ │ │ │ └── [jobId].js
│ │ │ │ └── new.js
│ │ │ ├── members
│ │ │ │ └── [teamId].js
│ │ │ └── profile
│ │ │ │ └── [teamId].js
│ │ └── wallet.js
│ ├── api
│ │ ├── accounts
│ │ │ └── connections
│ │ │ │ ├── approve.js
│ │ │ │ └── reject.js
│ │ ├── auth
│ │ │ ├── linkedin
│ │ │ │ └── login.js
│ │ │ ├── login.js
│ │ │ ├── logout.js
│ │ │ ├── token.js
│ │ │ ├── userProfile.js
│ │ │ └── withAuthUserTokenAPI.js
│ │ ├── checkout_sessions
│ │ │ ├── [id].js
│ │ │ └── index.js
│ │ ├── connections
│ │ │ └── get.js
│ │ ├── explore
│ │ │ └── getActivity.js
│ │ ├── firebase
│ │ │ ├── firebase-messaging-sw.js
│ │ │ └── service-account.enc.js
│ │ ├── jobs
│ │ │ ├── create.js
│ │ │ ├── delete.js
│ │ │ ├── get.js
│ │ │ ├── getAll.js
│ │ │ ├── getByTeam.js
│ │ │ └── update.js
│ │ ├── mail
│ │ │ └── send.js
│ │ ├── notifications
│ │ │ ├── getKnockJwt.js
│ │ │ ├── identifyKnockUser.js
│ │ │ └── slack
│ │ │ │ ├── postEnquiry.js
│ │ │ │ └── postMessage.js
│ │ ├── posts
│ │ │ ├── comments
│ │ │ │ ├── deleteComment.js
│ │ │ │ ├── getComment.js
│ │ │ │ ├── getComments.js
│ │ │ │ ├── getPublicComments.js
│ │ │ │ ├── getPublicReplies.js
│ │ │ │ ├── getReplies.js
│ │ │ │ ├── likeComment.js
│ │ │ │ ├── postComment.js
│ │ │ │ ├── postReply.js
│ │ │ │ ├── unlikeComment.js
│ │ │ │ └── updateComment.js
│ │ │ ├── getPost.js
│ │ │ ├── getPostById.js
│ │ │ ├── getPostByRef.js
│ │ │ ├── getPublicPost.js
│ │ │ ├── getURLPreview.js
│ │ │ └── polls
│ │ │ │ ├── castVote.js
│ │ │ │ └── getPoll.js
│ │ ├── profile
│ │ │ ├── avatar
│ │ │ │ └── upload.js
│ │ │ ├── bio
│ │ │ │ └── update.js
│ │ │ ├── connect.js
│ │ │ ├── displayName
│ │ │ │ └── change.js
│ │ │ ├── getUser.js
│ │ │ ├── getUsers.js
│ │ │ ├── github
│ │ │ │ └── repos.js
│ │ │ ├── interests
│ │ │ │ ├── delete.js
│ │ │ │ ├── get.js
│ │ │ │ ├── getcategories.js
│ │ │ │ └── update.js
│ │ │ ├── me.js
│ │ │ ├── posts
│ │ │ │ └── get.js
│ │ │ ├── search.js
│ │ │ ├── skills.js
│ │ │ ├── skills
│ │ │ │ └── update.js
│ │ │ ├── sng
│ │ │ │ ├── deleteContent.js
│ │ │ │ ├── getByUser.js
│ │ │ │ └── importContent.js
│ │ │ ├── social
│ │ │ │ ├── follow.js
│ │ │ │ ├── followers.js
│ │ │ │ ├── following.js
│ │ │ │ └── unfollow.js
│ │ │ ├── update.js
│ │ │ ├── user.js
│ │ │ ├── verify_connection.js
│ │ │ └── wallet
│ │ │ │ ├── get.js
│ │ │ │ ├── gift.js
│ │ │ │ ├── redeem.js
│ │ │ │ └── transactions.js
│ │ ├── projects
│ │ │ ├── find.js
│ │ │ ├── get.js
│ │ │ ├── ideas.js
│ │ │ ├── project
│ │ │ │ ├── add.js
│ │ │ │ ├── contributors.js
│ │ │ │ ├── delete.js
│ │ │ │ ├── edit.js
│ │ │ │ ├── githubstats.js
│ │ │ │ ├── image
│ │ │ │ │ └── upload.js
│ │ │ │ ├── import.js
│ │ │ │ ├── insights
│ │ │ │ │ └── getVotes.js
│ │ │ │ ├── like.js
│ │ │ │ ├── save.js
│ │ │ │ ├── unlike.js
│ │ │ │ └── unsave.js
│ │ │ ├── saved
│ │ │ │ └── get.js
│ │ │ └── showcase.js
│ │ ├── search
│ │ │ ├── profiles
│ │ │ │ └── search.js
│ │ │ ├── projects.js
│ │ │ ├── showcase.js
│ │ │ └── skills.js
│ │ ├── skills
│ │ │ └── remove.js
│ │ ├── stats
│ │ │ └── profile
│ │ │ │ └── getStats.js
│ │ ├── teams
│ │ │ ├── createTeam.js
│ │ │ ├── deleteTeam.js
│ │ │ ├── getAllTeams.js
│ │ │ ├── getTeam.js
│ │ │ ├── getTeams.js
│ │ │ ├── getTeamsByUser.js
│ │ │ ├── members
│ │ │ │ ├── add.js
│ │ │ │ ├── delete.js
│ │ │ │ └── invite
│ │ │ │ │ ├── accept.js
│ │ │ │ │ ├── external.js
│ │ │ │ │ └── refuse.js
│ │ │ ├── updateTeam.js
│ │ │ ├── upload.js
│ │ │ └── uploadGalleryImage.js
│ │ └── video
│ │ │ ├── asset
│ │ │ └── [id].js
│ │ │ ├── upload.js
│ │ │ └── upload
│ │ │ └── [id].js
│ ├── auth
│ │ ├── linkedin
│ │ │ └── redirect.js
│ │ ├── logout.js
│ │ └── passwordreset.js
│ ├── chat
│ │ ├── [id].js
│ │ └── index.js
│ ├── code-of-conduct.js
│ ├── cookie-policy.js
│ ├── explore
│ │ ├── index.js
│ │ ├── new
│ │ │ └── index.js
│ │ ├── popular
│ │ │ ├── [category].js
│ │ │ └── index.js
│ │ └── trending
│ │ │ └── index.js
│ ├── for
│ │ ├── developers.js
│ │ └── teams.js
│ ├── greatest-developer-portfolio-ever.js
│ ├── hackathon
│ │ ├── competition.js
│ │ ├── competition1
│ │ │ └── index.js
│ │ └── entries
│ │ │ └── index.js
│ ├── hangout
│ │ ├── [topic]
│ │ │ └── index.js
│ │ └── index.js
│ ├── index.js
│ ├── invite
│ │ └── [code].js
│ ├── login
│ │ ├── forgotpassword.js
│ │ └── index.js
│ ├── maintenance.js
│ ├── post
│ │ └── index.js
│ ├── privacy-policy.js
│ ├── privacy.js
│ ├── resources
│ │ └── contact
│ │ │ └── [type].js
│ ├── search
│ │ └── index.js
│ ├── signup
│ │ └── index.js
│ ├── teams
│ │ ├── [teamId]
│ │ │ ├── index.js
│ │ │ └── jobs
│ │ │ │ └── [jobId].js
│ │ └── index.js
│ ├── u
│ │ ├── [userId].js
│ │ └── [userId]
│ │ │ ├── [postId].js
│ │ │ └── project
│ │ │ └── [postId].js
│ ├── upgrade.js
│ └── verifyemail.js
├── styles
│ ├── globals.css
│ └── mde-editor.css
└── utils
│ ├── fetcher.js
│ ├── mail
│ └── sendMail.js
│ ├── signup
│ └── signUpSteps.js
│ ├── slack
│ └── sendMessageSlack.js
│ └── stripe
│ └── getStripe.js
├── tailwind.config.js
└── tsconfig.json
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | browser: true,
4 | es2021: true,
5 | node: true,
6 | },
7 | extends: [
8 | 'eslint:recommended',
9 | 'plugin:react/recommended',
10 | 'plugin:prettier/recommended',
11 | 'next',
12 | ],
13 | parserOptions: {
14 | ecmaFeatures: {
15 | jsx: true,
16 | },
17 | ecmaVersion: 12,
18 | sourceType: 'module',
19 | },
20 | plugins: ['react'],
21 | rules: {
22 | 'react/react-in-jsx-scope': 'off',
23 | // allow jsx syntax in js files (for next.js project)
24 | 'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
25 | 'react/prop-types': 'off',
26 | '@next/next/no-img-element': 'off',
27 | '@next/next/link-passhref': 'off',
28 | 'react-hooks/rules-of-hooks': 'off',
29 | '@next/next/inline-script-id': 'off',
30 | 'no-unused-vars': 'off',
31 | 'prettier/prettier': [
32 | 'warn',
33 | {
34 | singleQuote: true,
35 | semi: true,
36 | },
37 | ],
38 | },
39 | };
40 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # dependencies
2 | /node_modules
3 | /.pnp
4 | .pnp.js
5 |
6 | # testing
7 | /coverage
8 |
9 | # next.js
10 | /.next/
11 | /out/
12 |
13 | # production
14 | /build
15 |
16 | # misc
17 | .DS_Store
18 | *.pem
19 |
20 | # debug
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
25 | # local env files
26 | .env
27 | .env.local
28 | .env.development.local
29 | .env.test.local
30 | .env.production.local
31 | .env.production.sample
32 |
33 | # vercel
34 | .vercel
35 |
36 | # sw
37 | sw.js*
38 | workbox-*
39 |
40 | .vscode
41 |
42 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true,
3 | "semi": true,
4 | "endOfLine": "lf",
5 | "plugins": ["prettier-plugin-tailwindcss"],
6 | "trailingComma": "es5"
7 | }
8 |
--------------------------------------------------------------------------------
/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": "./src/",
4 | "allowJs": true
5 | },
6 | "exclude": ["node_modules"]
7 | }
8 |
--------------------------------------------------------------------------------
/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
4 | // NOTE: This file should not be edited
5 | // see https://nextjs.org/docs/basic-features/typescript for more information.
6 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | };
7 |
--------------------------------------------------------------------------------
/public/assets/email/absurd/01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/email/absurd/01.png
--------------------------------------------------------------------------------
/public/assets/email/absurd/02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/email/absurd/02.png
--------------------------------------------------------------------------------
/public/assets/email/absurd/03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/email/absurd/03.png
--------------------------------------------------------------------------------
/public/assets/email/absurd/04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/email/absurd/04.png
--------------------------------------------------------------------------------
/public/assets/email/absurd/05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/email/absurd/05.png
--------------------------------------------------------------------------------
/public/assets/email/absurd/06.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/email/absurd/06.png
--------------------------------------------------------------------------------
/public/assets/email/absurd/07.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/email/absurd/07.png
--------------------------------------------------------------------------------
/public/assets/email/absurd/08.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/email/absurd/08.png
--------------------------------------------------------------------------------
/public/assets/email/absurd/09.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/email/absurd/09.png
--------------------------------------------------------------------------------
/public/assets/email/absurd/10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/email/absurd/10.png
--------------------------------------------------------------------------------
/public/assets/email/absurd/11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/email/absurd/11.png
--------------------------------------------------------------------------------
/public/assets/email/email-logo-black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/email/email-logo-black.png
--------------------------------------------------------------------------------
/public/assets/icons/thefullstack-circle.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/icons/thefullstack-circle.webp
--------------------------------------------------------------------------------
/public/assets/icons/thefullstack-dark-circle.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/icons/thefullstack-dark-circle.webp
--------------------------------------------------------------------------------
/public/assets/icons/thefullstack-dark-square.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/icons/thefullstack-dark-square.webp
--------------------------------------------------------------------------------
/public/assets/icons/thefullstack-dark.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/icons/thefullstack-dark.webp
--------------------------------------------------------------------------------
/public/assets/icons/thefullstack-light-circle.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/icons/thefullstack-light-circle.webp
--------------------------------------------------------------------------------
/public/assets/icons/thefullstack-light-square.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/icons/thefullstack-light-square.webp
--------------------------------------------------------------------------------
/public/assets/icons/thefullstack-light.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/icons/thefullstack-light.webp
--------------------------------------------------------------------------------
/public/assets/landing/about/ei.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/about/ei.webp
--------------------------------------------------------------------------------
/public/assets/landing/about/henrique.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/about/henrique.webp
--------------------------------------------------------------------------------
/public/assets/landing/about/jamie.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/about/jamie.webp
--------------------------------------------------------------------------------
/public/assets/landing/about/ndrc.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/about/ndrc.webp
--------------------------------------------------------------------------------
/public/assets/landing/about/nodes.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/about/nodes.webp
--------------------------------------------------------------------------------
/public/assets/landing/about/noel.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/about/noel.webp
--------------------------------------------------------------------------------
/public/assets/landing/about/phil.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/about/phil.webp
--------------------------------------------------------------------------------
/public/assets/landing/engineers/logo-fb.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/logo-fb.webp
--------------------------------------------------------------------------------
/public/assets/landing/engineers/logo-meta.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/logo-meta.webp
--------------------------------------------------------------------------------
/public/assets/landing/engineers/preview-poster.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/preview-poster.webp
--------------------------------------------------------------------------------
/public/assets/landing/engineers/testimonial-adityar.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/testimonial-adityar.webp
--------------------------------------------------------------------------------
/public/assets/landing/engineers/testimonial-ciaran.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/testimonial-ciaran.webp
--------------------------------------------------------------------------------
/public/assets/landing/engineers/testimonial-cjcon90.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/testimonial-cjcon90.jpeg
--------------------------------------------------------------------------------
/public/assets/landing/engineers/testimonial-davide.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/testimonial-davide.webp
--------------------------------------------------------------------------------
/public/assets/landing/engineers/testimonial-dylan.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/testimonial-dylan.webp
--------------------------------------------------------------------------------
/public/assets/landing/engineers/testimonial-eric.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/testimonial-eric.webp
--------------------------------------------------------------------------------
/public/assets/landing/engineers/testimonial-foodcloud.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/testimonial-foodcloud.png
--------------------------------------------------------------------------------
/public/assets/landing/engineers/testimonial-foodcloud.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/testimonial-foodcloud.webp
--------------------------------------------------------------------------------
/public/assets/landing/engineers/testimonial-griffin.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/testimonial-griffin.webp
--------------------------------------------------------------------------------
/public/assets/landing/engineers/testimonial-gyanendra.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/testimonial-gyanendra.webp
--------------------------------------------------------------------------------
/public/assets/landing/engineers/testimonial-sands.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/testimonial-sands.webp
--------------------------------------------------------------------------------
/public/assets/landing/engineers/testimonial-seth.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/testimonial-seth.webp
--------------------------------------------------------------------------------
/public/assets/landing/engineers/testimonial-sojin.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/testimonial-sojin.webp
--------------------------------------------------------------------------------
/public/assets/landing/engineers/testimonial-takanomedev.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/testimonial-takanomedev.webp
--------------------------------------------------------------------------------
/public/assets/landing/engineers/testimonial-xinor.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/engineers/testimonial-xinor.webp
--------------------------------------------------------------------------------
/public/assets/landing/fordevelopers/crying-face.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/fordevelopers/crying-face.png
--------------------------------------------------------------------------------
/public/assets/landing/fordevelopers/handshake.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/fordevelopers/handshake.png
--------------------------------------------------------------------------------
/public/assets/landing/fordevelopers/laughing-face.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/fordevelopers/laughing-face.png
--------------------------------------------------------------------------------
/public/assets/landing/fordevelopers/nerd-face.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/fordevelopers/nerd-face.png
--------------------------------------------------------------------------------
/public/assets/landing/fordevelopers/raising-hands.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/fordevelopers/raising-hands.png
--------------------------------------------------------------------------------
/public/assets/landing/fordevelopers/screen-hangout.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/fordevelopers/screen-hangout.webp
--------------------------------------------------------------------------------
/public/assets/landing/fordevelopers/screen-profile.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/fordevelopers/screen-profile.webp
--------------------------------------------------------------------------------
/public/assets/landing/fordevelopers/screen-project.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/fordevelopers/screen-project.webp
--------------------------------------------------------------------------------
/public/assets/landing/fordevelopers/screen-showcase.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/fordevelopers/screen-showcase.webp
--------------------------------------------------------------------------------
/public/assets/landing/fordevelopers/screen-teams.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/fordevelopers/screen-teams.webp
--------------------------------------------------------------------------------
/public/assets/landing/fordevelopers/screen1.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/fordevelopers/screen1.webp
--------------------------------------------------------------------------------
/public/assets/landing/fordevelopers/smiling-face.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/fordevelopers/smiling-face.png
--------------------------------------------------------------------------------
/public/assets/landing/fordevelopers/thinking-face.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/fordevelopers/thinking-face.png
--------------------------------------------------------------------------------
/public/assets/landing/fordevelopers/thumbs-down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/fordevelopers/thumbs-down.png
--------------------------------------------------------------------------------
/public/assets/landing/fordevelopers/thumbs-up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/fordevelopers/thumbs-up.png
--------------------------------------------------------------------------------
/public/assets/landing/fordevelopers/worried-face.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/fordevelopers/worried-face.png
--------------------------------------------------------------------------------
/public/assets/landing/forteams/screen-jobs.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/forteams/screen-jobs.webp
--------------------------------------------------------------------------------
/public/assets/landing/forteams/screen-teammates.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/forteams/screen-teammates.webp
--------------------------------------------------------------------------------
/public/assets/landing/forteams/screen-teams.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/forteams/screen-teams.webp
--------------------------------------------------------------------------------
/public/assets/landing/forteams/screen-tools.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/forteams/screen-tools.webp
--------------------------------------------------------------------------------
/public/assets/landing/hackathon/competition-cover.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/hackathon/competition-cover.webp
--------------------------------------------------------------------------------
/public/assets/landing/hackathon/og.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/hackathon/og.webp
--------------------------------------------------------------------------------
/public/assets/landing/hackathon/voting-cover.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/hackathon/voting-cover.gif
--------------------------------------------------------------------------------
/public/assets/landing/main/computer2.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/main/computer2.webp
--------------------------------------------------------------------------------
/public/assets/landing/main/dev-portfolio-og.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/landing/main/dev-portfolio-og.webp
--------------------------------------------------------------------------------
/public/assets/og-thefullstack-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/og-thefullstack-2.png
--------------------------------------------------------------------------------
/public/assets/og-thefullstack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/og-thefullstack.png
--------------------------------------------------------------------------------
/public/assets/profile/user/avatar-notfound.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/profile/user/avatar-notfound.webp
--------------------------------------------------------------------------------
/public/assets/profile/user/user-not-exist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/profile/user/user-not-exist.png
--------------------------------------------------------------------------------
/public/assets/thefullstack-dark-new-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/thefullstack-dark-new-icon.png
--------------------------------------------------------------------------------
/public/assets/thefullstack-dark-new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/thefullstack-dark-new.png
--------------------------------------------------------------------------------
/public/assets/thefullstack-icon.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/thefullstack-icon.webp
--------------------------------------------------------------------------------
/public/assets/wallet/money.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/assets/wallet/money.gif
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/favicon.ico
--------------------------------------------------------------------------------
/public/icons/icon-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/icons/icon-192x192.png
--------------------------------------------------------------------------------
/public/icons/icon-256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/icons/icon-256x256.png
--------------------------------------------------------------------------------
/public/icons/icon-384x384.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/icons/icon-384x384.png
--------------------------------------------------------------------------------
/public/icons/icon-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thefullstackgroup/webapp/e0de5d40ab639eaee277a3817ffa765f580992a8/public/icons/icon-512x512.png
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "theme_color": "#18191c",
3 | "background_color": "#fff",
4 | "display": "standalone",
5 | "scope": "/",
6 | "start_url": "/",
7 | "name": "thefullstack",
8 | "short_name": "thefullstack",
9 | "description": "Where Reddit meets GitHub, a space where developers connect with like-minded developers to show off projects, learn and hang out.",
10 | "icons": [
11 | {
12 | "src": "/icons/icon-192x192.png",
13 | "sizes": "192x192",
14 | "type": "image/png",
15 | "purpose": "any maskable"
16 | },
17 | {
18 | "src": "/icons/icon-256x256.png",
19 | "sizes": "256x256",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "/icons/icon-384x384.png",
24 | "sizes": "384x384",
25 | "type": "image/png"
26 | },
27 | {
28 | "src": "/icons/icon-512x512.png",
29 | "sizes": "512x512",
30 | "type": "image/png"
31 | }
32 | ]
33 | }
34 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Allow: /
3 | Disallow: /api
4 |
5 | User-agent: SiteCheckerBotCrawler
6 | Disallow: /
7 |
8 | User-agent: sitechecker.pro
9 | Disallow:/
10 |
11 | Sitemap: http://thefullstack.network/sitemap.xml
--------------------------------------------------------------------------------
/scripts/detect-unused.js:
--------------------------------------------------------------------------------
1 | // scripts/detect-unused.js
2 | const madge = require('madge');
3 | const path = require('path');
4 |
5 | function pruneTree(subtree, tree) {
6 | if (!subtree || subtree.length === 0) return;
7 | for (let child of subtree) {
8 | const nextSubtree = tree[child];
9 | if (tree[child]) {
10 | delete tree[child];
11 | }
12 | pruneTree(nextSubtree, tree);
13 | }
14 | }
15 |
16 | madge(path.join(__dirname, '..'), {
17 | baseDir: path.join(__dirname, '..'),
18 | excludeRegExp: [
19 | /^\.next[\\/]/, // Ignore built artifacts
20 | /^next\.config\.js/, // Ignore Next.js configuration
21 | /^scripts[\\/]/, // Ignore scripts (where this file lives)
22 | ],
23 | }).then((res) => {
24 | const tree = res.obj();
25 |
26 | const entrypoints = Object.keys(tree).filter(
27 | (e) => e.startsWith('pages/') || e.startsWith('pages\\')
28 | );
29 | pruneTree(entrypoints, tree);
30 |
31 | const unusedFiles = Object.keys(tree);
32 | if (unusedFiles.length) {
33 | console.log(
34 | `⚠️ Found ${unusedFiles.length} files that no one is depending on, please consider removing:`
35 | );
36 | unusedFiles.forEach((file) => {
37 | console.log('\x1b[33m%s\x1b[0m', file);
38 | });
39 | process.exit(1);
40 | } else {
41 | console.log('🎉 No used files!');
42 | process.exit(0);
43 | }
44 | });
45 |
--------------------------------------------------------------------------------
/src/components/common/buttons/Comment.js:
--------------------------------------------------------------------------------
1 | import { useState } from 'react';
2 | import ToolTip from 'components/common/elements/ToolTip';
3 | import NewComment from 'components/modules/comments/NewComment';
4 | import Icon from '../elements/Icon';
5 |
6 | const ButtonComment = ({
7 | user,
8 | post,
9 | action = false,
10 | showLabel = false,
11 | toolTipPosition = 'top',
12 | }) => {
13 | const [show, setShow] = useState(false);
14 |
15 | const handleComment = () => {
16 | if (action) {
17 | action(true);
18 | } else {
19 | setShow(!show);
20 | }
21 | };
22 |
23 | return (
24 | <>
25 | handleComment()}
28 | >
29 |
30 |
34 |
35 | {post.numberOfComments}
36 |
37 | {showLabel && Comment }
38 |
39 |
40 | {user && (
41 |
42 | )}
43 | >
44 | );
45 | };
46 |
47 | export default ButtonComment;
48 |
--------------------------------------------------------------------------------
/src/components/common/buttons/Mode.js:
--------------------------------------------------------------------------------
1 | import { useTheme } from 'next-themes';
2 | import Icon from '../elements/Icon';
3 | import { useEffect, useState } from 'react';
4 | import { FiMoon, FiSun } from 'react-icons/fi';
5 |
6 | const Mode = () => {
7 | const { systemTheme, theme, setTheme } = useTheme();
8 | const [mode, setMode] = useState('');
9 |
10 | useEffect(() => {
11 | const currentTheme = theme === 'system' ? systemTheme : theme;
12 | if (theme) setMode(currentTheme);
13 | }, [theme]);
14 |
15 | return (
16 | (mode === 'dark' ? setTheme('light') : setTheme('dark'))}
18 | className="nav-bar nav-bar-icon"
19 | >
20 | {mode === 'dark' ? (
21 |
22 | ) : (
23 |
24 | )}
25 |
26 | );
27 | };
28 |
29 | export default Mode;
30 |
--------------------------------------------------------------------------------
/src/components/common/elements/CodeBlock.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
3 | import { dracula } from 'react-syntax-highlighter/dist/cjs/styles/prism';
4 |
5 | const Block = ({ className, children }) => {
6 | let lang = 'text'; // default monospaced text
7 | if (className && className.startsWith('lang-')) {
8 | lang = className.replace('lang-', '');
9 | }
10 | return (
11 |
12 | {children}
13 |
14 | );
15 | };
16 |
17 | const CodeBlock = ({ children, ...rest }) => {
18 | if ('type' in children && children['type'] === 'code') {
19 | return Block(children['props']);
20 | }
21 | return
{children} ;
22 | };
23 |
24 | export default CodeBlock;
25 |
--------------------------------------------------------------------------------
/src/components/common/elements/CountrySelect.js:
--------------------------------------------------------------------------------
1 | import { CountryDropdown } from 'react-country-region-selector';
2 |
3 | const CountrySelect = ({ countryName, setCountryName }) => {
4 | return (
5 | setCountryName(val)}
8 | className="text-input dark:bg-black"
9 | />
10 | );
11 | };
12 |
13 | export default CountrySelect;
14 |
--------------------------------------------------------------------------------
/src/components/common/elements/DividerShowMore.js:
--------------------------------------------------------------------------------
1 | import Link from 'next/link';
2 | import Icon from './Icon';
3 |
4 | const DividerShowMore = ({ label, href }) => {
5 | return (
6 |
22 | );
23 | };
24 |
25 | export default DividerShowMore;
26 |
--------------------------------------------------------------------------------
/src/components/common/elements/Icon.js:
--------------------------------------------------------------------------------
1 | import { createElement } from 'react';
2 | import * as FiIcons from 'react-icons/fi';
3 | import * as FaIcons from 'react-icons/fa';
4 | import * as SiIcons from 'react-icons/si';
5 | import * as IoIcons from 'react-icons/io5';
6 |
7 | const Icon = ({ name, pack = 'Fi', className }) => {
8 | let style = 'h-5 w-5';
9 | if (className) style = className;
10 |
11 | let icon = '';
12 |
13 | if (pack === 'Fi') {
14 | icon = createElement(FiIcons[name], {
15 | className: style,
16 | });
17 | }
18 |
19 | if (pack === 'Si') {
20 | icon = createElement(SiIcons[name], {
21 | className: style,
22 | });
23 | }
24 |
25 | if (pack === 'Fa') {
26 | icon = createElement(FaIcons[name], {
27 | className: style,
28 | });
29 | }
30 |
31 | if (pack === 'Io') {
32 | icon = createElement(IoIcons[name], {
33 | className: style,
34 | });
35 | }
36 |
37 | return icon;
38 | };
39 |
40 | export default Icon;
41 |
--------------------------------------------------------------------------------
/src/components/common/elements/Loader.js:
--------------------------------------------------------------------------------
1 | import { Ring } from '@uiball/loaders';
2 |
3 | const Loader = () => {
4 | return ;
5 | };
6 |
7 | export default Loader;
8 |
--------------------------------------------------------------------------------
/src/components/common/elements/MarkdownContent.js:
--------------------------------------------------------------------------------
1 | import dynamic from 'next/dynamic';
2 | import '@uiw/react-markdown-preview/markdown.css';
3 | const MarkdownPreview = dynamic(
4 | () => import('@uiw/react-markdown-preview').then((mod) => mod.default),
5 | { ssr: false }
6 | );
7 | import rehypeHighlight from 'rehype-highlight';
8 | import { useTheme } from 'next-themes';
9 |
10 | const MarkdownContent = ({ content }) => {
11 | const { systemTheme, theme } = useTheme();
12 | const currentTheme = theme === 'system' ? systemTheme : theme;
13 |
14 | return (
15 |
22 | );
23 | };
24 |
25 | export default MarkdownContent;
26 |
--------------------------------------------------------------------------------
/src/components/common/elements/SelectEmoji.js:
--------------------------------------------------------------------------------
1 | import EmojiPicker from 'emoji-picker-react';
2 | import { useTheme } from 'next-themes';
3 | import ModalAlert from '../modals/ModalAlert';
4 |
5 | const SelectEmoji = ({ show, setShow, text, setText }) => {
6 | const { systemTheme, theme, setTheme } = useTheme();
7 | const currentTheme = theme === 'system' ? systemTheme : theme;
8 |
9 | const onEmojiClick = (e) => {
10 | let sym = e.unified.split('-');
11 | let codesArray = [];
12 | sym.forEach((el) => codesArray.push('0x' + el));
13 | let emoji = String.fromCodePoint(...codesArray);
14 | setText(text + emoji);
15 | setShow(false);
16 | };
17 |
18 | return (
19 |
26 |
27 |
34 |
35 |
36 | );
37 | };
38 |
39 | export default SelectEmoji;
40 |
--------------------------------------------------------------------------------
/src/components/common/elements/SignOutPrompt.js:
--------------------------------------------------------------------------------
1 | import ModalAlert from '../modals/ModalAlert';
2 | import Image from 'next/future/image';
3 | import { useRouter } from 'next/router';
4 | import axios from 'axios';
5 | import { useAuthUser } from 'next-firebase-auth';
6 |
7 | const SignOutPrompt = ({ show, setShow }) => {
8 | const AuthUser = useAuthUser();
9 | const router = useRouter();
10 |
11 | const handleLogout = async () => {
12 | await AuthUser.signOut();
13 | await axios.get(`/api/auth/logout`);
14 | router.reload('/');
15 | };
16 |
17 | return (
18 |
19 |
20 |
21 |
We will miss you
22 |
29 |
Don't forget to come back...
30 |
31 | {
34 | handleLogout();
35 | }}
36 | >
37 | Sign me out
38 |
39 |
40 |
41 |
42 |
43 | );
44 | };
45 |
46 | export default SignOutPrompt;
47 |
--------------------------------------------------------------------------------
/src/components/common/elements/SignUpPrompt.js:
--------------------------------------------------------------------------------
1 | import Link from 'next/link';
2 | import Icon from './Icon';
3 | import ModalAlert from '../modals/ModalAlert';
4 | import { useRouter } from 'next/router';
5 |
6 | const SignUpPrompt = ({ show, setShow }) => {
7 | const router = useRouter();
8 | return (
9 |
10 |
11 |
12 |
13 | Join us at The Full Stack
14 |
15 |
16 | Join us and thousands of developers who have discovered a place to
17 | show off projects and grow a network.
18 |
19 |
40 |
41 |
42 |
43 | );
44 | };
45 |
46 | export default SignUpPrompt;
47 |
--------------------------------------------------------------------------------
/src/components/common/elements/ToolTip.js:
--------------------------------------------------------------------------------
1 | const ToolTip = ({ position, message }) => {
2 | let yPostion = '-top-8 before:top-full before:border-t-base-600';
3 | if (position === 'bottom')
4 | yPostion = '-bottom-8 before:bottom-full before:border-b-base-600';
5 |
6 | return (
7 |
10 | {message}
11 |
12 | );
13 | };
14 |
15 | export default ToolTip;
16 |
--------------------------------------------------------------------------------
/src/components/common/elements/mux/ErrorMessage.js:
--------------------------------------------------------------------------------
1 | const ErrorMessage = ({ message }) => {
2 | return (
3 | <>
4 | {message || 'Unknown error'}
5 |
14 | >
15 | );
16 | };
17 |
18 | export default ErrorMessage;
19 |
--------------------------------------------------------------------------------
/src/components/common/elements/mux/VideoPlayer.js:
--------------------------------------------------------------------------------
1 | import { useEffect, useRef } from 'react';
2 | import Hls from 'hls.js';
3 |
4 | const VideoPlayer = ({
5 | src,
6 | poster,
7 | controls = true,
8 | muted = false,
9 | autoPlay = false,
10 | }) => {
11 | const videoRef = useRef(null);
12 |
13 | useEffect(() => {
14 | const video = videoRef.current;
15 | if (!video) return;
16 |
17 | video.muted = muted;
18 | video.controls = controls;
19 |
20 | let hls;
21 |
22 | if (video.canPlayType('application/vnd.apple.mpegurl')) {
23 | video.src = src;
24 | video.addEventListener('canplay', function () {});
25 | video.addEventListener('ended', () => {});
26 | video.play();
27 | } else if (Hls.isSupported()) {
28 | hls = new Hls();
29 | hls.loadSource(src);
30 | hls.attachMedia(video);
31 | video.addEventListener('canplay', function () {});
32 | video.addEventListener('ended', () => {});
33 | video.play();
34 | } else {
35 | console.error(
36 | 'This is an old browser that does not support MSE https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API'
37 | );
38 | }
39 |
40 | return () => {
41 | if (hls) {
42 | hls.destroy();
43 | }
44 | };
45 | }, [src, videoRef]);
46 |
47 | return (
48 | <>
49 |
54 | >
55 | );
56 | };
57 |
58 | export default VideoPlayer;
59 |
--------------------------------------------------------------------------------
/src/components/modules/account/settings/SignOut.js:
--------------------------------------------------------------------------------
1 | import { useAuthUser } from 'next-firebase-auth';
2 | import { useRouter } from 'next/router';
3 | import Image from 'next/future/image';
4 | import axios from 'axios';
5 |
6 | const Page = () => {
7 | const AuthUser = useAuthUser();
8 | const router = useRouter();
9 |
10 | const handleLogout = async () => {
11 | await AuthUser.signOut();
12 | await axios.get(`/api/auth/logout`);
13 | router.push('/');
14 | };
15 |
16 | return (
17 | <>
18 |
19 |
20 | We will miss you!
21 |
22 |
29 |
30 | Don't forget to come back...
31 |
32 |
33 | {
36 | handleLogout();
37 | }}
38 | >
39 | Sign me out
40 |
41 |
42 | >
43 | );
44 | };
45 |
46 | export default Page;
47 |
--------------------------------------------------------------------------------
/src/components/modules/auth/ResetEmail.js:
--------------------------------------------------------------------------------
1 | import Link from 'next/link';
2 |
3 | const ResetEmail = () => {
4 | return (
5 | <>
6 |
7 |
8 | Check Your Email
9 |
10 | Please check the email address for instructions reset your password.
11 |
12 |
13 |
17 | Resend Email
18 |
19 |
20 |
21 |
22 | >
23 | );
24 | };
25 |
26 | export default ResetEmail;
27 |
--------------------------------------------------------------------------------
/src/components/modules/chat/Message.js:
--------------------------------------------------------------------------------
1 | import Moment from 'moment';
2 |
3 | const Message = ({ user, message, numberOfMessages, currentMessageIndex }) => {
4 | const sender = message.sender === user.userId;
5 | return (
6 | <>
7 |
8 |
15 | {message.text}
16 |
17 |
18 |
19 | {numberOfMessages == currentMessageIndex + 1 && (
20 |
21 |
22 | Sent{' '}
23 | {Moment(new Date(message?.timestamp?.seconds * 1000)).format(
24 | 'MMM DD, YYYY h:mm a'
25 | )}
26 |
27 |
28 | )}
29 | >
30 | );
31 | };
32 |
33 | export default Message;
34 |
--------------------------------------------------------------------------------
/src/components/modules/chat/Profile.js:
--------------------------------------------------------------------------------
1 | import Avatar from 'components/common/elements/Avatar';
2 | import useSWR from 'swr';
3 | import fetcher from 'utils/fetcher';
4 |
5 | const Profile = ({ users, user, lastChatMessage, unRead }) => {
6 | const userToDisplay = users?.filter(
7 | (otherUser) => otherUser !== user.userId
8 | )[0];
9 |
10 | const url = `${process.env.BASEURL}/api/profile/getUser?userId=${userToDisplay}`;
11 | const { data: chatUser } = useSWR(url, fetcher);
12 |
13 | if (!chatUser) return null;
14 |
15 | return (
16 |
17 |
24 |
25 |
33 | {chatUser?.name}
34 |
35 |
41 | {lastChatMessage
42 | ? lastChatMessage.replace(/(.{29})..+/, '$1…')
43 | : 'Start a conversation…'}
44 |
45 |
46 |
47 | );
48 | };
49 |
50 | export default Profile;
51 |
--------------------------------------------------------------------------------
/src/components/modules/chat/TopBar.js:
--------------------------------------------------------------------------------
1 | import Avatar from 'components/common/elements/Avatar';
2 | import Link from 'next/link';
3 | import ReportButton from 'components/common/buttons/Report';
4 |
5 | const TopBar = ({ user, chatUserInfo }) => {
6 | if (!chatUserInfo)
7 | return (
8 |
9 | Loading user...
10 |
11 | );
12 | return (
13 |
14 |
15 |
16 | {chatUserInfo && (
17 |
23 | )}
24 |
25 | {chatUserInfo && (
26 |
27 |
28 | {chatUserInfo?.name}
29 |
30 | @{chatUserInfo?.displayName}
31 |
32 |
33 |
34 | )}
35 |
36 |
37 |
38 |
39 |
40 |
41 | );
42 | };
43 |
44 | export default TopBar;
45 |
--------------------------------------------------------------------------------
/src/components/modules/create/Main.js:
--------------------------------------------------------------------------------
1 | import { useRouter } from 'next/router';
2 | import fetcher from 'utils/fetcher';
3 | import useSWR from 'swr';
4 | import Form from 'components/modules/create/Form';
5 |
6 | const Main = ({ user }) => {
7 | const router = useRouter();
8 | let postId = router.query.ref;
9 |
10 | const viewsURL = `${process.env.BASEURL}/api/posts/getPostByRef?postId=${postId}`;
11 | const { data } = useSWR(viewsURL, fetcher);
12 |
13 | if (!data) {
14 | return
;
15 | }
16 |
17 | return (
18 | <>
19 |
24 | >
25 | );
26 | };
27 |
28 | export default Main;
29 |
--------------------------------------------------------------------------------
/src/components/modules/create/ValidationErrors.js:
--------------------------------------------------------------------------------
1 | import ModalAlert from 'components/common/modals/ModalAlert';
2 |
3 | const ValidationErrors = ({
4 | showValidationErrors,
5 | setShowValidationErrors,
6 | draftSelected,
7 | postTitle,
8 | postBody,
9 | postTechStack,
10 | postCoverImage,
11 | postProjectLink,
12 | }) => {
13 | return (
14 |
19 |
20 |
21 |
22 | {!postTitle?.trim().length && (
23 | You need to give your project a title.
24 | )}
25 | {!postBody && (
26 | You need to give a description of your project.
27 | )}
28 | {!postTechStack?.length && !draftSelected && (
29 | Tag the tech stack of your project.
30 | )}
31 | {!postCoverImage?.trim().length && !draftSelected && (
32 | Upload a cover image or video for your project.
33 | )}
34 | {!postProjectLink?.trim().length && !draftSelected && (
35 | Add a link to your project.
36 | )}
37 |
38 |
39 |
40 |
41 | );
42 | };
43 |
44 | export default ValidationErrors;
45 |
--------------------------------------------------------------------------------
/src/components/modules/explore/Categories.js:
--------------------------------------------------------------------------------
1 | import { useRouter } from 'next/router';
2 | import { CategoriesFilter } from './constants';
3 | import { sendSlackMessage } from 'utils/slack/sendMessageSlack';
4 |
5 | const Categories = ({ category, setCategory, enableState = true }) => {
6 | const router = useRouter();
7 |
8 | return (
9 |
10 | {CategoriesFilter.map((item, index) => (
11 | {
19 | enableState && setCategory(item);
20 | router.push(`/explore/popular/${item.slug}`, undefined, {
21 | shallow: true,
22 | });
23 | sendSlackMessage(
24 | `Clicked the category ${item.label} on the explore page`
25 | );
26 | }}
27 | >
28 | {item.label}
29 |
30 | ))}
31 |
32 | );
33 | };
34 |
35 | export default Categories;
36 |
--------------------------------------------------------------------------------
/src/components/modules/explore/Feed.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ProjectGallery from 'components/modules/explore/ProjectGallery';
3 |
4 | const Feed = ({ user, range, sort, category, following, viewType, query }) => {
5 | const myTechStack =
6 | user?.userSkills?.skills
7 | .map(({ languageName }) => languageName)
8 | .join(',') || null;
9 |
10 | return (
11 |
23 | );
24 | };
25 |
26 | export default Feed;
27 |
--------------------------------------------------------------------------------
/src/components/modules/explore/Filters.js:
--------------------------------------------------------------------------------
1 | import { StackFilter, RangeFilter, SortFilter } from './constants';
2 | import StackPopoverPanel from 'components/modules/explore/StackPopoverPanel';
3 | import FilterPopoverPanel from './FilterPopoverPanel';
4 |
5 | const Filters = ({ range, setRange, stack, setStack, sort, setSort }) => {
6 | return (
7 | <>
8 |
9 |
10 |
15 |
20 |
21 |
22 |
28 |
29 | >
30 | );
31 | };
32 |
33 | export default Filters;
34 |
--------------------------------------------------------------------------------
/src/components/modules/hangout/Activity.js:
--------------------------------------------------------------------------------
1 | import Link from 'next/link';
2 | import useSWR from 'swr';
3 | import fetcher from 'utils/fetcher';
4 | import { useMemo } from 'react';
5 | import Avatar from 'components/common/elements/Avatar';
6 | import FollowingCard from 'components/common/cards/FollowingCard';
7 |
8 | const Activity = ({ user, following }) => {
9 | let url = `${process.env.BASEURL}/api/explore/getActivity?range=100&size=10&following=${following}`;
10 | const { data } = useSWR(url, fetcher);
11 |
12 | return (
13 |
14 |
15 | Activity
16 |
17 | {data &&
18 | data.map((post, index) => (
19 |
20 | ))}
21 |
22 |
23 | );
24 | };
25 |
26 | export default Activity;
27 |
--------------------------------------------------------------------------------
/src/components/modules/hangout/PinnedPost.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import useSWR from 'swr';
3 | import fetcher from 'utils/fetcher';
4 | import PostCard from 'components/common/cards/PostCard';
5 | import { BsPinAngle } from 'react-icons/bs';
6 |
7 | const PinnedPost = ({ user }) => {
8 | const url = `${
9 | process.env.BASEURL
10 | }/api/posts/getPost?postId=${'welcome-to-the-full-stack-'}&authorId=${'danoely'}`;
11 | const { data } = useSWR(url, fetcher);
12 | const post = data ? data : null;
13 |
14 | if (!post) return null;
15 |
16 | return (
17 | <>
18 |
19 |
20 | >
21 | );
22 | };
23 |
24 | export default PinnedPost;
25 |
--------------------------------------------------------------------------------
/src/components/modules/profile/NotFound.js:
--------------------------------------------------------------------------------
1 | import Image from 'next/future/image';
2 |
3 | const NotFound = () => {
4 | return (
5 |
6 |
7 |
8 |
15 |
16 | 404 user not found
17 |
18 |
19 | We{"'"}re sorry, this user has either moved or does not exist. But
20 | never fear! Maybe some day we will {' '}
21 | find this person once again! So let's stay positive and hope
22 | that your paths will cross once more. Good luck! 🤞
23 |
24 |
25 |
26 |
27 | );
28 | };
29 |
30 | export default NotFound;
31 |
--------------------------------------------------------------------------------
/src/components/modules/profile/sections/Snippets.js:
--------------------------------------------------------------------------------
1 | const Snippets = () => {
2 | return (
3 |
4 |
5 | Snippets coming soon.
6 |
7 |
8 | );
9 | };
10 |
11 | export default Snippets;
12 |
--------------------------------------------------------------------------------
/src/components/modules/project/Contributors.js:
--------------------------------------------------------------------------------
1 | import useSWR from 'swr';
2 | import Avatar from 'components/common/elements/Avatar';
3 | import fetcher from 'utils/fetcher';
4 |
5 | const Contributors = ({ project }) => {
6 | const url = `${process.env.BASEURL}/api/projects/project/contributors?projectId=${project._id}`;
7 | const { data } = useSWR(url, fetcher);
8 | const contributors = data ? data.content : null;
9 |
10 | if (!contributors) return null;
11 |
12 | return (
13 | <>
14 | {contributors?.length > 1 && (
15 |
16 |
Contributors
17 |
18 | {contributors.map((contributor, index) => (
19 |
26 | ))}
27 |
28 |
29 | )}
30 | >
31 | );
32 | };
33 |
34 | export default Contributors;
35 |
--------------------------------------------------------------------------------
/src/components/modules/signup/Footer.js:
--------------------------------------------------------------------------------
1 | import Link from 'next/link';
2 |
3 | const Footer = () => {
4 | return (
5 |
26 | );
27 | };
28 |
29 | export default Footer;
30 |
--------------------------------------------------------------------------------
/src/components/modules/signup/Header.js:
--------------------------------------------------------------------------------
1 | import { useTheme } from 'next-themes';
2 | import Image from 'next/future/image';
3 |
4 | const Header = () => {
5 | const { systemTheme, theme } = useTheme();
6 | const currentTheme = theme === 'system' ? systemTheme : theme;
7 |
8 | return (
9 |
10 |
21 | Get setup on The Full Stack
22 |
23 | );
24 | };
25 |
26 | export default Header;
27 |
--------------------------------------------------------------------------------
/src/context/user.js:
--------------------------------------------------------------------------------
1 | import { createContext, useState } from 'react';
2 |
3 | export const UserStateContext = createContext({});
4 |
5 | export const UserStateProvider = ({ children }) => {
6 | const [user, setUser] = useState(null);
7 | const [userNumConnections, setUserNumConnections] = useState(0);
8 | const [userTotalLikes, setUserTotalLikes] = useState(0);
9 | const [userTotalViews, setUserTotalViews] = useState(0);
10 | const [recentMembers, setRecentMembers] = useState([]);
11 | const [featuredProject, setFeaturedProject] = useState([]);
12 | const [creatorCoinTotal, setCreatorCoinTotal] = useState(0);
13 |
14 | const value = {
15 | user,
16 | setUser,
17 | userNumConnections,
18 | setUserNumConnections,
19 | userTotalLikes,
20 | setUserTotalLikes,
21 | userTotalViews,
22 | setUserTotalViews,
23 | recentMembers,
24 | setRecentMembers,
25 | creatorCoinTotal,
26 | setCreatorCoinTotal,
27 | featuredProject,
28 | setFeaturedProject,
29 | };
30 |
31 | return (
32 |
33 | {children}
34 |
35 | );
36 | };
37 |
--------------------------------------------------------------------------------
/src/firebase/firebaseApp.js:
--------------------------------------------------------------------------------
1 | import firebase from 'firebase/app';
2 |
3 | import 'firebase/auth';
4 | import 'firebase/firestore';
5 | import 'firebase/messaging';
6 | import 'firebase/analytics';
7 | import 'firebase/performance';
8 | import 'firebase/database';
9 | if (!firebase.apps.length) {
10 | firebase.initializeApp({
11 | apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
12 | authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN,
13 | databaseURL: process.env.NEXT_PUBLIC_FIREBASE_DATABASE_URL,
14 | projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
15 | messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
16 | appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID,
17 | measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID,
18 | });
19 | } else {
20 | // console.log('Firebase is already initialised');
21 | }
22 |
23 | const firestoreCollection = {
24 | NOTIFICATIONS: 'notifications',
25 | NOTIFICATIONS_STATUS_READ: 'READ',
26 | NOTIFICATIONS_STATUS_UNREAD: 'UNREAD',
27 | NOTIFICATIONS_QUERY_LIMIT: 40,
28 | MESSAGES: 'messages',
29 | CHAT_NOTIFICATIONS: 'chatNotifications',
30 | CHATS: 'chats',
31 | };
32 |
33 | // // Initialize Performance Monitoring and get a reference to the service
34 | const firebasePerf = firebase.performance;
35 | let analytics = null;
36 |
37 | analytics = firebase.analytics;
38 |
39 | const FirestoreTimestamp = firebase.firestore.Timestamp;
40 |
41 | export {
42 | firebase,
43 | analytics,
44 | firestoreCollection,
45 | FirestoreTimestamp,
46 | firebasePerf,
47 | };
48 |
--------------------------------------------------------------------------------
/src/hooks/useUserProfile.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { useContext } from 'react';
3 | import { UserStateContext } from 'context/user';
4 |
5 | export default function useUserProfile() {
6 | const { user, setUser } = useContext(UserStateContext);
7 |
8 | const getUser = async () => {
9 | const requestUrl = `${process.env.BASEURL}/api/profile/me`;
10 |
11 | if (requestUrl != '') {
12 | await axios
13 | .get(requestUrl)
14 | .then((response) => {
15 | setUser(response.data);
16 | })
17 | .catch((error) => {
18 | console.log(error.status);
19 | });
20 | }
21 | };
22 |
23 | return [user, getUser];
24 | }
25 |
--------------------------------------------------------------------------------
/src/lib/ga/index.js:
--------------------------------------------------------------------------------
1 | export const pageview = (url) => {
2 | window?.gtag('config', process.env.GA_TRACKING_ID, {
3 | page_path: url,
4 | });
5 | };
6 |
7 | export const event = ({ action, params }) => {
8 | window?.gtag('event', action, params);
9 | };
10 |
--------------------------------------------------------------------------------
/src/lib/gtag.js:
--------------------------------------------------------------------------------
1 | // lib/gtag.js
2 | // https://developers.google.com/analytics/devguides/collection/gtagjs/pages
3 | export const pageview = (url) => {
4 | window.gtag('config', 'UA-192780985-1', {
5 | page_path: url,
6 | });
7 | };
8 |
9 | // https://developers.google.com/analytics/devguides/collection/gtagjs/events
10 | // User-id gtag('set', {'user_id': 'USER_ID'}); // Set the user ID using signed-in user_id.
11 | export const event = ({ action, category, label, value }) => {
12 | window.gtag('event', action, {
13 | event_category: category,
14 | event_label: label,
15 | value: value,
16 | });
17 | };
18 |
19 | export const set = ({ user_id }) => {
20 | window.gtag('set', { user_id: user_id });
21 | };
22 |
--------------------------------------------------------------------------------
/src/pages/404.js:
--------------------------------------------------------------------------------
1 | import Meta from 'components/common/partials/Metadata';
2 |
3 | const NotFound = () => {
4 | return (
5 | <>
6 |
11 |
12 |
13 |
14 |
15 |
16 | 404... god dam it!!
17 |
18 |
19 | We{"'"}re sorry, this page has either moved or does not exist.
20 |
21 |
22 |
30 |
31 |
32 |
33 | >
34 | );
35 | };
36 |
37 | export default NotFound;
38 |
--------------------------------------------------------------------------------
/src/pages/_document.js:
--------------------------------------------------------------------------------
1 | import Document, { Html, Head, Main, NextScript } from 'next/document';
2 |
3 | export default class MyDocument extends Document {
4 | render() {
5 | return (
6 |
7 |
8 | {/* Global Site Tag (gtag.js) - Google Analytics */}
9 |
13 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | );
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/pages/account/network.js:
--------------------------------------------------------------------------------
1 | import {
2 | withAuthUser,
3 | AuthAction,
4 | withAuthUserTokenSSR,
5 | } from 'next-firebase-auth';
6 | import { getUserProfile } from 'pages/api/auth/userProfile';
7 | import Meta from 'components/common/partials/Metadata';
8 | import Layout from 'components/common/layout/Layout';
9 | import Main from 'components/modules/account/network/Main';
10 |
11 | const AccountNetwork = ({ user }) => {
12 | return (
13 | <>
14 |
15 |
20 |
21 |
22 |
23 |
24 |
25 | >
26 | );
27 | };
28 |
29 | export default withAuthUser()(AccountNetwork);
30 |
31 | export const getServerSideProps = withAuthUserTokenSSR({
32 | whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
33 | })(async ({ AuthUser, req, res }) => {
34 | const accessToken = await AuthUser.getIdToken();
35 | const userProfile = await getUserProfile(accessToken, null, req, res);
36 |
37 | if (userProfile?.redirect) {
38 | return {
39 | redirect: {
40 | destination: userProfile.redirect,
41 | permanent: false,
42 | },
43 | };
44 | }
45 |
46 | return {
47 | props: {
48 | user: userProfile || null,
49 | },
50 | };
51 | });
52 |
--------------------------------------------------------------------------------
/src/pages/account/profile/invite.js:
--------------------------------------------------------------------------------
1 | import {
2 | AuthAction,
3 | withAuthUser,
4 | withAuthUserTokenSSR,
5 | } from 'next-firebase-auth';
6 | import { getUserProfile } from 'pages/api/auth/userProfile';
7 | import Meta from 'components/common/partials/Metadata';
8 | import Layout from 'components/common/layout/Layout';
9 | import InviteFriends from 'components/modules/account/profile/InviteFriends';
10 |
11 | const Invite = ({ user }) => {
12 | return (
13 |
14 |
19 |
20 |
21 |
22 |
23 |
24 | );
25 | };
26 |
27 | export default withAuthUser()(Invite);
28 |
29 | export const getServerSideProps = withAuthUserTokenSSR({
30 | whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
31 | })(async ({ AuthUser, req, res }) => {
32 | const accessToken = await AuthUser.getIdToken();
33 | const userProfile = await getUserProfile(accessToken, AuthUser, req, res);
34 |
35 | if (userProfile?.redirect) {
36 | return {
37 | redirect: {
38 | destination: userProfile.redirect,
39 | permanent: false,
40 | },
41 | };
42 | }
43 |
44 | return {
45 | props: {
46 | user: userProfile || null,
47 | },
48 | };
49 | });
50 |
--------------------------------------------------------------------------------
/src/pages/account/settings.js:
--------------------------------------------------------------------------------
1 | import {
2 | withAuthUser,
3 | AuthAction,
4 | withAuthUserTokenSSR,
5 | } from 'next-firebase-auth';
6 | import { getUserProfile } from 'pages/api/auth/userProfile';
7 | import Meta from 'components/common/partials/Metadata';
8 | import Layout from 'components/common/layout/Layout';
9 | import Main from 'components/modules/account/settings/Main';
10 |
11 | const AccountSettings = ({ user }) => {
12 | return (
13 |
14 |
19 |
20 | {user && }
21 |
22 | );
23 | };
24 |
25 | export default withAuthUser()(AccountSettings);
26 |
27 | export const getServerSideProps = withAuthUserTokenSSR({
28 | whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
29 | })(async ({ AuthUser, req, res }) => {
30 | const accessToken = await AuthUser.getIdToken();
31 | const userProfile = await getUserProfile(accessToken, null, req, res);
32 |
33 | if (userProfile?.redirect) {
34 | return {
35 | redirect: {
36 | destination: userProfile.redirect,
37 | permanent: false,
38 | },
39 | };
40 | }
41 |
42 | return {
43 | props: {
44 | user: userProfile || null,
45 | },
46 | };
47 | });
48 |
--------------------------------------------------------------------------------
/src/pages/account/settings/archive.js:
--------------------------------------------------------------------------------
1 | import {
2 | AuthAction,
3 | withAuthUser,
4 | withAuthUserTokenSSR,
5 | } from 'next-firebase-auth';
6 | import { getUserProfile } from 'pages/api/auth/userProfile';
7 | import Meta from 'components/common/partials/Metadata';
8 | import Layout from 'components/common/layout/Layout';
9 | import Page from 'components/modules/account/settings/Archive';
10 |
11 | const Archive = ({ user }) => {
12 | return (
13 |
14 |
19 | {user && (
20 |
21 |
22 |
23 | )}
24 |
25 | );
26 | };
27 |
28 | export default withAuthUser()(Archive);
29 |
30 | export const getServerSideProps = withAuthUserTokenSSR({
31 | whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
32 | })(async ({ AuthUser, req, res }) => {
33 | const accessToken = await AuthUser.getIdToken();
34 | const userProfile = await getUserProfile(accessToken, null, req, res);
35 |
36 | if (userProfile?.redirect) {
37 | return {
38 | redirect: {
39 | destination: userProfile.redirect,
40 | permanent: false,
41 | },
42 | };
43 | }
44 |
45 | return {
46 | props: {
47 | user: userProfile,
48 | },
49 | };
50 | });
51 |
--------------------------------------------------------------------------------
/src/pages/account/settings/danger.js:
--------------------------------------------------------------------------------
1 | import {
2 | AuthAction,
3 | withAuthUser,
4 | withAuthUserTokenSSR,
5 | } from 'next-firebase-auth';
6 | import { getUserProfile } from 'pages/api/auth/userProfile';
7 | import Meta from 'components/common/partials/Metadata';
8 | import Layout from 'components/common/layout/Layout';
9 | import DangerZone from 'components/modules/account/settings/DangerZone';
10 |
11 | const Danger = ({ user }) => {
12 | return (
13 |
14 |
19 | {user && (
20 |
21 |
22 |
23 | )}
24 |
25 | );
26 | };
27 |
28 | export default withAuthUser()(Danger);
29 |
30 | export const getServerSideProps = withAuthUserTokenSSR({
31 | whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
32 | })(async ({ AuthUser, req, res }) => {
33 | const accessToken = await AuthUser.getIdToken();
34 | const userProfile = await getUserProfile(accessToken, null, req, res);
35 |
36 | if (userProfile?.redirect) {
37 | return {
38 | redirect: {
39 | destination: userProfile.redirect,
40 | permanent: false,
41 | },
42 | };
43 | }
44 |
45 | return {
46 | props: {
47 | user: userProfile,
48 | },
49 | };
50 | });
51 |
--------------------------------------------------------------------------------
/src/pages/account/settings/jobpreferences.js:
--------------------------------------------------------------------------------
1 | import {
2 | AuthAction,
3 | withAuthUser,
4 | withAuthUserTokenSSR,
5 | } from 'next-firebase-auth';
6 | import { getUserProfile } from 'pages/api/auth/userProfile';
7 | import Meta from 'components/common/partials/Metadata';
8 | import Layout from 'components/common/layout/Layout';
9 | import Page from 'components/modules/account/settings/JobPreferences';
10 |
11 | const JobPreferences = ({ user }) => {
12 | return (
13 |
14 |
19 | {user && (
20 |
21 |
22 |
23 | )}
24 |
25 | );
26 | };
27 |
28 | export default withAuthUser()(JobPreferences);
29 |
30 | export const getServerSideProps = withAuthUserTokenSSR({
31 | whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
32 | })(async ({ AuthUser, req, res }) => {
33 | const accessToken = await AuthUser.getIdToken();
34 | const userProfile = await getUserProfile(accessToken, null, req, res);
35 |
36 | if (userProfile?.redirect) {
37 | return {
38 | redirect: {
39 | destination: userProfile.redirect,
40 | permanent: false,
41 | },
42 | };
43 | }
44 |
45 | return {
46 | props: {
47 | user: userProfile,
48 | },
49 | };
50 | });
51 |
--------------------------------------------------------------------------------
/src/pages/account/settings/notifications.js:
--------------------------------------------------------------------------------
1 | import {
2 | AuthAction,
3 | withAuthUser,
4 | withAuthUserTokenSSR,
5 | } from 'next-firebase-auth';
6 | import { getUserProfile } from 'pages/api/auth/userProfile';
7 | import Meta from 'components/common/partials/Metadata';
8 | import Layout from 'components/common/layout/LayoutLoggedIn';
9 | import Page from 'components/modules/account/settings/NotificationsPreferences';
10 |
11 | const DataArchive = ({ userProfile }) => {
12 | return (
13 |
14 |
19 | {userProfile && (
20 |
21 |
22 |
23 | )}
24 |
25 | );
26 | };
27 |
28 | export default withAuthUser()(DataArchive);
29 |
30 | export const getServerSideProps = withAuthUserTokenSSR({
31 | whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
32 | })(async ({ AuthUser, req, res }) => {
33 | const accessToken = await AuthUser.getIdToken();
34 | const userProfile = await getUserProfile(accessToken, null, req, res);
35 |
36 | if (userProfile?.redirect) {
37 | return {
38 | redirect: {
39 | destination: userProfile.redirect,
40 | permanent: false,
41 | },
42 | };
43 | }
44 |
45 | return {
46 | props: {
47 | userProfile: userProfile,
48 | },
49 | };
50 | });
51 |
--------------------------------------------------------------------------------
/src/pages/account/settings/signout.js:
--------------------------------------------------------------------------------
1 | import {
2 | AuthAction,
3 | withAuthUser,
4 | withAuthUserTokenSSR,
5 | } from 'next-firebase-auth';
6 | import { getUserProfile } from 'pages/api/auth/userProfile';
7 | import Meta from 'components/common/partials/Metadata';
8 | import Layout from 'components/common/layout/Layout';
9 | import Page from 'components/modules/account/settings/SignOut';
10 |
11 | const SignOut = ({ user }) => {
12 | return (
13 |
14 |
19 | {user && (
20 |
21 |
22 |
23 | )}
24 |
25 | );
26 | };
27 |
28 | export default withAuthUser()(SignOut);
29 |
30 | export const getServerSideProps = withAuthUserTokenSSR({
31 | whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
32 | })(async ({ AuthUser, req, res }) => {
33 | const accessToken = await AuthUser.getIdToken();
34 | const userProfile = await getUserProfile(accessToken, null, req, res);
35 |
36 | if (userProfile?.redirect) {
37 | return {
38 | redirect: {
39 | destination: userProfile.redirect,
40 | permanent: false,
41 | },
42 | };
43 | }
44 |
45 | return {
46 | props: {
47 | user: userProfile,
48 | },
49 | };
50 | });
51 |
--------------------------------------------------------------------------------
/src/pages/account/teams/jobs/[teamId].js:
--------------------------------------------------------------------------------
1 | import {
2 | AuthAction,
3 | withAuthUser,
4 | withAuthUserTokenSSR,
5 | } from 'next-firebase-auth';
6 | import { getUserProfile } from 'pages/api/auth/userProfile';
7 | import Meta from 'components/common/partials/Metadata';
8 | import Layout from 'components/common/layout/Layout';
9 | import JobListings from 'components/modules/account/teams/Jobs';
10 |
11 | const TeamJobs = ({ user, teamId }) => {
12 | return (
13 |
14 |
19 | {user && (
20 |
21 |
22 |
23 | )}
24 |
25 | );
26 | };
27 |
28 | export default withAuthUser()(TeamJobs);
29 |
30 | export const getServerSideProps = withAuthUserTokenSSR({
31 | whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
32 | })(async ({ AuthUser, req, res, params }) => {
33 | const accessToken = await AuthUser.getIdToken();
34 | const userProfile = await getUserProfile(accessToken, null, req, res);
35 |
36 | if (userProfile?.redirect) {
37 | return {
38 | redirect: {
39 | destination: userProfile.redirect,
40 | permanent: false,
41 | },
42 | };
43 | }
44 |
45 | return {
46 | props: {
47 | user: userProfile,
48 | teamId: params.teamId,
49 | },
50 | };
51 | });
52 |
--------------------------------------------------------------------------------
/src/pages/account/teams/jobs/new.js:
--------------------------------------------------------------------------------
1 | import {
2 | AuthAction,
3 | withAuthUser,
4 | withAuthUserTokenSSR,
5 | } from 'next-firebase-auth';
6 | import { getUserProfile } from 'pages/api/auth/userProfile';
7 | import Meta from 'components/common/partials/Metadata';
8 | import Main from 'components/modules/account/teams/CreateJob';
9 | import Layout from 'components/common/layout/LayoutLoggedIn';
10 |
11 | const CreateJob = ({ userProfile }) => {
12 | return (
13 |
14 |
19 | {userProfile && (
20 |
21 |
22 |
23 | )}
24 |
25 | );
26 | };
27 |
28 | export default withAuthUser()(CreateJob);
29 |
30 | export const getServerSideProps = withAuthUserTokenSSR({
31 | whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
32 | })(async ({ AuthUser, req, res, params }) => {
33 | const accessToken = await AuthUser.getIdToken();
34 | const userProfile = await getUserProfile(accessToken, null, req, res);
35 |
36 | if (userProfile?.redirect) {
37 | return {
38 | redirect: {
39 | destination: userProfile.redirect,
40 | permanent: false,
41 | },
42 | };
43 | }
44 |
45 | return {
46 | props: {
47 | userProfile: userProfile,
48 | },
49 | };
50 | });
51 |
--------------------------------------------------------------------------------
/src/pages/account/wallet.js:
--------------------------------------------------------------------------------
1 | import {
2 | AuthAction,
3 | withAuthUser,
4 | withAuthUserTokenSSR,
5 | } from 'next-firebase-auth';
6 | import { getUserProfile } from 'pages/api/auth/userProfile';
7 | import Meta from 'components/common/partials/Metadata';
8 | import Layout from 'components/common/layout/Layout';
9 | import Main from 'components/modules/account/wallet/Main';
10 |
11 | const AccountWallet = ({ user, promo }) => {
12 | return (
13 | <>
14 |
19 |
20 |
21 |
22 |
23 | >
24 | );
25 | };
26 |
27 | export default withAuthUser()(AccountWallet);
28 |
29 | export const getServerSideProps = withAuthUserTokenSSR({
30 | whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
31 | })(async ({ AuthUser, req, res }) => {
32 | const accessToken = await AuthUser.getIdToken();
33 | const userProfile = await getUserProfile(accessToken, null, req, res);
34 |
35 | if (!userProfile || userProfile?.redirect) {
36 | return {
37 | redirect: {
38 | destination: '/login',
39 | permanent: false,
40 | },
41 | };
42 | }
43 |
44 | return {
45 | props: {
46 | user: userProfile,
47 | promo: {
48 | code: 'EARLYADOPTER',
49 | value: 20,
50 | },
51 | },
52 | };
53 | });
54 |
--------------------------------------------------------------------------------
/src/pages/api/accounts/connections/approve.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 |
3 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
4 | import initAuth from '../../../../firebase/initFirebaseApp';
5 |
6 | initAuth();
7 |
8 | const handler = async (req, res, AuthUser) => {
9 | const accessToken = await AuthUser.getIdToken();
10 |
11 | let request_body = {
12 | receiver_user_id: req.body.receiver_user_id,
13 | };
14 |
15 | return axios
16 | .post(
17 | `${process.env.API_CONNECTIONS_URL}/connection/${req.body.requester_user_id}/approve`,
18 | JSON.stringify(request_body),
19 | {
20 | headers: {
21 | 'Content-Type': 'application/json',
22 | Authorization: `Bearer ${accessToken}`,
23 | },
24 | }
25 | )
26 | .then((response) => {
27 | res.status(response.status).json({ success: response.statusText });
28 | })
29 | .catch((error) => {
30 | res.status(error.response.status).json(error.response.data);
31 | });
32 | };
33 |
34 | export default withAuthUserTokenAPI(handler);
35 | // export default handler;
36 |
--------------------------------------------------------------------------------
/src/pages/api/accounts/connections/reject.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 | const handler = async (req, res, AuthUser) => {
7 | const accessToken = await AuthUser.getIdToken();
8 | let request_body = {
9 | receiver_user_id: req.body.receiver_user_id,
10 | };
11 |
12 | return axios
13 | .post(
14 | `${process.env.API_CONNECTIONS_URL}/connection/${req.body.requester_user_id}/reject`,
15 | JSON.stringify(request_body),
16 | {
17 | headers: {
18 | 'Content-Type': 'application/json',
19 | Authorization: `Bearer ${accessToken}`,
20 | },
21 | }
22 | )
23 | .then((response) => {
24 | res.status(response.status).json({ success: response.statusText });
25 | })
26 | .catch((error) => {
27 | res.status(error.response.status).json(error.response.data);
28 | });
29 | };
30 |
31 | export default withAuthUserTokenAPI(handler);
32 | // export default handler;
33 |
--------------------------------------------------------------------------------
/src/pages/api/auth/linkedin/login.js:
--------------------------------------------------------------------------------
1 | import { AuthorizationCode } from 'simple-oauth2';
2 | import { randomBytes } from 'crypto';
3 | import nookies from 'nookies';
4 |
5 | export const LINKEDIN_OAUTH_SCOPES = ['r_emailaddress', 'r_liteprofile'];
6 | export const LINKEDIN_REDIRECT_URI = `${process.env.BASEURL}/auth/linkedin/redirect`;
7 |
8 | export const LINKEDIN_CONFIG = {
9 | client: {
10 | id: process.env.LINKEDIN_OAUTH_CLIENT_ID,
11 | secret: process.env.LINKEDIN_OAUTH_CLIENT_SECRET,
12 | },
13 | auth: {
14 | tokenHost: 'https://www.linkedin.com',
15 | tokenPath: '/oauth/v2/accessToken',
16 | authorizePath: '/oauth/v2/authorization',
17 | },
18 | http: {
19 | headers: { 'Content-Type': 'x-www-form-urlencoded' },
20 | },
21 | options: {
22 | authorizationMethod: 'body',
23 | },
24 | };
25 |
26 | export const getLinkedinState = async (req, res) => {
27 | const linkedinState = randomBytes(20).toString('hex');
28 | nookies.set({ res }, 'stateLK', linkedinState, {
29 | maxAge: 30 * 24 * 60 * 60,
30 | path: '/',
31 | });
32 |
33 | return linkedinState;
34 | };
35 |
36 | const handler = async (req, res) => {
37 | const client = new AuthorizationCode(LINKEDIN_CONFIG);
38 | const linkedinState = await getLinkedinState(req, res);
39 |
40 | const authorizationUri = client.authorizeURL({
41 | redirect_uri: LINKEDIN_REDIRECT_URI,
42 | scope: LINKEDIN_OAUTH_SCOPES,
43 | state: linkedinState,
44 | });
45 |
46 | res.redirect(authorizationUri);
47 | };
48 |
49 | export default handler;
50 |
--------------------------------------------------------------------------------
/src/pages/api/auth/login.js:
--------------------------------------------------------------------------------
1 | // ./pages/api/login
2 | import { setAuthCookies } from 'next-firebase-auth';
3 | import initAuth from '../../../firebase/initFirebaseApp'; // the module you created above
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res) => {
8 | try {
9 | await setAuthCookies(req, res);
10 | } catch (e) {
11 | console.log(e);
12 | return res.status(500).json({ error: 'Unexpected error.' });
13 | }
14 | return res.status(200).json({ success: true });
15 | };
16 |
17 | export default handler;
18 |
--------------------------------------------------------------------------------
/src/pages/api/auth/logout.js:
--------------------------------------------------------------------------------
1 | import { unsetAuthCookies } from 'next-firebase-auth';
2 | import initAuth from '../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 |
6 | const handler = async (req, res) => {
7 | try {
8 | await unsetAuthCookies(req, res);
9 | } catch (e) {
10 | return res.status(500).json({ error: 'Unexpected error.' });
11 | }
12 | return res.status(200).json({ success: true });
13 | };
14 |
15 | export default handler;
16 |
--------------------------------------------------------------------------------
/src/pages/api/auth/token.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../api/auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 |
6 | const handler = async (req, res, AuthUser) => {
7 | const accessToken = await AuthUser.getIdToken();
8 | // const accessToken = 'fdsfsdfsd';
9 | res.status('200').json({ token: accessToken });
10 | };
11 |
12 | export default withAuthUserTokenAPI(handler);
13 | // export default handler;
14 |
--------------------------------------------------------------------------------
/src/pages/api/auth/withAuthUserTokenAPI.js:
--------------------------------------------------------------------------------
1 | import { AuthAction, withAuthUserTokenSSR } from 'next-firebase-auth';
2 |
3 | const checkServerSideAuth =
4 | typeof window !== 'undefined'
5 | ? null // "withAuthUserTokenSSR" can only be called server-side.
6 | : withAuthUserTokenSSR({
7 | whenAuthed: AuthAction.RENDER,
8 | whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
9 | authPageURL: '401',
10 | })(({ AuthUser }) => ({ AuthUser, props: {} }));
11 |
12 | export function withAuthUserTokenAPI(handler, byPassAuth = false) {
13 | return async (req, res) => {
14 | const { AuthUser, redirect } = await checkServerSideAuth({ req, res });
15 | if (redirect) {
16 | if (byPassAuth) {
17 | return handler(req, res);
18 | } else {
19 | res.status(401).json({ ok: false, code: 'unauthorized' });
20 | return;
21 | }
22 | } else {
23 | return handler(req, res, AuthUser);
24 | }
25 | };
26 |
27 | // return async (req, res) => {
28 | // const { AuthUser, redirect } = await checkServerSideAuth({ req, res });
29 | // if (redirect) {
30 | // res.status(401).json({ ok: false, code: "unauthorized" });
31 | // return;
32 | // }
33 | // return handler(req, res, AuthUser);
34 | // };
35 | }
36 |
--------------------------------------------------------------------------------
/src/pages/api/checkout_sessions/[id].js:
--------------------------------------------------------------------------------
1 | import Stripe from 'stripe';
2 |
3 | const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
4 |
5 | export default async function handler(req, res) {
6 | const id = req.query.id;
7 | try {
8 | if (!id.startsWith('cs_')) {
9 | throw Error('Incorrect CheckoutSession ID');
10 | }
11 | const checkout_session = await stripe.checkout.sessions.retrieve(id);
12 | res.status(200).json(checkout_session);
13 | } catch (err) {
14 | res.status(500).json({ statusCode: 500, message: err.message });
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/pages/api/checkout_sessions/index.js:
--------------------------------------------------------------------------------
1 | import Stripe from 'stripe';
2 |
3 | const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
4 |
5 | export default async function handler(req, res) {
6 | if (req.method === 'POST') {
7 | try {
8 | const session = await stripe.checkout.sessions.create({
9 | mode: 'subscription',
10 | payment_method_types: ['card'],
11 | allow_promotion_codes: true,
12 | line_items: req?.body?.items ?? [],
13 | success_url: `${req.headers.origin}/account/settings/subscriptions/success?session_id={CHECKOUT_SESSION_ID}&ref_plan=${req.body.refPlan}`,
14 | cancel_url: `${req.headers.origin}/account/teams`,
15 | tax_id_collection: {
16 | enabled: true,
17 | },
18 | });
19 | res.status(200).json(session);
20 | } catch (err) {
21 | console.log(err);
22 | res.status(500).json({ statusCode: 500, message: err.message });
23 | }
24 | } else {
25 | res.setHeader('Allow', 'POST');
26 | res.status(405).end('Method Not Allowed');
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/pages/api/connections/get.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .get(
12 | `${process.env.API_CONNECTIONS_URL}/users/${req.query.userId}/connections`,
13 | {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | }
18 | )
19 | .then((response) => {
20 | res.status(response.status).json(response.data.data);
21 | })
22 | .catch((error) => {
23 | res.status(error.response.status).json(error.response.data);
24 | });
25 | };
26 |
27 | export default withAuthUserTokenAPI(handler);
28 | // export default handler;
29 |
--------------------------------------------------------------------------------
/src/pages/api/explore/getActivity.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 |
6 | const handler = async (req, res, AuthUser) => {
7 | const accessToken = await AuthUser.getIdToken();
8 | const userIds = req.query.following.split(',');
9 | const data = userIds;
10 |
11 | const response = await fetch(
12 | `${process.env.API_STATS_URL}/feed?range=${req.query.range}&page=${req.query.page}&size=${req.query.size}`,
13 | {
14 | method: 'POST',
15 | body: JSON.stringify(data),
16 | headers: {
17 | Authorization: `Bearer ${accessToken}`,
18 | 'Content-Type': 'application/json',
19 | },
20 | }
21 | );
22 | const result = await response.json();
23 | res.status(result?.error ? 500 : 200).json(result.content);
24 | };
25 |
26 | export default withAuthUserTokenAPI(handler);
27 | // export default handler;
28 |
--------------------------------------------------------------------------------
/src/pages/api/firebase/firebase-messaging-sw.js:
--------------------------------------------------------------------------------
1 | let output = `importScripts('https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js');
2 | importScripts( 'https://www.gstatic.com/firebasejs/8.10.0/firebase-messaging.js');
3 |
4 | firebase.initializeApp({
5 | apiKey: '${process.env.NEXT_PUBLIC_FIREBASE_API_KEY}',
6 | authDomain: '${process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN}',
7 | projectId: '${process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID}',
8 | messagingSenderId: '${process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID}',
9 | appId: '${process.env.NEXT_PUBLIC_FIREBASE_APP_ID}',
10 | measurementId: '${process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID}',
11 | });
12 |
13 | const messaging = firebase.messaging();
14 | // console.log('Service worker ready');
15 | `;
16 | const handler = async (req, res) => {
17 | res.status(200).send(output);
18 | };
19 |
20 | export default handler;
21 |
--------------------------------------------------------------------------------
/src/pages/api/jobs/create.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .post(`${process.env.API_JOBS_URL}/jobs`, req.body.data, {
12 | headers: {
13 | Authorization: `Bearer ${accessToken}`,
14 | },
15 | })
16 | .then((response) => {
17 | res.status(response.status).json(response.data);
18 | })
19 | .catch((error) => {
20 | res.status(error.response.status).json(error.response.data);
21 | });
22 | };
23 |
24 | export default withAuthUserTokenAPI(handler);
25 | // export default handler;
26 |
--------------------------------------------------------------------------------
/src/pages/api/jobs/delete.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .delete(`${process.env.API_JOBS_URL}/jobs/${req.body.jobId}`, {
12 | headers: {
13 | Authorization: `Bearer ${accessToken}`,
14 | },
15 | })
16 | .then((response) => {
17 | res.status(response.status).json(response.data);
18 | })
19 | .catch((error) => {
20 | res.status(error.response.status).json(error.response.data);
21 | });
22 | };
23 |
24 | export default withAuthUserTokenAPI(handler);
25 | // export default handler;
26 |
--------------------------------------------------------------------------------
/src/pages/api/jobs/get.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .get(`${process.env.API_JOBS_URL}/jobs/${req.query.jobId}`, {
12 | headers: {
13 | Authorization: `Bearer ${accessToken}`,
14 | },
15 | })
16 | .then((response) => {
17 | res.status(response.status).json(response.data);
18 | })
19 | .catch((error) => {
20 | res.status(error.response.status).json(error.response.data);
21 | });
22 | };
23 |
24 | export default withAuthUserTokenAPI(handler);
25 | // export default handler;
26 |
--------------------------------------------------------------------------------
/src/pages/api/jobs/getAll.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .get(`${process.env.API_JOBS_URL}/jobs?page=${req.query.page}`, {
12 | headers: {
13 | Authorization: `Bearer ${accessToken}`,
14 | },
15 | })
16 | .then((response) => {
17 | res.status(response.status).json(response.data);
18 | })
19 | .catch((error) => {
20 | res.status(error.response.status).json(error.response.data);
21 | });
22 | };
23 |
24 | export default withAuthUserTokenAPI(handler);
25 | // export default handler;
26 |
--------------------------------------------------------------------------------
/src/pages/api/jobs/getByTeam.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser?.getIdToken();
9 | const requestURL = `${process.env.API_JOBS_URL}/teams/${req.query.teamId}/jobs`;
10 |
11 | let headers = '';
12 | if (accessToken) {
13 | headers = {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | };
18 | }
19 |
20 | return axios
21 | .get(requestURL, headers)
22 | .then((response) => {
23 | res.status(response.status).json(response.data);
24 | })
25 | .catch((error) => {
26 | res.status(error.response.status).json(error.response.data);
27 | });
28 | };
29 |
30 | export default withAuthUserTokenAPI(handler, true);
31 |
--------------------------------------------------------------------------------
/src/pages/api/jobs/update.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .patch(
12 | `${process.env.API_JOBS_URL}/jobs/${req.query.jobId}`,
13 | req.body.data,
14 | {
15 | headers: {
16 | Authorization: `Bearer ${accessToken}`,
17 | },
18 | }
19 | )
20 | .then((response) => {
21 | res.status(response.status).json(response.data);
22 | })
23 | .catch((error) => {
24 | res.status(error.response.status).json(error.response.data);
25 | });
26 | };
27 |
28 | export default withAuthUserTokenAPI(handler);
29 | // export default handler;
30 |
--------------------------------------------------------------------------------
/src/pages/api/mail/send.js:
--------------------------------------------------------------------------------
1 | import { sendMail } from 'utils/mail/sendMail';
2 |
3 | export default async function handler(req, res) {
4 | if (req.method === 'POST') {
5 | try {
6 | const { email, name, subject, client_message } = req.body;
7 |
8 | const sendGridResponse = await sendMail(
9 | name,
10 | subject,
11 | client_message,
12 | email
13 | );
14 |
15 | return res.status(sendGridResponse.status).send({
16 | sg_response: sendGridResponse,
17 | });
18 | } catch (err) {
19 | console.log('ERROR WHILE SENDING MAIL >> ', err);
20 |
21 | return res.status(400).send({
22 | err_message: 'bad request',
23 | });
24 | }
25 | }
26 |
27 | res.status(400).send({ error: 'bad request' });
28 | }
29 |
--------------------------------------------------------------------------------
/src/pages/api/notifications/getKnockJwt.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../api/auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../firebase/initFirebaseApp';
3 | import * as jwt from 'jsonwebtoken';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const userId = AuthUser.id;
9 | if (!userId || userId === undefined) {
10 | res.status(400).json('Missing userId');
11 | }
12 | const currentTime = Math.floor(Date.now() / 1000);
13 | const KEY = JSON.parse(process.env.KNOCK_API_SIGNING_KEY);
14 |
15 | const token = jwt.sign(
16 | { sub: userId, iat: currentTime, exp: currentTime + 60 * 60 },
17 | KEY,
18 | { algorithm: 'RS256' }
19 | );
20 | res.status(200).json(token);
21 | };
22 |
23 | export default withAuthUserTokenAPI(handler);
24 |
--------------------------------------------------------------------------------
/src/pages/api/notifications/slack/postEnquiry.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 |
3 | const handler = async (req, res) => {
4 | await axios
5 | .post(
6 | process.env.SLACK_POST_MESSAGE_URL,
7 | JSON.stringify({
8 | text: req.body.message,
9 | }),
10 | {
11 | headers: {
12 | 'content-type': 'application/json',
13 | },
14 | }
15 | )
16 | .then((response) => {
17 | res.status(200).json(response.data);
18 | })
19 | .catch((error) => {
20 | res.status(500).json(error);
21 | });
22 | };
23 |
24 | export default handler;
25 |
--------------------------------------------------------------------------------
/src/pages/api/notifications/slack/postMessage.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | let environment = '';
9 | let actor = AuthUser?.email + ` [${AuthUser?.id}]`;
10 |
11 | if (process.env.SLACK_NOTIFICATIONS_ENABLED === 'FALSE') return;
12 |
13 | if (process.env.NODE_ENV === 'development') {
14 | environment = 'Development';
15 | } else {
16 | environment = 'Production';
17 | }
18 |
19 | let message = `ANONYMOUS USER \nACTION: ${req.body.message} \n------------------------`;
20 | if (AuthUser)
21 | message = `ENV: ${environment} \nUSER: ${actor} \nACTION: ${req.body.message} \n------------------------`;
22 |
23 | await axios
24 | .post(
25 | process.env.SLACK_POST_MESSAGE_URL,
26 | JSON.stringify({
27 | text: message,
28 | }),
29 | {
30 | headers: {
31 | 'content-type': 'application/json',
32 | },
33 | }
34 | )
35 | .then((response) => {
36 | res.status(200).json(response.data);
37 | })
38 | .catch((error) => {
39 | res.status(500).json(error);
40 | });
41 | };
42 |
43 | export default withAuthUserTokenAPI(handler, true);
44 |
--------------------------------------------------------------------------------
/src/pages/api/posts/comments/deleteComment.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 | return axios
10 | .delete(`${process.env.API_COMMENTS_URL}/comments/${req.body.commentId}`, {
11 | headers: {
12 | Authorization: `Bearer ${accessToken}`,
13 | },
14 | })
15 | .then((response) => {
16 | res
17 | .status(response.status)
18 | .json({ success: response.statusText, comment: response.data });
19 | })
20 | .catch((error) => {
21 | res.status(500).json({ error: error });
22 | });
23 | };
24 |
25 | export default withAuthUserTokenAPI(handler);
26 |
--------------------------------------------------------------------------------
/src/pages/api/posts/comments/getComment.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .get(
12 | `${process.env.API_COMMENTS_URL}/comments/${req.query.commentId}/view`,
13 | {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | }
18 | )
19 | .then((response) => {
20 | res.status(response.status).json(response.data);
21 | })
22 | .catch((error) => {
23 | res
24 | .status(error.response.data.status)
25 | .json({ error: 'Something went wrong' });
26 | });
27 | };
28 |
29 | export default withAuthUserTokenAPI(handler);
30 | // export default handler;
31 |
--------------------------------------------------------------------------------
/src/pages/api/posts/comments/getComments.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser?.getIdToken();
9 | const requestURL = `${process.env.API_COMMENTS_URL}/comments/project/${req.query.postId}?size=30`;
10 |
11 | let headers = '';
12 | if (accessToken) {
13 | headers = {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | };
18 | }
19 |
20 | return axios
21 | .get(requestURL, headers)
22 | .then((response) => {
23 | res.status(response.status).json({
24 | success: response.statusText,
25 | comments: response.data,
26 | });
27 | })
28 | .catch((error) => {
29 | res
30 | .status(error.response.data.status)
31 | .json({ error: 'Something went wrong' });
32 | });
33 | };
34 |
35 | export default withAuthUserTokenAPI(handler, true);
36 |
--------------------------------------------------------------------------------
/src/pages/api/posts/comments/getPublicComments.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 |
3 | const handler = async (req, res) => {
4 | return axios
5 | .get(`${process.env.API_COMMENTS_URL}/comments/project/${req.query.postId}`)
6 | .then((response) => {
7 | res.status(response.status).json({
8 | success: response.statusText,
9 | comments: response.data,
10 | });
11 | })
12 | .catch((error) => {
13 | res
14 | .status(error.response.data.status)
15 | .json({ error: 'Something went wrong' });
16 | });
17 | };
18 |
19 | export default handler;
20 | // export default handler;
21 |
--------------------------------------------------------------------------------
/src/pages/api/posts/comments/getPublicReplies.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 |
3 | const handler = async (req, res) => {
4 | return axios
5 | .get(
6 | `${process.env.API_COMMENTS_URL}/comments/${req.query.commentId}/responses`
7 | )
8 | .then((response) => {
9 | res.status(response.status).json({
10 | success: response.statusText,
11 | comments: response.data,
12 | });
13 | })
14 | .catch((error) => {
15 | res
16 | .status(error.response.data.status)
17 | .json({ error: 'Something went wrong' });
18 | });
19 | };
20 |
21 | export default handler;
22 |
--------------------------------------------------------------------------------
/src/pages/api/posts/comments/getReplies.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .get(
12 | `${process.env.API_COMMENTS_URL}/comments/${req.query.commentId}/responses`,
13 | {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | }
18 | )
19 | .then((response) => {
20 | res.status(response.status).json({
21 | success: response.statusText,
22 | comments: response.data,
23 | });
24 | })
25 | .catch((error) => {
26 | res
27 | .status(error.response.data.status)
28 | .json({ error: 'Something went wrong' });
29 | });
30 | };
31 |
32 | export default withAuthUserTokenAPI(handler);
33 | // export default handler;
34 |
--------------------------------------------------------------------------------
/src/pages/api/posts/comments/likeComment.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 | return axios
10 | .patch(
11 | `${process.env.API_COMMENTS_URL}/comments/${req.body.commentId}/like`,
12 | req.body,
13 | {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | }
18 | )
19 | .then((response) => {
20 | res
21 | .status(response.status)
22 | .json({ success: response.statusText, comment: response.data });
23 | })
24 | .catch((error) => {
25 | res.status(500).json({ error: error });
26 | });
27 | };
28 |
29 | export default withAuthUserTokenAPI(handler);
30 |
--------------------------------------------------------------------------------
/src/pages/api/posts/comments/postComment.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 | return axios
10 | .post(`${process.env.API_COMMENTS_URL}/comments`, req.body, {
11 | headers: {
12 | Authorization: `Bearer ${accessToken}`,
13 | },
14 | })
15 | .then((response) => {
16 | res
17 | .status(response.status)
18 | .json({ success: response.statusText, comment: response.data });
19 | })
20 | .catch((error) => {
21 | res.status(500).json({ error: error });
22 | });
23 | };
24 |
25 | export default withAuthUserTokenAPI(handler);
26 |
--------------------------------------------------------------------------------
/src/pages/api/posts/comments/postReply.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 | return axios
10 | .post(
11 | `${process.env.API_COMMENTS_URL}/comments/${req.query.commentId}/reply`,
12 | req.body,
13 | {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | }
18 | )
19 | .then((response) => {
20 | res
21 | .status(response.status)
22 | .json({ success: response.statusText, comment: response.data });
23 | })
24 | .catch((error) => {
25 | res.status(500).json({ error: error });
26 | });
27 | };
28 |
29 | export default withAuthUserTokenAPI(handler);
30 |
--------------------------------------------------------------------------------
/src/pages/api/posts/comments/unlikeComment.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 | return axios
10 | .delete(
11 | `${process.env.API_COMMENTS_URL}/comments/${req.body.commentId}/like`,
12 | {
13 | headers: {
14 | Authorization: `Bearer ${accessToken}`,
15 | },
16 | }
17 | )
18 | .then((response) => {
19 | res
20 | .status(response.status)
21 | .json({ success: response.statusText, comment: response.data });
22 | })
23 | .catch((error) => {
24 | res.status(500).json({ error: error });
25 | });
26 | };
27 |
28 | export default withAuthUserTokenAPI(handler);
29 |
--------------------------------------------------------------------------------
/src/pages/api/posts/comments/updateComment.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 | return axios
10 | .patch(
11 | `${process.env.API_COMMENTS_URL}/comments/${req.query.commentId}`,
12 | req.body,
13 | {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | }
18 | )
19 | .then((response) => {
20 | res
21 | .status(response.status)
22 | .json({ success: response.statusText, comment: response.data });
23 | })
24 | .catch((error) => {
25 | res.status(500).json({ error: error });
26 | });
27 | };
28 |
29 | export default withAuthUserTokenAPI(handler);
30 |
--------------------------------------------------------------------------------
/src/pages/api/posts/getPost.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .get(
12 | `${process.env.API_PROJECTS_URL}/project/${encodeURIComponent(
13 | req.query.postId
14 | )}/user/${encodeURIComponent(req.query.authorId)}`,
15 | {
16 | headers: {
17 | Authorization: `Bearer ${accessToken}`,
18 | },
19 | }
20 | )
21 | .then((response) => {
22 | res.status(response.status).json(response.data);
23 | })
24 | .catch((error) => {
25 | res.status(error.response.status).json(error.response.data);
26 | });
27 | };
28 |
29 | export default withAuthUserTokenAPI(handler);
30 | // export default handler;
31 |
--------------------------------------------------------------------------------
/src/pages/api/posts/getPostById.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser?.getIdToken();
9 | const requestURL = `${process.env.API_PROJECTS_URL}/project/${req.query.postId}/view`;
10 |
11 | let headers = '';
12 | if (accessToken) {
13 | headers = {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | };
18 | }
19 |
20 | return axios
21 | .get(requestURL, headers)
22 | .then((response) => {
23 | res.status(response.status).json(response.data);
24 | })
25 | .catch((error) => {
26 | res.status(error.response.status).json(error.response.data);
27 | });
28 | };
29 |
30 | export default withAuthUserTokenAPI(handler, true);
31 |
--------------------------------------------------------------------------------
/src/pages/api/posts/getPostByRef.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 | const requestURL = `${process.env.API_PROJECTS_URL}/project/${req.query.postId}/view`;
10 |
11 | return axios
12 | .get(requestURL, {
13 | headers: {
14 | Authorization: `Bearer ${accessToken}`,
15 | },
16 | })
17 | .then((response) => {
18 | res.status(response.status).json(response.data);
19 | })
20 | .catch((error) => {
21 | res.status(error.response.status).json(error.response.data);
22 | });
23 | };
24 |
25 | export default withAuthUserTokenAPI(handler);
26 | // export default handler;
27 |
--------------------------------------------------------------------------------
/src/pages/api/posts/getPublicPost.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 |
3 | const handler = async (req, res) => {
4 | return axios
5 | .get(
6 | `${process.env.API_PROJECTS_URL}/project/${encodeURIComponent(
7 | req.query.postId
8 | )}/user/${encodeURIComponent(req.query.authorId)}`
9 | )
10 | .then((response) => {
11 | res.status(response.status).json(response.data);
12 | })
13 | .catch((error) => {
14 | res.status(error.response.status).json(error.response.data);
15 | });
16 | };
17 |
18 | export default handler;
19 |
--------------------------------------------------------------------------------
/src/pages/api/posts/getURLPreview.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 |
3 | const handler = (req, res) => {
4 | // https://europe-west1-thefullstack.cloudfunctions.net/tfs-openGraph-cf/openGraph?ogUrl=https://www.youtube.com/watch?v=URhmC865SGI
5 |
6 | return axios
7 | .get(
8 | `https://europe-west1-thefullstack.cloudfunctions.net/tfs-openGraph-cf/openGraph?ogUrl=${req.query.url}`
9 | )
10 | .then((response) => {
11 | res.status(200).json(response.data);
12 | })
13 | .catch((error) => {
14 | res.status(404).json(error);
15 | });
16 | };
17 |
18 | export default handler;
19 |
--------------------------------------------------------------------------------
/src/pages/api/posts/polls/castVote.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .patch(
12 | `${process.env.API_PROJECTS_URL}/poll/${req.query.postId}/vote/${req.query.optionId}`,
13 | { body: '' },
14 | {
15 | headers: {
16 | Authorization: `Bearer ${accessToken}`,
17 | },
18 | }
19 | )
20 | .then((response) => {
21 | console.log(response.data);
22 | res.status(response.status).json(response.data);
23 | })
24 | .catch((error) => {
25 | console.log(error.response);
26 | res.status(error.response.status).json(error.response.data);
27 | });
28 | };
29 |
30 | export default withAuthUserTokenAPI(handler);
31 |
--------------------------------------------------------------------------------
/src/pages/api/posts/polls/getPoll.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser?.getIdToken();
9 | const requestURL = `${process.env.API_PROJECTS_URL}/poll/${req.query.postId}/details`;
10 |
11 | let headers = '';
12 | if (accessToken) {
13 | headers = {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | };
18 | }
19 |
20 | return axios
21 | .get(requestURL, headers)
22 | .then((response) => {
23 | res.status(response.status).json(response.data);
24 | })
25 | .catch((error) => {
26 | res.status(error.response.status).json(error.response.data);
27 | });
28 | };
29 |
30 | export default withAuthUserTokenAPI(handler, true);
31 |
--------------------------------------------------------------------------------
/src/pages/api/profile/bio/update.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 | const handler = async (req, res, AuthUser) => {
7 | const accessToken = await AuthUser.getIdToken();
8 |
9 | return axios
10 | .patch(`${process.env.API_PROFILE_URL}/user/profile/bio`, req.body, {
11 | headers: {
12 | Authorization: `Bearer ${accessToken}`,
13 | },
14 | })
15 | .then((response) => {
16 | res.status(response.status).json({ success: response.statusText });
17 | })
18 | .catch((error) => {
19 | console.log(error);
20 |
21 | res.status(error.response.status).json(error.response.data);
22 | });
23 | };
24 |
25 | export default withAuthUserTokenAPI(handler);
26 | // export default handler;
27 |
--------------------------------------------------------------------------------
/src/pages/api/profile/connect.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../api/auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 |
6 | const handler = async (req, res, AuthUser) => {
7 | const accessToken = await AuthUser.getIdToken();
8 |
9 | const companyId = req.body.company?.companyId || null;
10 | let request_body = {
11 | requester_user_id: req.body.requester_user_id,
12 | company_id: companyId,
13 | };
14 |
15 | //change this to handle errors
16 | await fetch(
17 | `${process.env.API_CONNECTIONS_URL}/connection/${req.body.connectTo}/connect`,
18 | {
19 | method: 'POST',
20 | body: JSON.stringify(request_body),
21 | headers: {
22 | 'Content-Type': 'application/json',
23 | Authorization: `Bearer ${accessToken}`,
24 | },
25 | }
26 | );
27 |
28 | res.status(200).json({ success: 'true' });
29 | };
30 |
31 | export default withAuthUserTokenAPI(handler);
32 | // export default handler;
33 |
--------------------------------------------------------------------------------
/src/pages/api/profile/displayName/change.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 | const handler = async (req, res, AuthUser) => {
7 | const accessToken = await AuthUser.getIdToken();
8 | return axios
9 | .get(
10 | `${
11 | process.env.API_PROFILE_URL
12 | }/displayName/availabilityCheck?displayName=${encodeURIComponent(
13 | req.body.displayName
14 | )}`,
15 | {
16 | headers: {
17 | Authorization: `Bearer ${accessToken}`,
18 | },
19 | }
20 | )
21 | .then((response) => {
22 | res.status(response.status).json(response.data);
23 | })
24 | .catch((error) => {
25 | res.status(error.response.status).json(error.response.data);
26 | });
27 | };
28 |
29 | export default withAuthUserTokenAPI(handler);
30 | // export default handler;
31 |
--------------------------------------------------------------------------------
/src/pages/api/profile/getUser.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser?.getIdToken();
9 | const requestURL = `${
10 | process.env.API_PROFILE_URL
11 | }/profile/user?userId=${encodeURIComponent(req.query.userId)}`;
12 |
13 | let headers = '';
14 | if (accessToken) {
15 | headers = {
16 | headers: {
17 | Authorization: `Bearer ${accessToken}`,
18 | },
19 | };
20 | }
21 |
22 | return axios
23 | .get(requestURL, headers)
24 | .then((response) => {
25 | const obj = {
26 | name: response.data.name,
27 | displayName: response.data.displayName,
28 | profilePicUrl: response.data.profilePicUrl,
29 | currentTitle: response.data.currentTitle,
30 | };
31 |
32 | res.status(response.status).json(obj);
33 | })
34 | .catch((error) => {
35 | res.status(error.response.status).json(error.response.data);
36 | });
37 | };
38 |
39 | export default withAuthUserTokenAPI(handler, true);
40 |
--------------------------------------------------------------------------------
/src/pages/api/profile/getUsers.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser?.getIdToken();
9 | const requestURL = `${
10 | process.env.API_PROFILE_URL
11 | }/profile/user/details/batch?userIds=${encodeURIComponent(
12 | req.query.userIds
13 | )}`;
14 |
15 | let headers = '';
16 | if (accessToken) {
17 | headers = {
18 | headers: {
19 | Authorization: `Bearer ${accessToken}`,
20 | },
21 | };
22 | }
23 |
24 | return axios
25 | .get(requestURL, headers)
26 | .then((response) => {
27 | res.status(response.status).json(response.data);
28 | })
29 | .catch((error) => {
30 | res.status(error.response.status).json(error.response.data);
31 | });
32 | };
33 |
34 | export default withAuthUserTokenAPI(handler, true);
35 | // export default handler;
36 |
--------------------------------------------------------------------------------
/src/pages/api/profile/github/repos.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .get(`${process.env.API_PROJECTS_URL}/gitOps/repositories`, {
12 | headers: {
13 | Authorization: `Bearer ${accessToken}`,
14 | },
15 | })
16 | .then((response) => {
17 | res.status(response.status).json(response.data);
18 | })
19 | .catch((error) => {
20 | res.status(error.response.status).json(error.response.data);
21 | });
22 | };
23 |
24 | export default withAuthUserTokenAPI(handler);
25 | // export default handler;
26 |
--------------------------------------------------------------------------------
/src/pages/api/profile/interests/delete.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 |
6 | const handler = async (req, res, AuthUser) => {
7 | const accessToken = await AuthUser.getIdToken();
8 | await fetch(`${process.env.API_PROFILE_URL}/profile/interests`, {
9 | method: 'DELETE',
10 | body: JSON.stringify([req.body.interestId]),
11 | headers: {
12 | 'Content-Type': 'application/json',
13 | Authorization: `Bearer ${accessToken}`,
14 | },
15 | });
16 |
17 | res.status(200).json({ success: 'true' });
18 | };
19 |
20 | export default withAuthUserTokenAPI(handler);
21 |
--------------------------------------------------------------------------------
/src/pages/api/profile/interests/get.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from 'pages/api/auth/withAuthUserTokenAPI';
3 | import initAuth from 'firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 | return axios
10 | .get(
11 | `${process.env.API_PROFILE_URL}/interests/${req.query.categoryID}?page=${req.query.page}&size=${req.query.size}`,
12 | {
13 | headers: {
14 | Authorization: `Bearer ${accessToken}`,
15 | },
16 | }
17 | )
18 | .then((response) => {
19 | res.status(response.status).json({ categories: response.data.content });
20 | })
21 | .catch((error) => {
22 | console.log(error.status);
23 | res.status(error.response.status).json(error.response.data);
24 | });
25 | };
26 |
27 | export default withAuthUserTokenAPI(handler);
28 |
--------------------------------------------------------------------------------
/src/pages/api/profile/interests/getcategories.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from 'pages/api/auth/withAuthUserTokenAPI';
3 | import initAuth from 'firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 | return axios
10 | .get(
11 | `${process.env.API_PROFILE_URL}/interests?page=${req.query.page}&size=${req.query.size}`,
12 | {
13 | headers: {
14 | Authorization: `Bearer ${accessToken}`,
15 | },
16 | }
17 | )
18 | .then((response) => {
19 | res.status(response.status).json({ categories: response.data.content });
20 | })
21 | .catch((error) => {
22 | console.log(error);
23 | res.status(error.response.status).json(error.response.data);
24 | });
25 | };
26 |
27 | export default withAuthUserTokenAPI(handler);
28 |
--------------------------------------------------------------------------------
/src/pages/api/profile/interests/update.js:
--------------------------------------------------------------------------------
1 | // api/profile/interests/update
2 | import axios from 'axios';
3 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
4 | import initAuth from '../../../../firebase/initFirebaseApp';
5 |
6 | initAuth();
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 | return axios
10 | .patch(`${process.env.API_PROFILE_URL}/profile/interests`, req.body, {
11 | headers: {
12 | Authorization: `Bearer ${accessToken}`,
13 | },
14 | })
15 | .then((response) => {
16 | res.status(response.status).json({ success: response.statusText });
17 | })
18 | .catch((error) => {
19 | res.status(error.response.status).json(error.response.data);
20 | });
21 | };
22 |
23 | export default withAuthUserTokenAPI(handler);
24 | // export default handler;
25 |
--------------------------------------------------------------------------------
/src/pages/api/profile/me.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .get(`${process.env.API_PROFILE_URL}/profile/me`, {
12 | headers: {
13 | Authorization: `Bearer ${accessToken}`,
14 | },
15 | })
16 | .then((response) => {
17 | res.status(response.status).json(response.data);
18 | })
19 | .catch((error) => {
20 | res.status(error.response.status).json(error.response.data);
21 | });
22 | };
23 |
24 | export default withAuthUserTokenAPI(handler);
25 | // export default handler;
26 |
--------------------------------------------------------------------------------
/src/pages/api/profile/posts/get.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser?.getIdToken();
9 | const requestURL = `${
10 | process.env.API_PROJECTS_URL
11 | }/projects/user?displayName=${encodeURIComponent(
12 | req.query.userId
13 | )}&projectType=${req.query.projectType}&page=0&size=${req.query.size}`;
14 |
15 | let headers = '';
16 | if (accessToken) {
17 | headers = {
18 | headers: {
19 | Authorization: `Bearer ${accessToken}`,
20 | },
21 | };
22 | }
23 |
24 | return axios
25 | .get(requestURL, headers)
26 | .then((response) => {
27 | res.status(response.status).json(response.data);
28 | })
29 | .catch((error) => {
30 | console.log(error);
31 | res.status(error.response.status).json(error.response.data);
32 | });
33 | };
34 |
35 | export default withAuthUserTokenAPI(handler, true);
36 |
--------------------------------------------------------------------------------
/src/pages/api/profile/search.js:
--------------------------------------------------------------------------------
1 | // pages/api/companies
2 | import axios from 'axios';
3 | import { withAuthUserTokenAPI } from '../../api/auth/withAuthUserTokenAPI';
4 | import initAuth from '../../../firebase/initFirebaseApp';
5 |
6 | initAuth();
7 |
8 | const handler = async (req, res, AuthUser) => {
9 | const accessToken = await AuthUser.getIdToken();
10 | let term = req.body;
11 | if (term.length > 1) {
12 | await axios
13 | .get(
14 | `${process.env.API_SEARCH_URL}/search/profiles?q=${term}&offset=0&limit=10`,
15 | {
16 | headers: {
17 | 'Content-Type': 'application/json',
18 | Authorization: `Bearer ${accessToken}`,
19 | },
20 | }
21 | )
22 | .then((response) => {
23 | res.status(200).json(response.data);
24 | })
25 | .catch((error) => {
26 | res.status(200).json(error);
27 | });
28 | }
29 | };
30 |
31 | export default withAuthUserTokenAPI(handler);
32 | // export default handler;
33 |
--------------------------------------------------------------------------------
/src/pages/api/profile/skills.js:
--------------------------------------------------------------------------------
1 | // pages/api/profile/update.js
2 | import { withAuthUserTokenAPI } from '../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res) => {
8 | // const accessToken = await AuthUser.getIdToken();
9 |
10 | await fetch(process.env.API_PROFILE_URL + '/user/profile/update');
11 |
12 | res.status(200).json({ success: 'true' });
13 | };
14 |
15 | export default withAuthUserTokenAPI(handler);
16 | // export default handler;
17 |
--------------------------------------------------------------------------------
/src/pages/api/profile/skills/update.js:
--------------------------------------------------------------------------------
1 | // pages/api/profile/experience/create.js
2 | import axios from 'axios';
3 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
4 | import initAuth from '../../../../firebase/initFirebaseApp';
5 |
6 | initAuth();
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 | return axios
10 | .patch(`${process.env.API_PROFILE_URL}/user/profile/skills`, req.body, {
11 | headers: {
12 | Authorization: `Bearer ${accessToken}`,
13 | },
14 | })
15 | .then((response) => {
16 | res.status(response.status).json({ success: response.statusText });
17 | })
18 | .catch((error) => {
19 | res.status(error.response.status).json(error.response.data);
20 | });
21 | };
22 |
23 | export default withAuthUserTokenAPI(handler);
24 | // export default handler;
25 |
--------------------------------------------------------------------------------
/src/pages/api/profile/sng/deleteContent.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .delete(
12 | `${process.env.API_PROJECTS_URL}/sng/?sources=${req.query.source}`,
13 | {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | }
18 | )
19 | .then((response) => {
20 | res.status(response.status).json(response.data);
21 | })
22 | .catch((error) => {
23 | res.status(error.response.status).json(error.response.data);
24 | });
25 | };
26 |
27 | export default withAuthUserTokenAPI(handler);
28 | // export default handler;
29 |
--------------------------------------------------------------------------------
/src/pages/api/profile/sng/getByUser.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser?.getIdToken();
9 | const requestURL = `${process.env.API_PROJECTS_URL}/sng/${encodeURIComponent(
10 | req.query.displayName
11 | )}?page=0&size=90&sources=${req.query.source}`;
12 |
13 | let headers = '';
14 | if (accessToken) {
15 | headers = {
16 | headers: {
17 | Authorization: `Bearer ${accessToken}`,
18 | },
19 | };
20 | }
21 |
22 | return axios
23 | .get(requestURL, headers)
24 | .then((response) => {
25 | res.status(response.status).json(response.data);
26 | })
27 | .catch((error) => {
28 | res.status(error.response.status).json(error.response.data);
29 | });
30 | };
31 |
32 | export default withAuthUserTokenAPI(handler, true);
33 | // export default handler;
34 |
--------------------------------------------------------------------------------
/src/pages/api/profile/sng/importContent.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .post(
12 | `${process.env.API_PROJECTS_URL}/sng/${encodeURIComponent(
13 | req.query.username
14 | )}?source=${req.query.source}`,
15 | {},
16 | {
17 | headers: {
18 | Authorization: `Bearer ${accessToken}`,
19 | },
20 | }
21 | )
22 | .then((response) => {
23 | res.status(response.status).json(response.data);
24 | })
25 | .catch((error) => {
26 | res.status(error.response.status).json(error.response.data);
27 | });
28 | };
29 |
30 | export default withAuthUserTokenAPI(handler);
31 | // export default handler;
32 |
--------------------------------------------------------------------------------
/src/pages/api/profile/social/follow.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 | const handler = async (req, res, AuthUser) => {
6 | const accessToken = await AuthUser.getIdToken();
7 |
8 | try {
9 | if (
10 | !req.query.userId ||
11 | req.query.userId == undefined ||
12 | req.query.userId.length < 1
13 | ) {
14 | throw 'Invalid userId to follow';
15 | }
16 |
17 | const result = await fetch(
18 | `${process.env.API_CONNECTIONS_URL}/users/${req.query.userId}/follow`,
19 | {
20 | method: 'POST',
21 | headers: {
22 | Authorization: `Bearer ${accessToken}`,
23 | },
24 | }
25 | );
26 |
27 | res.status(200).json({ success: 'true' });
28 | } catch (error) {
29 | console.log(error);
30 | res.status(200).json({ success: 'false' });
31 | }
32 | };
33 |
34 | export default withAuthUserTokenAPI(handler);
35 | // export default handler;
36 |
--------------------------------------------------------------------------------
/src/pages/api/profile/social/followers.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 | const handler = async (req, res, AuthUser) => {
6 | const accessToken = await AuthUser.getIdToken();
7 |
8 | try {
9 | const response = await fetch(
10 | `${process.env.API_CONNECTIONS_URL}/users/${AuthUser.id}/followers`,
11 | {
12 | method: 'GET',
13 | headers: {
14 | Authorization: `Bearer ${accessToken}`,
15 | },
16 | }
17 | );
18 |
19 | const result = await response.json();
20 | if (result.status != 'success') {
21 | throw 'Error getting followings';
22 | }
23 |
24 | res.status(200).json(result.data);
25 | } catch (error) {
26 | res.status(200).json({ success: 'false' });
27 | }
28 | };
29 |
30 | export default withAuthUserTokenAPI(handler);
31 | // export default handler;
32 |
--------------------------------------------------------------------------------
/src/pages/api/profile/social/following.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 | const handler = async (req, res, AuthUser) => {
6 | const accessToken = await AuthUser.getIdToken();
7 |
8 | try {
9 | const response = await fetch(
10 | `${process.env.API_CONNECTIONS_URL}/users/${AuthUser.id}/following`,
11 | {
12 | method: 'GET',
13 | headers: {
14 | Authorization: `Bearer ${accessToken}`,
15 | },
16 | }
17 | );
18 |
19 | const result = await response.json();
20 | if (result.status != 'success') {
21 | throw 'Error getting followings';
22 | }
23 |
24 | res.status(200).json(result.data);
25 | } catch (error) {
26 | res.status(200).json({ success: 'false' });
27 | }
28 | };
29 |
30 | export default withAuthUserTokenAPI(handler);
31 | // export default handler;
32 |
--------------------------------------------------------------------------------
/src/pages/api/profile/social/unfollow.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 | const handler = async (req, res, AuthUser) => {
6 | const accessToken = await AuthUser.getIdToken();
7 | try {
8 | if (
9 | !req.query.userId ||
10 | req.query.userId == undefined ||
11 | req.query.userId.length < 1
12 | ) {
13 | throw 'Invalid userId to unfollow';
14 | }
15 |
16 | const result = await fetch(
17 | `${process.env.API_CONNECTIONS_URL}/users/${req.query.userId}/follow`,
18 | {
19 | method: 'DELETE',
20 | headers: {
21 | Authorization: `Bearer ${accessToken}`,
22 | },
23 | }
24 | );
25 |
26 | res.status(200).json({ success: 'true' });
27 | } catch (error) {
28 | console.log(error);
29 | res.status(200).json({ success: 'false' });
30 | }
31 | };
32 |
33 | export default withAuthUserTokenAPI(handler);
34 | // export default handler;
35 |
--------------------------------------------------------------------------------
/src/pages/api/profile/update.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .patch(`${process.env.API_PROFILE_URL}/user/profile`, req.body, {
12 | headers: {
13 | Authorization: `Bearer ${accessToken}`,
14 | },
15 | })
16 | .then((response) => {
17 | res.status(response.status).json({ success: response.statusText });
18 | })
19 | .catch((error) => {
20 | console.log(error.status);
21 | console.log(error);
22 |
23 | res.status(error.response.status).json(error.response.data);
24 | });
25 | };
26 |
27 | export default withAuthUserTokenAPI(handler);
28 | // export default handler;
29 |
--------------------------------------------------------------------------------
/src/pages/api/profile/user.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser?.getIdToken();
9 | const requestURL = `${
10 | process.env.API_PROFILE_URL
11 | }/profile/user/${encodeURIComponent(req.query.userId)}`;
12 |
13 | let headers = '';
14 | if (accessToken) {
15 | headers = {
16 | headers: {
17 | Authorization: `Bearer ${accessToken}`,
18 | },
19 | };
20 | }
21 |
22 | return axios
23 | .get(requestURL, headers)
24 | .then((response) => {
25 | res.status(response.status).json(response.data);
26 | })
27 | .catch((error) => {
28 | res.status(error.response.status).json(error.response.data);
29 | });
30 | };
31 |
32 | export default withAuthUserTokenAPI(handler, true);
33 |
--------------------------------------------------------------------------------
/src/pages/api/profile/verify_connection.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../api/auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 | import axios from 'axios';
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 | try {
10 | const response = await axios.get(
11 | `${process.env.API_CONNECTIONS_URL}/users/${req.query.userId}/verify_connection/?connectedto=${req.query.connectedTo}`,
12 | {
13 | headers: {
14 | Authorization: `Bearer ${accessToken}`,
15 | },
16 | }
17 | );
18 |
19 | res
20 | .status(200)
21 | .json({ success: response.data.status, message: response.data.message });
22 | } catch (error) {
23 | res
24 | .status(200)
25 | .json({ success: 'false', message: 'Something has gone wrong' });
26 | }
27 | };
28 |
29 | export default withAuthUserTokenAPI(handler);
30 | // export default handler;
31 |
--------------------------------------------------------------------------------
/src/pages/api/profile/wallet/get.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .get(`${process.env.API_TRANSACTIONS_URL}/wallet`, {
12 | headers: {
13 | Authorization: `Bearer ${accessToken}`,
14 | },
15 | })
16 | .then((response) => {
17 | res.status(response.status).json(response.data);
18 | })
19 | .catch((error) => {
20 | res.status(error.response.status).json(error.response.data);
21 | });
22 | };
23 |
24 | export default withAuthUserTokenAPI(handler);
25 | // export default handler;
26 |
--------------------------------------------------------------------------------
/src/pages/api/profile/wallet/gift.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .post(`${process.env.API_TRANSACTIONS_URL}/wallet/gift`, req.body, {
12 | headers: {
13 | Authorization: `Bearer ${accessToken}`,
14 | },
15 | })
16 | .then((response) => {
17 | res.status(response.status).json({ success: response.statusText });
18 | })
19 | .catch((error) => {
20 | console.log(error);
21 | res.status(error.response.status).json(error.response.data);
22 | });
23 | };
24 |
25 | export default withAuthUserTokenAPI(handler);
26 | // export default handler;
27 |
--------------------------------------------------------------------------------
/src/pages/api/profile/wallet/redeem.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 | return axios
10 | .post(
11 | `${process.env.API_TRANSACTIONS_URL}/wallet/redeem?promo=${req.body.promo}&userId=${req.body.userId}&amount=${req.body.amount}`,
12 | req.body,
13 | {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | }
18 | )
19 | .then((response) => {
20 | res.status(response.status).json({ success: response.statusText });
21 | })
22 | .catch((error) => {
23 | res.status(error.response.status).json(error.response.data);
24 | });
25 | };
26 |
27 | export default withAuthUserTokenAPI(handler);
28 | // export default handler;
29 |
--------------------------------------------------------------------------------
/src/pages/api/profile/wallet/transactions.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 | return axios
10 | .get(
11 | `${process.env.API_TRANSACTIONS_URL}/wallet/transactions?page=0&size=50`,
12 | {
13 | headers: {
14 | Authorization: `Bearer ${accessToken}`,
15 | },
16 | }
17 | )
18 | .then((response) => {
19 | res.status(response.status).json(response.data);
20 | })
21 | .catch((error) => {
22 | res.status(error.response.status).json(error.response.data);
23 | });
24 | };
25 |
26 | export default withAuthUserTokenAPI(handler);
27 | // export default handler;
28 |
--------------------------------------------------------------------------------
/src/pages/api/projects/get.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser?.getIdToken();
9 | let connectionUsersIds = '';
10 | if (req.query.connectionUsersIds) {
11 | connectionUsersIds = `&connectionUserIds=${req.query.connectionUsersIds}`;
12 | }
13 | const requestURL = `${process.env.API_SEARCH_URL}/search/showcase?page=${
14 | req.query.page
15 | }&size=${req.query.size}&projectType=${req.query.projectType || ''}&orderBy=${
16 | req.query.sort
17 | }${
18 | req.query?.tech && req.query?.tech !== undefined
19 | ? '&techStack=' + req.query.tech
20 | : ''
21 | }&userId=${req.query.userId}${connectionUsersIds}${
22 | req.query?.lookingForCollabs && req.query?.lookingForCollabs !== undefined
23 | ? '&lookingForCollabs=' + req.query.lookingForCollabs
24 | : ''
25 | }&${req.query.range !== undefined && `range=${req.query.range}`}`;
26 |
27 | let headers = '';
28 | if (accessToken) {
29 | headers = {
30 | headers: {
31 | Authorization: `Bearer ${accessToken}`,
32 | },
33 | };
34 | }
35 |
36 | return axios
37 | .get(requestURL, headers)
38 | .then((response) => {
39 | res.status(response.status).json(response.data.content);
40 | })
41 | .catch((error) => {
42 | res.status(error.response.status).json(error.response.data);
43 | });
44 | };
45 |
46 | export default withAuthUserTokenAPI(handler, true);
47 |
--------------------------------------------------------------------------------
/src/pages/api/projects/ideas.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 |
3 | const handler = async (req, res) => {
4 | return axios
5 | .get(
6 | `https://raw.githubusercontent.com/thefullstackgroup/greatest-developer-portfolio-ever/main/projects/data.json`
7 | )
8 | .then((response) => {
9 | res.status(response.status).json({ data: response.data });
10 | })
11 | .catch((error) => {
12 | res.status(error.response.status).json(error.response.data);
13 | });
14 | };
15 |
16 | export default handler;
17 |
--------------------------------------------------------------------------------
/src/pages/api/projects/project/add.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 | const handler = async (req, res, AuthUser) => {
6 | const accessToken = await AuthUser.getIdToken();
7 | const response = await fetch(`${process.env.API_PROJECTS_URL}/project`, {
8 | method: 'POST',
9 | body: JSON.stringify(req.body.projectData),
10 | headers: {
11 | Authorization: `Bearer ${accessToken}`,
12 | 'Content-Type': 'application/json',
13 | },
14 | });
15 | const result = await response.json();
16 | res.status(result?.error ? 500 : 200).json(result);
17 | };
18 |
19 | export default withAuthUserTokenAPI(handler);
20 | // export default handler;
21 |
--------------------------------------------------------------------------------
/src/pages/api/projects/project/contributors.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 | return axios
10 | .get(
11 | `${process.env.API_PROJECTS_URL}/project/${req.query.projectId}/contributors`,
12 | {
13 | headers: {
14 | Authorization: `Bearer ${accessToken}`,
15 | },
16 | }
17 | )
18 | .then((response) => {
19 | res.status(response.status).json({
20 | success: response.statusText,
21 | content: response.data,
22 | });
23 | })
24 | .catch((error) => {
25 | res
26 | .status(error.response.data.status)
27 | .json({ error: 'Something went wrong' });
28 | });
29 | };
30 |
31 | export default withAuthUserTokenAPI(handler);
32 | // export default handler;
33 |
--------------------------------------------------------------------------------
/src/pages/api/projects/project/delete.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 | const handler = async (req, res, AuthUser) => {
7 | const accessToken = await AuthUser.getIdToken();
8 | return axios
9 | .delete(`${process.env.API_PROJECTS_URL}/project/${req.body.projectId}`, {
10 | headers: {
11 | Authorization: `Bearer ${accessToken}`,
12 | },
13 | })
14 | .then((response) => {
15 | res.status(response.status).json({ success: response.statusText });
16 | })
17 | .catch((error) => {
18 | res.status(error.response.status).json(error.response.data);
19 | });
20 | };
21 |
22 | export default withAuthUserTokenAPI(handler);
23 | // export default handler;
24 |
--------------------------------------------------------------------------------
/src/pages/api/projects/project/edit.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 | const handler = async (req, res, AuthUser) => {
6 | const accessToken = await AuthUser.getIdToken();
7 | const response = await fetch(
8 | `${process.env.API_PROJECTS_URL}/project/${req.body.projectId}`,
9 | {
10 | method: 'PATCH',
11 | body: JSON.stringify(req.body.projectData),
12 | headers: {
13 | Authorization: `Bearer ${accessToken}`,
14 | 'Content-Type': 'application/json',
15 | },
16 | }
17 | );
18 | const result = await response;
19 |
20 | res.status(result.status).json('success');
21 | };
22 |
23 | export default withAuthUserTokenAPI(handler);
24 | // export default handler;
25 |
--------------------------------------------------------------------------------
/src/pages/api/projects/project/githubstats.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser?.getIdToken();
9 | const requestURL = `${process.env.API_PROJECTS_URL}/gitOps/${req.query.projectId}/stats`;
10 |
11 | let headers = '';
12 | if (accessToken) {
13 | headers = {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | };
18 | }
19 |
20 | return axios
21 | .get(requestURL, headers)
22 | .then((response) => {
23 | res.status(response.status).json({
24 | success: response.success,
25 | content: response.data,
26 | });
27 | })
28 | .catch((error) => {
29 | res.status(error.response.status).json({ error: 'Something went wrong' });
30 | });
31 | };
32 |
33 | export default withAuthUserTokenAPI(handler, true);
34 |
--------------------------------------------------------------------------------
/src/pages/api/projects/project/import.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 | const handler = async (req, res, AuthUser) => {
6 | const accessToken = await AuthUser.getIdToken();
7 |
8 | const response = await fetch(
9 | `${process.env.API_PROJECTS_URL}/gitOps/import/project?gitUri=${req.query.gitHubURL}`,
10 | {
11 | method: 'POST',
12 | body: '',
13 | headers: {
14 | Authorization: `Bearer ${accessToken}`,
15 | 'Content-Type': 'application/json',
16 | },
17 | }
18 | );
19 | const result = await response.json();
20 | res.status(result?.error ? 500 : 200).json(result);
21 | };
22 |
23 | export default withAuthUserTokenAPI(handler);
24 | // export default handler;
25 |
--------------------------------------------------------------------------------
/src/pages/api/projects/project/insights/getVotes.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser?.getIdToken();
9 | const requestURL = `${process.env.API_PROJECTS_URL}/project/${req.query.id}/likedList`;
10 |
11 | let headers = '';
12 | if (accessToken) {
13 | headers = {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | };
18 | }
19 |
20 | return axios
21 | .get(requestURL, headers)
22 | .then((response) => {
23 | res.status(response.status).json(response.data);
24 | })
25 | .catch((error) => {
26 | res.status(error.response.status).json(error.response.data);
27 | });
28 | };
29 |
30 | export default withAuthUserTokenAPI(handler, true);
31 | // export default handler;
32 |
--------------------------------------------------------------------------------
/src/pages/api/projects/project/like.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../../firebase/initFirebaseApp';
3 | import * as FormData from 'form-data';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | const response = await fetch(
11 | `${process.env.API_PROJECTS_URL}/project/${req.body.projectId}/like`,
12 | {
13 | method: 'PATCH',
14 | body: {},
15 | headers: {
16 | Authorization: `Bearer ${accessToken}`,
17 | },
18 | }
19 | );
20 |
21 | res.status(response.status).json(response.statusText);
22 | };
23 |
24 | export default withAuthUserTokenAPI(handler);
25 | // export default handler;
26 |
--------------------------------------------------------------------------------
/src/pages/api/projects/project/save.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 |
6 | const handler = async (req, res, AuthUser) => {
7 | const accessToken = await AuthUser.getIdToken();
8 |
9 | const response = await fetch(
10 | `${process.env.API_PROJECTS_URL}/saved/${req.body.projectId}`,
11 | {
12 | method: 'POST',
13 | body: {},
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | }
18 | );
19 |
20 | res.status(response.status).json(response.statusText);
21 | };
22 |
23 | export default withAuthUserTokenAPI(handler);
24 | // export default handler;
25 |
--------------------------------------------------------------------------------
/src/pages/api/projects/project/unlike.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 |
6 | const handler = async (req, res, AuthUser) => {
7 | const accessToken = await AuthUser.getIdToken();
8 |
9 | const response = await fetch(
10 | `${process.env.API_PROJECTS_URL}/project/${req.body.projectId}/like`,
11 | {
12 | method: 'DELETE',
13 | headers: {
14 | Authorization: `Bearer ${accessToken}`,
15 | },
16 | }
17 | );
18 |
19 | res.status(response.status).json(response.statusText);
20 | };
21 |
22 | export default withAuthUserTokenAPI(handler);
23 | // export default handler;
24 |
--------------------------------------------------------------------------------
/src/pages/api/projects/project/unsave.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 |
6 | const handler = async (req, res, AuthUser) => {
7 | const accessToken = await AuthUser.getIdToken();
8 |
9 | const response = await fetch(
10 | `${process.env.API_PROJECTS_URL}/saved/${req.body.projectId}`,
11 | {
12 | method: 'DELETE',
13 | headers: {
14 | Authorization: `Bearer ${accessToken}`,
15 | },
16 | }
17 | );
18 |
19 | res.status(response.status).json(response.statusText);
20 | };
21 |
22 | export default withAuthUserTokenAPI(handler);
23 | // export default handler;
24 |
--------------------------------------------------------------------------------
/src/pages/api/projects/saved/get.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .get(`${process.env.API_PROJECTS_URL}/saved?size=50`, {
12 | headers: {
13 | Authorization: `Bearer ${accessToken}`,
14 | },
15 | })
16 | .then((response) => {
17 | res.status(response.status).json({ projects: response.data });
18 | })
19 | .catch((error) => {
20 | res.status(error.response.status).json(error.response.data);
21 | });
22 | };
23 |
24 | export default withAuthUserTokenAPI(handler);
25 | // export default handler;
26 |
--------------------------------------------------------------------------------
/src/pages/api/projects/showcase.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 |
3 | const handler = async (req, res) => {
4 | return axios
5 | .get(
6 | `${process.env.API_SEARCH_URL}/search/showcase?page=${
7 | req.query.page
8 | }&size=${req.query.size}&projectType=${
9 | req.query.projectType || ''
10 | }&orderBy=${req.query.sort}${
11 | req.query?.tech && req.query?.tech !== undefined
12 | ? '&techStack=' + req.query.tech
13 | : ''
14 | }${
15 | req.query?.category && req.query?.category !== undefined
16 | ? '&techCategories=' + req.query.category
17 | : ''
18 | }&lookingForCollabs=${req.query.lookingForCollabs || false}`
19 | )
20 | .then((response) => {
21 | res.status(response.status).json(response.data.content);
22 | })
23 | .catch((error) => {
24 | res.status(error.response.status).json(error.response.data);
25 | });
26 | };
27 |
28 | export default handler;
29 |
--------------------------------------------------------------------------------
/src/pages/api/search/profiles/search.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .get(`${process.env.API_SEARCH_URL}/search/profiles?q=${req.query.term}`, {
12 | headers: {
13 | Authorization: `Bearer ${accessToken}`,
14 | },
15 | })
16 | .then((response) => {
17 | res.status(response.status).json(response.data.content);
18 | })
19 | .catch((error) => {
20 | res.status(error.response.status).json(error.response.data);
21 | });
22 | };
23 |
24 | export default withAuthUserTokenAPI(handler);
25 | // export default handler;
26 |
--------------------------------------------------------------------------------
/src/pages/api/search/projects.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser?.getIdToken();
9 | const requestURL = `${process.env.API_SEARCH_URL}/search/projects?page=${
10 | req.query.page
11 | }&size=${req.query.size}&projectType=${req.query.projectType || ''}&orderBy=${
12 | req.query.sort
13 | }&q=${req.query.term}&userId=${req.query.userId}&${
14 | req.query.range !== undefined && `range=${req.query.range}`
15 | }`;
16 |
17 | let headers = '';
18 | if (accessToken) {
19 | headers = {
20 | headers: {
21 | Authorization: `Bearer ${accessToken}`,
22 | },
23 | };
24 | }
25 |
26 | return axios
27 | .get(requestURL, headers)
28 | .then((response) => {
29 | res.status(response.status).json(response.data.content);
30 | })
31 | .catch((error) => {
32 | res.status(error.response.status).json(error.response.data);
33 | });
34 | };
35 |
36 | export default withAuthUserTokenAPI(handler, true);
37 |
--------------------------------------------------------------------------------
/src/pages/api/search/skills.js:
--------------------------------------------------------------------------------
1 | // pages/api/search/skills
2 | import { withAuthUserTokenAPI } from '../../api/auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 | let term = req.body;
10 |
11 | if (term.length > 1) {
12 | const response = await fetch(
13 | `${process.env.API_SEARCH_URL}/search/skills?q=${encodeURIComponent(
14 | term
15 | )}&offset=0&limit=10`,
16 | {
17 | method: 'GET',
18 | headers: {
19 | 'Content-Type': 'application/json',
20 | Authorization: `Bearer ${accessToken}`,
21 | },
22 | }
23 | );
24 |
25 | const data = await response.json();
26 | res.status(200).json(data);
27 | } else {
28 | res.status(200).json(null);
29 | }
30 | };
31 |
32 | export default withAuthUserTokenAPI(handler);
33 | // export default handler;
34 |
--------------------------------------------------------------------------------
/src/pages/api/skills/remove.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenAPI } from '../../api/auth/withAuthUserTokenAPI';
2 | import initAuth from '../../../firebase/initFirebaseApp';
3 |
4 | initAuth();
5 | const handler = async (req, res, AuthUser) => {
6 | const accessToken = await AuthUser.getIdToken();
7 | const response = await fetch(
8 | `${process.env.API_PROFILE_URL}/user/profile/skill?skillIds=${req.body}`,
9 | {
10 | method: 'DELETE',
11 | headers: {
12 | Authorization: `Bearer ${accessToken}`,
13 | },
14 | }
15 | );
16 |
17 | const result = await response;
18 |
19 | res.status(result.status).json(result);
20 | };
21 |
22 | export default withAuthUserTokenAPI(handler);
23 | // export default handler;
24 |
--------------------------------------------------------------------------------
/src/pages/api/stats/profile/getStats.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .get(
12 | `${process.env.API_STATS_URL}/profile/stats?range=${
13 | req.query.range || ''
14 | }`,
15 | {
16 | headers: {
17 | Authorization: `Bearer ${accessToken}`,
18 | },
19 | }
20 | )
21 | .then((response) => {
22 | res.status(response.status).json(response.data);
23 | })
24 | .catch((error) => {
25 | res.status(error.response.status).json(error.response.data);
26 | });
27 | };
28 |
29 | export default withAuthUserTokenAPI(handler);
30 | // export default handler;
31 |
--------------------------------------------------------------------------------
/src/pages/api/teams/createTeam.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .post(`${process.env.API_TEAMS_URL}/teams`, req.body.data, {
12 | headers: {
13 | Authorization: `Bearer ${accessToken}`,
14 | },
15 | })
16 | .then((response) => {
17 | res.status(response.status).json(response.data);
18 | })
19 | .catch((error) => {
20 | console.log(error.response);
21 | res.status(error.response.status).json(error.response.data);
22 | });
23 | };
24 |
25 | export default withAuthUserTokenAPI(handler);
26 | // export default handler;
27 |
--------------------------------------------------------------------------------
/src/pages/api/teams/deleteTeam.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .delete(`${process.env.API_TEAMS_URL}/teams/${req.body.teamId}`, {
12 | headers: {
13 | Authorization: `Bearer ${accessToken}`,
14 | },
15 | })
16 | .then((response) => {
17 | res.status(response.status).json(response.data);
18 | })
19 | .catch((error) => {
20 | res.status(error.response.status).json(error.response.data);
21 | });
22 | };
23 |
24 | export default withAuthUserTokenAPI(handler);
25 | // export default handler;
26 |
--------------------------------------------------------------------------------
/src/pages/api/teams/getAllTeams.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser?.getIdToken();
9 | const requestURL = `${process.env.API_TEAMS_URL}/teams/all?page=${req.query.page}`;
10 |
11 | let headers = '';
12 | if (accessToken) {
13 | headers = {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | };
18 | }
19 |
20 | return axios
21 | .get(requestURL, headers)
22 | .then((response) => {
23 | res.status(response.status).json(response.data);
24 | })
25 | .catch((error) => {
26 | res.status(error.response.status).json(error.response.data);
27 | });
28 | };
29 |
30 | export default withAuthUserTokenAPI(handler, true);
31 |
--------------------------------------------------------------------------------
/src/pages/api/teams/getTeam.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser?.getIdToken();
9 | const requestURL = `${process.env.API_TEAMS_URL}/teams/${req.query.teamId}`;
10 |
11 | let headers = '';
12 | if (accessToken) {
13 | headers = {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | };
18 | }
19 |
20 | return axios
21 | .get(requestURL, headers)
22 | .then((response) => {
23 | res.status(response.status).json(response.data);
24 | })
25 | .catch((error) => {
26 | res.status(error.response.status).json(error.response.data);
27 | });
28 | };
29 |
30 | export default withAuthUserTokenAPI(handler, true);
31 |
--------------------------------------------------------------------------------
/src/pages/api/teams/getTeams.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .get(`${process.env.API_TEAMS_URL}/teams`, {
12 | headers: {
13 | Authorization: `Bearer ${accessToken}`,
14 | },
15 | })
16 | .then((response) => {
17 | res.status(response.status).json(response.data);
18 | })
19 | .catch((error) => {
20 | res.status(error.response.status).json(error.response.data);
21 | });
22 | };
23 |
24 | export default withAuthUserTokenAPI(handler);
25 | // export default handler;
26 |
--------------------------------------------------------------------------------
/src/pages/api/teams/getTeamsByUser.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser?.getIdToken();
9 | const requestURL = `${process.env.API_TEAMS_URL}/teams/members/${req.query.userId}`;
10 |
11 | let headers = '';
12 | if (accessToken) {
13 | headers = {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | };
18 | }
19 |
20 | return axios
21 | .get(requestURL, headers)
22 | .then((response) => {
23 | res.status(response.status).json(response.data);
24 | })
25 | .catch((error) => {
26 | res.status(error.response.status).json(error.response.data);
27 | });
28 | };
29 |
30 | export default withAuthUserTokenAPI(handler, true);
31 |
--------------------------------------------------------------------------------
/src/pages/api/teams/members/add.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .post(
12 | `${process.env.API_TEAMS_URL}/teams/${req.body.teamId}/members/${req.body.userId}`,
13 | {},
14 | {
15 | headers: {
16 | Authorization: `Bearer ${accessToken}`,
17 | },
18 | }
19 | )
20 | .then((response) => {
21 | res.status(response.status).json(response.data);
22 | })
23 | .catch((error) => {
24 | res.status(error.response.status).json(error.response.data);
25 | });
26 | };
27 |
28 | export default withAuthUserTokenAPI(handler);
29 | // export default handler;
30 |
--------------------------------------------------------------------------------
/src/pages/api/teams/members/delete.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .delete(
12 | `${process.env.API_TEAMS_URL}/teams/${req.body.teamId}/members/${req.body.userId}`,
13 | {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | }
18 | )
19 | .then((response) => {
20 | res.status(response.status).json(response.data);
21 | })
22 | .catch((error) => {
23 | res.status(error.response.status).json(error.response.data);
24 | });
25 | };
26 |
27 | export default withAuthUserTokenAPI(handler);
28 | // export default handler;
29 |
--------------------------------------------------------------------------------
/src/pages/api/teams/members/invite/accept.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .post(
12 | `${process.env.API_TEAMS_URL}/teams/${req.body.teamId}/members/${req.body.userId}/invite/accept`,
13 | {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | }
18 | )
19 | .then((response) => {
20 | res.status(response.status).json(response.data);
21 | })
22 | .catch((error) => {
23 | console.log(error.response);
24 | res.status(error.response.status).json(error.response.data);
25 | });
26 | };
27 |
28 | export default withAuthUserTokenAPI(handler);
29 | // export default handler;
30 |
--------------------------------------------------------------------------------
/src/pages/api/teams/members/invite/external.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .post(
12 | `${process.env.API_TEAMS_URL}/teams/${req.body.teamId}/members/invite/external`,
13 | { emails: req.body.emails },
14 | {
15 | headers: {
16 | Authorization: `Bearer ${accessToken}`,
17 | },
18 | }
19 | )
20 | .then((response) => {
21 | res.status(response.status).json(response.data);
22 | })
23 | .catch((error) => {
24 | res.status(error.response.status).json(error.response.data);
25 | });
26 | };
27 |
28 | export default withAuthUserTokenAPI(handler);
29 | // export default handler;
30 |
--------------------------------------------------------------------------------
/src/pages/api/teams/members/invite/refuse.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../../../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .post(
12 | `${process.env.API_TEAMS_URL}/teams/${req.body.teamId}/members/${req.body.userId}/invite/refuse`,
13 | {
14 | headers: {
15 | Authorization: `Bearer ${accessToken}`,
16 | },
17 | }
18 | )
19 | .then((response) => {
20 | res.status(response.status).json(response.data);
21 | })
22 | .catch((error) => {
23 | console.log(error.response);
24 | res.status(error.response.status).json(error.response.data);
25 | });
26 | };
27 |
28 | export default withAuthUserTokenAPI(handler);
29 | // export default handler;
30 |
--------------------------------------------------------------------------------
/src/pages/api/teams/updateTeam.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { withAuthUserTokenAPI } from '../auth/withAuthUserTokenAPI';
3 | import initAuth from '../../../firebase/initFirebaseApp';
4 |
5 | initAuth();
6 |
7 | const handler = async (req, res, AuthUser) => {
8 | const accessToken = await AuthUser.getIdToken();
9 |
10 | return axios
11 | .patch(
12 | `${process.env.API_TEAMS_URL}/teams/${req.body.teamId}`,
13 | req.body.data,
14 | {
15 | headers: {
16 | Authorization: `Bearer ${accessToken}`,
17 | },
18 | }
19 | )
20 | .then((response) => {
21 | res.status(response.status).json(response.data);
22 | })
23 | .catch((error) => {
24 | console.log(error.response);
25 | res.status(error.response.status).json(error.response.data);
26 | });
27 | };
28 |
29 | export default withAuthUserTokenAPI(handler);
30 | // export default handler;
31 |
--------------------------------------------------------------------------------
/src/pages/api/video/asset/[id].js:
--------------------------------------------------------------------------------
1 | import Mux from '@mux/mux-node';
2 | const { Video } = new Mux();
3 |
4 | export default async function assetHandler(req, res) {
5 | const { method } = req;
6 |
7 | switch (method) {
8 | case 'GET':
9 | try {
10 | const asset = await Video.Assets.get(req.query.id);
11 | res.json({
12 | asset: {
13 | id: asset.id,
14 | status: asset.status,
15 | errors: asset.errors,
16 | playback_id: asset.playback_ids[0].id,
17 | },
18 | });
19 | } catch (e) {
20 | console.error('Request error', e);
21 | res.status(500).json({ error: 'Error getting upload/asset' });
22 | }
23 | break;
24 | default:
25 | res.setHeader('Allow', ['GET']);
26 | res.status(405).end(`Method ${method} Not Allowed`);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/pages/api/video/upload.js:
--------------------------------------------------------------------------------
1 | import Mux from '@mux/mux-node';
2 | const { Video } = new Mux();
3 |
4 | export default async function uploadHandler(req, res) {
5 | const { method } = req;
6 |
7 | switch (method) {
8 | case 'POST':
9 | try {
10 | const upload = await Video.Uploads.create({
11 | new_asset_settings: { playback_policy: 'public' },
12 | cors_origin: '*',
13 | });
14 | res.json({
15 | id: upload.id,
16 | url: upload.url,
17 | });
18 | } catch (e) {
19 | console.error('Request error', e);
20 | res.status(500).json({ error: 'Error creating upload' });
21 | }
22 | break;
23 | default:
24 | res.setHeader('Allow', ['POST']);
25 | res.status(405).end(`Method ${method} Not Allowed`);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/pages/api/video/upload/[id].js:
--------------------------------------------------------------------------------
1 | import Mux from '@mux/mux-node';
2 | const { Video } = new Mux();
3 |
4 | export default async function uploadHandler(req, res) {
5 | const { method } = req;
6 |
7 | switch (method) {
8 | case 'GET':
9 | try {
10 | const upload = await Video.Uploads.get(req.query.id);
11 | res.json({
12 | upload: {
13 | status: upload.status,
14 | url: upload.url,
15 | asset_id: upload.asset_id,
16 | },
17 | });
18 | } catch (e) {
19 | console.error('Request error', e);
20 | res.status(500).json({ error: 'Error getting upload/asset' });
21 | }
22 | break;
23 | default:
24 | res.setHeader('Allow', ['GET']);
25 | res.status(405).end(`Method ${method} Not Allowed`);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/pages/auth/logout.js:
--------------------------------------------------------------------------------
1 | import {
2 | useAuthUser,
3 | withAuthUserTokenSSR,
4 | withAuthUser,
5 | AuthAction,
6 | } from 'next-firebase-auth';
7 |
8 | const Logout = () => {
9 | const AuthUser = useAuthUser();
10 | return (
11 |
12 |
Your email is {AuthUser.email ? AuthUser.email : 'unknown'}.
13 |
14 |
{
17 | AuthUser.signOut();
18 | }}
19 | >
20 | Sign out
21 |
22 |
23 | );
24 | };
25 |
26 | export default withAuthUser()(Logout);
27 |
28 | export const getServerSideProps = withAuthUserTokenSSR({
29 | whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
30 | })();
31 |
--------------------------------------------------------------------------------
/src/pages/auth/passwordreset.js:
--------------------------------------------------------------------------------
1 | import { React, useState } from 'react';
2 | import Meta from 'components/common/partials/Metadata';
3 | import Layout from 'components/common/layout/LayoutLoggedIn';
4 | import ResetPassword from 'components/modules/auth/ResetPassword';
5 | import ResetEmail from 'components/modules/auth/ResetEmail';
6 |
7 | const PasswordResetPage = () => {
8 | const [showPWReset, setShowPWReset] = useState(true);
9 | const [showEmailSend, setShowEmailSend] = useState(false);
10 |
11 | return (
12 | <>
13 |
18 |
19 |
20 |
21 |
22 |
23 | {showPWReset && (
24 |
28 | )}
29 | {showEmailSend && }
30 |
31 |
32 |
33 |
34 |
35 | >
36 | );
37 | };
38 |
39 | export default PasswordResetPage;
40 |
--------------------------------------------------------------------------------
/src/pages/chat/[id].js:
--------------------------------------------------------------------------------
1 | import {
2 | AuthAction,
3 | withAuthUser,
4 | withAuthUserTokenSSR,
5 | } from 'next-firebase-auth';
6 | import { getUserProfile } from 'pages/api/auth/userProfile';
7 | import { useRouter } from 'next/router';
8 | import Meta from 'components/common/partials/Metadata';
9 | import Layout from 'components/common/layout/Layout';
10 | import Main from 'components/modules/chat/Main';
11 |
12 | const Chat = ({ user }) => {
13 | const router = useRouter();
14 | const { id } = router.query;
15 |
16 | return (
17 | <>
18 |
23 |
24 | {user && (
25 |
26 |
27 |
28 | )}
29 | >
30 | );
31 | };
32 |
33 | export default withAuthUser()(Chat);
34 |
35 | export const getServerSideProps = withAuthUserTokenSSR({
36 | whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
37 | })(async ({ AuthUser, req, res }) => {
38 | const accessToken = await AuthUser.getIdToken();
39 | const userProfile = await getUserProfile(accessToken, null, req, res);
40 |
41 | if (userProfile?.redirect) {
42 | return {
43 | redirect: {
44 | destination: userProfile.redirect,
45 | permanent: false,
46 | },
47 | };
48 | }
49 | if (userProfile) {
50 | return {
51 | props: {
52 | user: userProfile,
53 | },
54 | };
55 | }
56 | return { props: {} };
57 | });
58 |
--------------------------------------------------------------------------------
/src/pages/chat/index.js:
--------------------------------------------------------------------------------
1 | import {
2 | AuthAction,
3 | withAuthUser,
4 | withAuthUserTokenSSR,
5 | } from 'next-firebase-auth';
6 | import { getUserProfile } from 'pages/api/auth/userProfile';
7 | import Meta from 'components/common/partials/Metadata';
8 | import Layout from 'components/common/layout/Layout';
9 | import Main from 'components/modules/chat/Main';
10 |
11 | const Chats = ({ user }) => {
12 | return (
13 | <>
14 |
19 |
20 | {user && (
21 |
22 |
23 |
24 | )}
25 | >
26 | );
27 | };
28 |
29 | export default withAuthUser()(Chats);
30 |
31 | export const getServerSideProps = withAuthUserTokenSSR({
32 | whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
33 | })(async ({ AuthUser, req, res }) => {
34 | const accessToken = await AuthUser.getIdToken();
35 | const userProfile = await getUserProfile(accessToken, null, req, res);
36 |
37 | if (userProfile?.redirect) {
38 | return {
39 | redirect: {
40 | destination: userProfile.redirect,
41 | permanent: false,
42 | },
43 | };
44 | }
45 | if (userProfile) {
46 | return {
47 | props: {
48 | user: userProfile,
49 | },
50 | };
51 | }
52 | return {
53 | redirect: {
54 | destination: '/login',
55 | permanent: false,
56 | },
57 | };
58 | });
59 |
--------------------------------------------------------------------------------
/src/pages/code-of-conduct.js:
--------------------------------------------------------------------------------
1 | import Meta from 'components/common/partials/Metadata';
2 | import Layout from 'components/common/layout/Layout';
3 | import Page from 'components/modules/static/policies/CodeOfConduct';
4 | import { withAuthUserTokenSSR } from 'next-firebase-auth';
5 | import { getUserProfile } from './api/auth/userProfile';
6 |
7 | const CodeOfConduct = ({ user }) => {
8 | return (
9 | <>
10 |
15 |
16 |
19 |
20 | >
21 | );
22 | };
23 |
24 | export default CodeOfConduct;
25 |
26 | export const getServerSideProps = withAuthUserTokenSSR()(
27 | async ({ AuthUser, req, res, query }) => {
28 | const accessToken = await AuthUser.getIdToken();
29 | const userProfile = await getUserProfile(accessToken, AuthUser, req, res);
30 |
31 | if (userProfile?.redirect) {
32 | return {
33 | redirect: {
34 | destination: userProfile.redirect,
35 | permanent: false,
36 | },
37 | };
38 | }
39 |
40 | return {
41 | props: { user: userProfile || null },
42 | };
43 | }
44 | );
45 |
--------------------------------------------------------------------------------
/src/pages/explore/index.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenSSR } from 'next-firebase-auth';
2 | import { getUserProfile } from 'pages/api/auth/userProfile';
3 | import Meta from 'components/common/partials/Metadata';
4 | import Layout from 'components/common/layout/Layout';
5 | import Main from 'components/modules/explore/Main';
6 |
7 | const Explore = ({ user }) => {
8 | return (
9 | <>
10 |
15 |
16 |
17 |
18 |
19 | >
20 | );
21 | };
22 |
23 | export default Explore;
24 |
25 | export const getServerSideProps = withAuthUserTokenSSR()(
26 | async ({ AuthUser, req, res, query }) => {
27 | const accessToken = await AuthUser.getIdToken();
28 |
29 | // Careful - this gets a profile BUT will add a profile if does not already exist.
30 | const userProfile = await getUserProfile(
31 | accessToken,
32 | AuthUser,
33 | req,
34 | res,
35 | false //TRUE only used on this page
36 | );
37 |
38 | if (userProfile?.redirect) {
39 | return {
40 | redirect: {
41 | destination: userProfile.redirect,
42 | permanent: true,
43 | },
44 | };
45 | }
46 |
47 | return {
48 | props: { user: userProfile || null },
49 | };
50 | }
51 | );
52 |
--------------------------------------------------------------------------------
/src/pages/hangout/[topic]/index.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenSSR } from 'next-firebase-auth';
2 | import { getUserProfile } from 'pages/api/auth/userProfile';
3 | import Meta from 'components/common/partials/Metadata';
4 | import Layout from 'components/common/layout/Layout';
5 | import Main from 'components/modules/hangout/Main';
6 |
7 | const HangoutTopic = ({ user, topic }) => {
8 | return (
9 | <>
10 |
15 |
16 |
17 |
18 |
19 | >
20 | );
21 | };
22 |
23 | export default HangoutTopic;
24 |
25 | export const getServerSideProps = withAuthUserTokenSSR()(
26 | async ({ AuthUser, req, res, query }) => {
27 | const accessToken = await AuthUser.getIdToken();
28 | const userProfile = await getUserProfile(accessToken, AuthUser, req, res);
29 |
30 | if (userProfile?.redirect) {
31 | return {
32 | redirect: {
33 | destination: userProfile.redirect,
34 | permanent: false,
35 | },
36 | };
37 | }
38 |
39 | return {
40 | props: { user: userProfile || null, topic: query.topic },
41 | };
42 | }
43 | );
44 |
--------------------------------------------------------------------------------
/src/pages/hangout/index.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenSSR } from 'next-firebase-auth';
2 | import { getUserProfile } from 'pages/api/auth/userProfile';
3 | import Meta from 'components/common/partials/Metadata';
4 | import Layout from 'components/common/layout/Layout';
5 | import Main from 'components/modules/hangout/Main';
6 |
7 | const Hangout = ({ user }) => {
8 | return (
9 | <>
10 |
15 |
16 |
17 |
18 |
19 | >
20 | );
21 | };
22 |
23 | export default Hangout;
24 |
25 | export const getServerSideProps = withAuthUserTokenSSR()(
26 | async ({ AuthUser, req, res, query }) => {
27 | const accessToken = await AuthUser.getIdToken();
28 | const userProfile = await getUserProfile(accessToken, AuthUser, req, res);
29 |
30 | if (userProfile?.redirect) {
31 | return {
32 | redirect: {
33 | destination: userProfile.redirect,
34 | permanent: false,
35 | },
36 | };
37 | }
38 |
39 | return {
40 | props: { user: userProfile || null },
41 | };
42 | }
43 | );
44 |
--------------------------------------------------------------------------------
/src/pages/invite/[code].js:
--------------------------------------------------------------------------------
1 | import nookies from 'nookies';
2 | import { AuthAction, withAuthUserTokenSSR } from 'next-firebase-auth';
3 |
4 | const ReferralCode = () => {
5 | return <>>;
6 | };
7 |
8 | export default ReferralCode;
9 |
10 | export const getServerSideProps = withAuthUserTokenSSR({
11 | whenUnauthed: AuthAction.RENDER,
12 | })(async ({ params, res }) => {
13 | const referralCode = params.code;
14 | nookies.set({ res }, 'referralCode', referralCode, {
15 | maxAge: 30 * 24 * 60 * 60,
16 | path: '/',
17 | });
18 |
19 | return {
20 | redirect: {
21 | destination: `${process.env.BASEURL}`,
22 | permanent: false,
23 | },
24 | };
25 | });
26 |
--------------------------------------------------------------------------------
/src/pages/login/forgotpassword.js:
--------------------------------------------------------------------------------
1 | import { withAuthUser, AuthAction } from 'next-firebase-auth';
2 | import Page from 'components/modules/auth/ForgotPassword';
3 | import Loader from 'components/common/elements/Loader';
4 | import Metadata from 'components/common/partials/Metadata';
5 | import Layout from 'components/common/layout/Layout';
6 |
7 | const Loading = () => {
8 | return (
9 |
10 |
11 |
12 | );
13 | };
14 |
15 | const Login = () => {
16 | return (
17 | <>
18 |
23 |
24 |
25 |
26 | >
27 | );
28 | };
29 |
30 | export default withAuthUser({
31 | whenAuthed: AuthAction.REDIRECT_TO_APP,
32 | whenUnauthedBeforeInit: AuthAction.SHOW_LOADER,
33 | whenAuthedBeforeRedirect: AuthAction.SHOW_LOADER,
34 | whenUnauthedAfterInit: AuthAction.RENDER,
35 | LoaderComponent: Loading,
36 | })(Login);
37 |
--------------------------------------------------------------------------------
/src/pages/post/index.js:
--------------------------------------------------------------------------------
1 | import {
2 | AuthAction,
3 | withAuthUser,
4 | withAuthUserTokenSSR,
5 | } from 'next-firebase-auth';
6 | import { getUserProfile } from 'pages/api/auth/userProfile';
7 | import Meta from 'components/common/partials/Metadata';
8 | import Main from 'components/modules/create/Main';
9 |
10 | const CreatePost = ({ user }) => {
11 | return (
12 |
13 |
18 |
19 |
20 | );
21 | };
22 |
23 | export default withAuthUser()(CreatePost);
24 |
25 | export const getServerSideProps = withAuthUserTokenSSR({
26 | whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
27 | })(async ({ AuthUser, req, res, query }) => {
28 | const accessToken = await AuthUser.getIdToken();
29 | const userProfile = await getUserProfile(accessToken, null, req, res);
30 |
31 | if (userProfile?.redirect) {
32 | return {
33 | redirect: {
34 | destination: userProfile.redirect,
35 | permanent: false,
36 | },
37 | };
38 | }
39 |
40 | return {
41 | props: {
42 | user: userProfile,
43 | },
44 | };
45 | });
46 |
--------------------------------------------------------------------------------
/src/pages/privacy-policy.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenSSR } from 'next-firebase-auth';
2 | import { getUserProfile } from './api/auth/userProfile';
3 | import Meta from 'components/common/partials/Metadata';
4 | import Layout from 'components/common/layout/Layout';
5 | import Page from 'components/modules/static/policies/PrivacyPolicy';
6 |
7 | const PrivacyPolicy = ({ user }) => {
8 | return (
9 | <>
10 |
15 |
16 |
19 |
20 | >
21 | );
22 | };
23 |
24 | export default PrivacyPolicy;
25 |
26 | export const getServerSideProps = withAuthUserTokenSSR()(
27 | async ({ AuthUser, req, res }) => {
28 | const accessToken = await AuthUser.getIdToken();
29 | const userProfile = await getUserProfile(accessToken, AuthUser, req, res);
30 |
31 | if (userProfile?.redirect) {
32 | return {
33 | redirect: {
34 | destination: userProfile.redirect,
35 | permanent: false,
36 | },
37 | };
38 | }
39 |
40 | return {
41 | props: { user: userProfile || null },
42 | };
43 | }
44 | );
45 |
--------------------------------------------------------------------------------
/src/pages/privacy.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenSSR } from 'next-firebase-auth';
2 | import { getUserProfile } from './api/auth/userProfile';
3 | import Meta from 'components/common/partials/Metadata';
4 | import Layout from 'components/common/layout/Layout';
5 | import Page from 'components/modules/static/policies/PrivacyPolicy';
6 |
7 | const Privacy = ({ user }) => {
8 | return (
9 | <>
10 |
15 |
16 |
19 |
20 | >
21 | );
22 | };
23 |
24 | export default Privacy;
25 |
26 | export const getServerSideProps = withAuthUserTokenSSR()(
27 | async ({ AuthUser, req, res }) => {
28 | const accessToken = await AuthUser.getIdToken();
29 | const userProfile = await getUserProfile(accessToken, AuthUser, req, res);
30 |
31 | if (userProfile?.redirect) {
32 | return {
33 | redirect: {
34 | destination: userProfile.redirect,
35 | permanent: false,
36 | },
37 | };
38 | }
39 |
40 | return {
41 | props: { user: userProfile || null },
42 | };
43 | }
44 | );
45 |
--------------------------------------------------------------------------------
/src/pages/signup/index.js:
--------------------------------------------------------------------------------
1 | import { withAuthUser, AuthAction } from 'next-firebase-auth';
2 | import 'firebase/firestore';
3 | import 'firebase/auth';
4 | import Loader from 'components/common/elements/Loader';
5 | import Layout from 'components/common/layout/Layout';
6 | import Main from 'components/modules/signup/Main';
7 | import Metadata from 'components/common/partials/Metadata';
8 |
9 | const Loading = () => {
10 | return (
11 |
12 |
13 |
14 | );
15 | };
16 |
17 | const SignUp = () => {
18 | return (
19 | <>
20 |
25 |
26 |
27 |
28 | >
29 | );
30 | };
31 |
32 | // export default SignUp;
33 |
34 | export default withAuthUser({
35 | whenAuthed: AuthAction.REDIRECT_TO_APP,
36 | whenUnauthedBeforeInit: AuthAction.SHOW_LOADER,
37 | whenAuthedBeforeRedirect: AuthAction.SHOW_LOADER,
38 | whenUnauthedAfterInit: AuthAction.RENDER,
39 | LoaderComponent: Loading,
40 | })(SignUp);
41 |
--------------------------------------------------------------------------------
/src/pages/teams/[teamId]/index.js:
--------------------------------------------------------------------------------
1 | import { withAuthUser, withAuthUserTokenSSR } from 'next-firebase-auth';
2 | import { getUserProfile } from 'pages/api/auth/userProfile';
3 | import Meta from 'components/common/partials/Metadata';
4 | import Layout from 'components/common/layout/Layout';
5 | import Profile from 'components/modules/teams/TeamProfile';
6 |
7 | const TeamProfile = ({ user, teamId }) => {
8 | return (
9 | <>
10 |
15 |
16 |
17 |
18 | >
19 | );
20 | };
21 |
22 | export default TeamProfile;
23 |
24 | export const getServerSideProps = withAuthUserTokenSSR()(
25 | async ({ AuthUser, req, res, params }) => {
26 | const accessToken = await AuthUser.getIdToken();
27 | const userProfile = await getUserProfile(accessToken, null, req, res);
28 |
29 | if (userProfile?.redirect) {
30 | return {
31 | redirect: {
32 | destination: userProfile.redirect,
33 | permanent: false,
34 | },
35 | };
36 | }
37 |
38 | return {
39 | props: {
40 | user: userProfile || null,
41 | teamId: params.teamId,
42 | },
43 | };
44 | }
45 | );
46 |
--------------------------------------------------------------------------------
/src/pages/teams/[teamId]/jobs/[jobId].js:
--------------------------------------------------------------------------------
1 | import { withAuthUser, withAuthUserTokenSSR } from 'next-firebase-auth';
2 | import { getUserProfile } from 'pages/api/auth/userProfile';
3 | import Meta from 'components/common/partials/Metadata';
4 | import Layout from 'components/common/layout/LayoutLoggedIn';
5 | import JobDetails from 'components/modules/teams/JobDetails';
6 |
7 | const Job = ({ userTFS, teamId, jobId }) => {
8 | return (
9 | <>
10 |
15 |
16 |
17 |
18 | >
19 | );
20 | };
21 |
22 | export default withAuthUser()(Job);
23 |
24 | export const getServerSideProps = withAuthUserTokenSSR()(
25 | async ({ AuthUser, req, res, params }) => {
26 | const accessToken = await AuthUser.getIdToken();
27 | const userProfile = await getUserProfile(accessToken, null, req, res);
28 |
29 | if (userProfile?.redirect) {
30 | return {
31 | redirect: {
32 | destination: userProfile.redirect,
33 | permanent: false,
34 | },
35 | };
36 | }
37 |
38 | if (userProfile) {
39 | return {
40 | props: {
41 | userTFS: userProfile,
42 | teamId: params.teamId,
43 | jobId: params.jobId,
44 | },
45 | };
46 | }
47 | return { props: {} };
48 | }
49 | );
50 |
--------------------------------------------------------------------------------
/src/pages/teams/index.js:
--------------------------------------------------------------------------------
1 | import { withAuthUserTokenSSR } from 'next-firebase-auth';
2 | import { getUserProfile } from 'pages/api/auth/userProfile';
3 | import Meta from 'components/common/partials/Metadata';
4 | import Layout from 'components/common/layout/Layout';
5 | import Main from 'components/modules/teams/Main';
6 |
7 | const Teams = ({ user }) => {
8 | return (
9 | <>
10 |
15 |
16 |
17 |
18 |
19 | >
20 | );
21 | };
22 |
23 | export default Teams;
24 |
25 | export const getServerSideProps = withAuthUserTokenSSR()(
26 | async ({ AuthUser, req, res, query }) => {
27 | const accessToken = await AuthUser.getIdToken();
28 | const userProfile = await getUserProfile(accessToken, AuthUser, req, res);
29 |
30 | if (userProfile?.redirect) {
31 | return {
32 | redirect: {
33 | destination: userProfile.redirect,
34 | permanent: false,
35 | },
36 | };
37 | }
38 |
39 | return {
40 | props: { user: userProfile || null },
41 | };
42 | }
43 | );
44 |
--------------------------------------------------------------------------------
/src/pages/u/[userId].js:
--------------------------------------------------------------------------------
1 | const UserProfile = () => {
2 | return <>>;
3 | };
4 |
5 | export default UserProfile;
6 |
7 | export async function getServerSideProps({ res, req, query }) {
8 | res.writeHead(301, {
9 | Location: `${process.env.BASEURL}/${encodeURIComponent(query.userId)}`,
10 | });
11 | res.end();
12 |
13 | return {};
14 | }
15 |
--------------------------------------------------------------------------------
/src/utils/fetcher.js:
--------------------------------------------------------------------------------
1 | const fetcher = (url) => fetch(url).then((res) => res.json());
2 |
3 | export default fetcher;
4 |
--------------------------------------------------------------------------------
/src/utils/mail/sendMail.js:
--------------------------------------------------------------------------------
1 | import fetch from 'node-fetch';
2 |
3 | const sendMail = async (name, subject, client_message, recepient_email) => {
4 | const sgResponse = await fetch('https://api.sendgrid.com/v3/mail/send', {
5 | method: 'POST',
6 | headers: {
7 | 'Content-Type': 'application/json',
8 | Authorization: `Bearer ${process.env.SENDGRID_API_KEY}`,
9 | },
10 | body: JSON.stringify({
11 | personalizations: [
12 | {
13 | to: [
14 | {
15 | email: recepient_email,
16 | },
17 | ],
18 | subject: subject,
19 | },
20 | ],
21 | from: {
22 | email: 'no-reply@em5863.thefullstack.network',
23 | name: 'The Full Stack',
24 | },
25 | content: [
26 | {
27 | type: 'text/html',
28 | value: `${client_message}
`,
29 | },
30 | ],
31 | }),
32 | });
33 | return sgResponse;
34 | };
35 |
36 | export { sendMail };
37 |
--------------------------------------------------------------------------------
/src/utils/signup/signUpSteps.js:
--------------------------------------------------------------------------------
1 | const SignUpSteps = {
2 | SIGNUP_INIT: {
3 | param: 'SIGNUP_INIT',
4 | nextRoute: '/account/signup/step1',
5 | },
6 | SIGNUP_ABOUT_USER_COMPLETED: {
7 | param: 'SIGNUP_ABOUT_USER_COMPLETED',
8 | nextRoute: '/account/signup/step2',
9 | },
10 | SIGNUP_GOALS_COMPLETED: {
11 | param: 'SIGNUP_GOALS_COMPLETED',
12 | nextRoute: '/account/signup/step3',
13 | },
14 | SIGNUP_INTERESTS_COMPLETED: {
15 | param: 'SIGNUP_INTERESTS_COMPLETED',
16 | nextRoute: '/account/signup/step4',
17 | },
18 | SIGNUP_SKILLS_COMPLETED: {
19 | param: 'SIGNUP_SKILLS_COMPLETED',
20 | nextRoute: '/account/signup/step5',
21 | },
22 | SIGNUP_INTRO_COMPLETED: {
23 | param: 'SIGNUP_INTRO_COMPLETED',
24 | nextRoute: '/account/signup/step1',
25 | },
26 | };
27 |
28 | const getNextStepRoute = (CURRENT_STEP = SignUpSteps.SIGNUP_INIT.param) => {
29 | for (const [key, value] of Object.entries(SignUpSteps)) {
30 | if (key === CURRENT_STEP) {
31 | return SignUpSteps[key].nextRoute;
32 | }
33 | }
34 | return SignUpSteps.SIGNUP_INIT.nextRoute;
35 | };
36 |
37 | export { SignUpSteps, getNextStepRoute };
38 |
--------------------------------------------------------------------------------
/src/utils/slack/sendMessageSlack.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 |
3 | const sendSlackMessage = (message) => {
4 | axios.post(`${process.env.BASEURL}/api/notifications/slack/postMessage`, {
5 | message: message,
6 | });
7 | return true;
8 | };
9 |
10 | export { sendSlackMessage };
11 |
--------------------------------------------------------------------------------
/src/utils/stripe/getStripe.js:
--------------------------------------------------------------------------------
1 | import { loadStripe } from '@stripe/stripe-js';
2 |
3 | let stripePromise = null;
4 |
5 | const getStripe = () => {
6 | if (!stripePromise) {
7 | stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY);
8 | }
9 | return stripePromise;
10 | };
11 |
12 | export default getStripe;
13 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": "./src/",
4 | "allowJs": true,
5 | "noEmit": true,
6 | "target": "es5",
7 | "lib": ["dom", "dom.iterable", "esnext"],
8 | "skipLibCheck": true,
9 | "strict": false,
10 | "forceConsistentCasingInFileNames": false,
11 | "esModuleInterop": true,
12 | "module": "esnext",
13 | "moduleResolution": "node",
14 | "resolveJsonModule": true,
15 | "isolatedModules": true,
16 | "jsx": "preserve",
17 | "incremental": true
18 | },
19 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"],
20 | "exclude": ["node_modules"]
21 | }
22 |
--------------------------------------------------------------------------------