Câu hỏi


.github
public
src
assets
fonts
images
lottie
components
ToggleSwitch
ToggleSwitch.js
ToggleSwitch.scss
achievementCard
AchievementCard.js
AchievementCard.scss
blogCard
BlogCard.js
BlogCard.scss
button
Button.js
Button.scss
displayLottie
DisplayLottie.js
educationCard
EducationCard.js
EducationCard.scss
experienceCard
ExperienceCard.js
ExperienceCard.scss
footer
Footer.js
Footer.scss
githubProfileCard
GithubProfileCard.js
GithubProfileCard.scss
githubRepoCard
GithubRepoCard.js
GithubRepoCard.scss
header
Header.js
Header.scss
socialMedia
SocialMedia.js
SocialMedia.scss
softwareSkills
SoftwareSkill.js
SoftwareSkill.scss
talkCard
TalkCard.js
TalkCard.scss
containers
StartupProjects
achievement
blogs
contact
education
greeting
loading
podcast
profile
projects
skillProgress
skills
splashScreen
talks
topbutton
twitter-embed
workExperience
Main.js
Main.scss
contexts
StyleContext.js
hooks
App.js
App.scss
App.test.js
_globalColor.scss
index.css
index.js
logo.svg
portfolio.js
serviceWorker.js
setupTests.js
utils.js
.all-contributorsrc
.gitattributes
.gitignore
.pre-commit-config.yaml
.prettierignore
.prettierrc
Dockerfile
LICENSE
README.md
env.example
fetch.js
package-lock.json
package.jsonOwner avatar
developerFolio
Public
saadpasta/developerFolio
Go to file
t
Add file
Folders and files
Name
Latest commit
namanagrwl
namanagrwl
Updated Dockerfile (#672)
fc69340
·
last month
History
.github
fix(ci): update workflow to use node 18.x (#646)
last year
public
chore(): update font awesome cdn from 5.13 to 5.15 (#422)
3 years ago
src
Added target='_blank' and rel='noreferrer' to external link in Footer… (
last month
.all-contributorsrc
docs: add KazAttarwala as a contributor for code (#605)
last year
.gitattributes
Fix font in the logo-name (#401)
3 years ago
.gitignore
Fix fallback for medium blogs (#446)
3 years ago
.pre-commit-config.yaml
[pre-commit.ci] pre-commit autoupdate (#478)
last year
.prettierignore
feat: add prettier and a check for it using gh actions (#259)
3 years ago
.prettierrc
feat: add prettier and a check for it using gh actions (#259)
3 years ago
Dockerfile
Updated Dockerfile (#672)
last month
LICENSE
Switch to GPLv3
4 years ago
README.md
fix: resume path in Readme (#734)
last month
env.example
Added medium blogs fetch feature for blogs section (#445)
3 years ago
fetch.js
Feature/GitHub jobs (#519)
2 years ago
package-lock.json
fix(ci): fix build failing due to old (and deprecated) packages (#630)
last year
package.json
fix(ci): fix build failing due to old (and deprecated) packages (#630)
last year
Repository files navigation
README
GPL-3.0 license
Software Developer Folio ⚡️ GitHub GitHub stars All Contributors
A clean, beautiful and responsive portfolio template for Developers!


Just change src/portfolio.js to get your personal portfolio. Customize portfolio theme by using your own color scheme globally in the src/_globalColor.scss file. Feel free to use it as-is or personalize it as much as you want.

If you'd like to contribute and make this much better for other users, have a look at Issues.

Created something awesome for your fork of the portfolio and want to share it? Feel free to open a pull request.

Table of Contents
Sections
Getting Started
How to Use
Linking portfolio to GitHub
Linking blogs section to Medium
Change and Customize
Deployment
Technologies Used
Illustrations
For the Future
Contributors
Portfolio Sections
✔️ Summary and About me
✔️ Skills
✔️ Education
✔️ Work Experience
✔️ Open Source Projects Connected with GitHub
✔️ Big Projects
✔️ Achievements And Certifications 🏆
✔️ Blogs
✔️ Talks
✔️ Podcast
✔️ Contact me
✔️ Twitter Timeline
✔️ GitHub Profile

To view a live example, click here.

Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

You'll need Git and Node.js (which comes with npm) installed on your computer or use Docker.

[email protected] or higher
[email protected] or higher
[email protected] or higher
Docker Commands
1) BUILD IMAGE : docker build -t developerfolio:latest .
2) RUN IMAGE: docker run -t -p 3000:3000 developerfolio:latest
How To Use
From your command line, clone and run developerFolio:

# Clone this repository
git clone https://github.com/saadpasta/developerFolio.git

# Go into the repository
cd developerFolio

# Setup default environment variables

# For Linux
cp env.example .env
# For Windows
copy env.example .env

# Install dependencies
npm install

# Start a local dev server
npm start
Linking Portfolio to GitHub
Generate a classic GitHub personal access token following these instructions (make sure you don't select any scope just generate a simple token). If you are using GitHub Actions to deploy your portfolio you can skip this section.

Create a file called .env in the root directory of your project (if not done already in section: How To Use)
Note: Configuring environment variables before deploying your portfolio is highly recommended as some components depend on API data.

- DeveloperFolio
- node_modules
- public
- src
- .env <-- create it here
- env.example <-- this is the base file
- .gitignore
- package-lock.json
- package.json
Inside the .env file, add key REACT_APP_GITHUB_TOKEN and assign your GitHub token like this, also add your username as GITHUB_USERNAME
// .env
REACT_APP_GITHUB_TOKEN = "YOUR GITHUB TOKEN HERE"
GITHUB_USERNAME = "YOUR GITHUB USERNAME"
USE_GITHUB_DATA = "true"
Set showGithubProfile to true or false to show Contact Profile using GitHub, defaults to false.

Warning: Treat your tokens like passwords and keep them secret. When working with the API, use tokens as environment variables instead of hardcoding them into your programs.

Note: Open Source Projects section only show pinned items of your GitHub. If you are seeing something as shown below, follow these instructions.

ERROR

If the above solution still doesn't work, visit the wiki page.

Linking blogs section to Medium
Optionally, you can link the blogs section to your medium user account:

Inside the .env file, add key MEDIUM_USERNAME and assign your Medium username
// .env
MEDIUM_USERNAME = "YOUR MEDIUM USERNAME"
For Github Action, change the environment variable MEDIUM_USERNAME in .github/workflows/deploy.yml
Set displayMediumBlogs to true or false in portofolio.js to display fetched Medium blogs, defaults to true.

Change and customize every section according to your need.
Personalize page content in /src/portfolio.js & modify it as per your need. You will also need to modify index.html to change the title and metadata to provide accurate SEO for your personal portfolio.
/* Change this file to get your Personal Porfolio */

const greeting = {
/* Your Summary And Greeting Section */
title: "Hi all I'm Saad",
subTitle: emoji("A passionate Full Stack Software Developer 🚀"),
resumeLink: "https://drive.google.com/file/d/1ofFdKF_mqscH8WvXkSObnVvC9kK7Ldlu/view?usp=sharing"
};

const socialMediaLinks = {
/* Your Social Media Link */
github: "https://github.com/saadpasta",
linkedin: "https://www.linkedin.com/in/saadpasta/",
gmail: "[email protected]",
gitlab: "https://gitlab.com/saadpasta",
facebook: "https://www.facebook.com/saad.pasta7"
};


const skillsSection = { .... }

const techStack = { .... }

const workExperience = { .... }

const openSource = { .... }

const bigProjects = { .... }

const achievementSection = { .... }

const blogSection = { .... }

const contactInfo = { .... }

const twitterDetails = { ... }
Resume upload
To upload your own resume, simply upload a pdf to src/containers/greeting/resume and rename the pdf to resume.pdf.

Using Emojis
For adding emoji 😃 into the texts in Portfolio.js, use the emoji() function and pass the text you need as an argument. This would help in keeping emojis compatible across different browsers and platforms.

Customize Lottie Animations
You can choose a Lottie and download it in json format from sites like this. In src/assets/lottie, replace the Lottie json file you want to alter with the same file name. If you want to change the Lottie options, go to src/components/displayLottie/DisplayLottie.js and change the defaultOptions object, you can refer lottie-react docs for more info on the defaultOptions object.

Adding Twitter Time line to your Page
Insert your Twitter username in portfolio.js to show your recent activity on your page.

const twitterDetails = {
userName : "Your Twitter Username"
};
Note: Don't use @ symbol when adding username.

Deployment
When you are done with the setup, you should host your website online. We highly recommend to read through the Deploying on GitHub Pages docs for React.

Configuring GitHub Actions (Recommended)
First you should enable, GitHub Actions for the repository you use.

The Profile and the Repository information from GitHub is only created at the time of deploy and the site needs to be redeployed if those information needs to be updated. So, a configurable CRON Job is setup which deploys your site every week, so that once you update your profile on GitHub it is shown on your portfolio. You can also trigger it manually using workflow_dispatch event, see this guide on how to do that.

When you are done with the configuration, we highly recommend to read through the GitHub Actions Configuring a workflow docs.
Deploying to GitHub Pages
This section guides you to deploy your portfolio on GitHub pages.

Navigate to package.json and enter your domain name instead of https://developerfolio.js.org/ in homepage variable. For example, if you want your site to be https://<your-username>.github.io/developerFolio, add the same to the homepage section of package.json.

In short you can also add /devloperFolio to package.json as both are exactly same. Upon doing so, you tell create-react-app to add the path assets accordingly.

Optionally, configure the domain. You can configure a custom domain with GitHub Pages by adding a CNAME file to the public/ folder.

Follow through the guide to setup GitHub pages from the official CRA docs here.

Deploying to Netlify
You could also host directly with Netlify by linking your own repository.

Deploy To Netlify

For more information, read hosting on Netlify.

Technologies Used
React
graphql
apollo-boost
react-twitter-embed
react-easy-emoji
react-headroom
color-thiefi want to make it dynamic so that user just enters the urls and usernames liek guithub linkedin medium etc and all data is extracted in abckedn and adjusted as per this templates and make this template cut0omized for each user

Suy nghĩ

Clarifying the request

Understanding the Request

The user is aiming to create a dynamic system where individual data inputs dynamically generate a customized portfolio website using "developerFolio". This involves automating the input and customization processes.

Enhancing automation

The goal is to automate the portfolio update by integrating APIs for GitHub, LinkedIn, and Medium, enabling dynamic data retrieval and user customization.

Formulating API strategies

I’m working through setting up a backend server to manage API requests as users input their usernames and URLs, ensuring continuous integration with GitHub, LinkedIn, and Medium through a seamless, personalized experience.

Pulling together data

I’m gathering user data from various APIs, like GitHub and LinkedIn, and adding it to the 'developerFolio' template using a templating engine or modifying React components.

Serving the portfolio

Delivering the customized portfolio to the user is the next step. This can be shared through a static HTML page download or via a server-hosted URL.

Addressing authentication and API limits

I need to manage API rate limits and authentication, potentially using OAuth flows or requiring users to provide API tokens.

Watching data privacy

I'm focusing on securing personal data, letting users know how their data is used and stored, and making sure all processes are compliant with best practices.

Taking a closer look

Deploying the backend on platforms like Heroku or AWS is crucial. The application should handle high traffic and be scalable.

Enhancing portfolio customization

Offering themes, colors, and specific sections while adding user accounts for updates can significantly enhance the user experience.

Trả lời

Certainly! You want to transform the static developerFolio template into a dynamic, user-customizable portfolio generator. This system would allow users to input their usernames and URLs (like GitHub, LinkedIn, Medium, etc.), automatically fetch their data, and generate a personalized portfolio based on the template. Below is a comprehensive guide on how to achieve this.


Overview

  1. Set Up a Backend Server
  2. Create a User Input Interface
  3. Fetch Data from External APIs
  4. Process and Store Data
  5. Customize the Template Dynamically
  6. Serve the Customized Portfolio
  7. Handle API Authentication and Rate Limits
  8. Ensure Data Privacy and Security
  9. Deploy the Application
  10. Optional Enhancements

1. Set Up a Backend Server

Since you need to fetch data dynamically based on user input, you'll require a backend server to handle API requests and data processing.

  • Technology Choices:
    • Node.js with Express.js: Popular and integrates well with React.
    • Python with Django or Flask: If you prefer Python.
    • Ruby with Rails: Another robust option.

Setup Example with Node.js and Express.js:

# Initialize a new Node.js project npm init -y # Install Express.js npm install express

Basic Server Structure (server.js):

const express = require('express'); const app = express(); const port = process.env.PORT || 5000; // Middleware to parse JSON bodies app.use(express.json()); app.listen(port, () => { console.log(`Server is running on port ${port}`); });

2. Create a User Input Interface

Develop a frontend form where users can input their usernames and URLs.

  • Fields to Include:
    • GitHub Username
    • LinkedIn URL
    • Medium Username
    • Twitter Username
    • Email
    • Any other platforms you wish to support

Implementation Steps:

  • Create a React component (UserForm.js) for the input form.
  • Form Handling: Use React state to manage form data.
  • Submit Data: On form submission, send the data to your backend server using fetch or axios.

Example Form Component:

import React, { useState } from 'react'; import axios from 'axios'; function UserForm() { const [formData, setFormData] = useState({ github: '', linkedin: '', medium: '', // Add other fields as necessary }); const handleChange = (e) => { setFormData({ ...formData, [e.target.name]: e.target.value }); }; const handleSubmit = async (e) => { e.preventDefault(); await axios.post('/api/userdata', formData); // Handle response and navigation }; return ( <form onSubmit={handleSubmit}> {/* Input fields */} </form> ); } export default UserForm;

3. Fetch Data from External APIs

In your backend, use the provided usernames and URLs to fetch data from external APIs.

GitHub API

  • Endpoint: https://api.github.com/users/{username}
  • Data: Profile info, repositories, contributions.

Example:

const fetch = require('node-fetch'); app.post('/api/userdata', async (req, res) => { const { github } = req.body; const githubResponse = await fetch(`https://api.github.com/users/${github}`); const githubData = await githubResponse.json(); // Continue processing });

LinkedIn API

  • Note: LinkedIn's API is restricted and requires OAuth 2.0 authentication and LinkedIn Developer approval.
  • Alternative: Ask users to input their professional summary manually or provide data via a CSV upload.

Medium API

  • Endpoint: Use RSS feed as Medium deprecated the public API.
  • RSS Feed: https://medium.com/feed/@{username}

Example:

const Parser = require('rss-parser'); const parser = new Parser(); app.post('/api/userdata', async (req, res) => { const { medium } = req.body; const feed = await parser.parseURL(`https://medium.com/feed/@${medium}`); // Extract articles const articles = feed.items.map((item) => ({ title: item.title, link: item.link, pubDate: item.pubDate, })); // Continue processing });

Other Platforms

  • Twitter: Use the Twitter API v2 with appropriate authentication.
  • StackOverflow: Use the StackExchange API.

4. Process and Store Data

Process the fetched data to fit the template's requirements.

  • Data Mapping: Convert API responses into the format expected by your React components.
  • Temporary Storage: Use in-memory storage like variables or use a database if you need persistence.

Example:

const userData = { githubProfile: githubData, mediumArticles: articles, // Add other data }; // Send the processed data back to the frontend res.json(userData);

5. Customize the Template Dynamically

Modify the developerFolio React components to accept dynamic data via props or context.

  • Use React Context or Props: Pass the fetched data down to components.
  • State Management: You can use Redux or the Context API for larger applications.

Example with Props:

// In your main component function Portfolio({ userData }) { return ( <div> <Header profile={userData.githubProfile} /> <Projects repos={userData.githubRepos} /> {/* Other components */} </div> ); }

Fetching Data on the Frontend:

import React, { useEffect, useState } from 'react'; import axios from 'axios'; function Portfolio() { const [userData, setUserData] = useState(null); useEffect(() => { // Fetch data from backend axios.get('/api/userdata').then((response) => { setUserData(response.data); }); }, []); if (!userData) return <Loading />; return ( <div> <Header profile={userData.githubProfile} /> {/* Other components */} </div> ); }

6. Serve the Customized Portfolio

Decide how you want to deliver the generated portfolio to the user.

  • Option 1: Static Download

    • Generate a static build (npm run build) and provide it as a downloadable package.
    • Pros: Users can host it themselves.
    • Cons: More complex to implement automated builds per user.
  • Option 2: Dynamic Hosting

    • Host the portfolios on your server under unique URLs (e.g., yourdomain.com/username).
    • Pros: Simplifies user experience.
    • Cons: Requires server resources and management.

Example for Dynamic Routes:

app.get('/portfolio/:username', (req, res) => { // Fetch user data based on username // Render the React app with user data });

7. Handle API Authentication and Rate Limits

Be mindful of API usage policies.

  • GitHub API:

    • Unauthenticated Rate Limit: 60 requests per hour.
    • Authenticated Rate Limit: 5,000 requests per hour.
    • Solution: Use a server-side token or ask users for a personal access token.
  • Medium RSS Feeds:

    • Generally no rate limits, but be considerate.
  • Twitter API:

    • Requires OAuth 2.0 Bearer Token.
    • Rate Limits: Varies per endpoint.
  • Strategies:

    • Caching: Store API responses temporarily.
    • Queueing: Implement request queues to manage high traffic.
    • User Tokens: For APIs that support it, ask users to provide their own tokens.

8. Ensure Data Privacy and Security

Protect user data and comply with regulations.

  • Data Handling:

    • Do not store sensitive data unnecessarily.
    • Use HTTPS for all network communication.
  • Privacy Policy:

    • Inform users about data usage.
    • Provide options to delete their data.
  • Security Measures:

    • Sanitize user inputs to prevent injections.
    • Secure your backend against common vulnerabilities.

9. Deploy the Application

Choose a hosting platform for your backend and frontend.

  • Options:
    • Heroku: Easy deployment for Node.js apps.
    • Vercel: Good for Next.js and supports serverless functions.
    • Netlify: Excellent for static sites and serverless functions.
    • AWS/GCP/Azure: For more control and scalability.

Deployment Steps:

  • Backend:

    • Push your server code to a repository.
    • Connect the repository to your hosting service.
    • Set environment variables (API keys, tokens).
  • Frontend:

    • Build the React app (npm run build).
    • Deploy the build folder to your hosting service.

10. Optional Enhancements

Make your portfolio generator more feature-rich.

User Accounts

  • Implement authentication so users can save and return to their portfolios.
  • Use JWT tokens or services like Auth0.

Custom Domains

  • Allow users to link custom domains to their portfolios.

Theme Customization

  • Let users choose color schemes, fonts, and layouts.
  • Implement a theme picker component.

Real-time Updates

  • Use WebSockets to update the portfolio as users fill in their information.

Analytics Dashboard

  • Provide users with analytics on their portfolio visits.

Considerations and Challenges

  • API Access Restrictions: Some platforms limit API access (e.g., LinkedIn).
  • Maintenance: Keep up with API changes to prevent breaks.
  • Scalability: Design your application to handle multiple users efficiently.
  • Legal: Ensure compliance with the terms of service of each API you use.

Conclusion

By integrating backend data fetching with dynamic React components, you can create a seamless experience where users simply input their information and receive a personalized portfolio. This approach combines the power of APIs with customizable templates to automate portfolio generation.


Next Steps

  • Start Building: Set up your development environment and begin coding.
  • Test Extensively: Ensure that all components work together smoothly.
  • Gather Feedback: If possible, have a few users test your application.
  • Iterate and Improve: Use feedback to enhance functionality and usability.

Need Further Assistance?

Feel free to ask if you have questions about specific implementation details, need code snippets, or require guidance on any of the steps outlined above. I'm here to help you bring your dynamic portfolio generator to life!

Chia sẻ Q&A này