• Stars
    star
    144
  • Rank 254,614 (Top 6 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 3 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This is my portfolio built with Next.js, Tailwind CSS, Sanity, Spotify API, Dev.to API, MDX, Google Analytics and Vercel.

Cover

Github stars Github Forks GitHub code size in bytes GitHub repo size

Tools Used

Run Locally

Clone the project:

git clone https://github.com/j471n/j471n.in.git

Go to the project directory:

cd j471n.in

Install dependencies

yarn
# or
npm install

Start the server:

yarn dev
# or
npm run dev

After that server should be running on localhost:3000

I am using yarn you can use pnpm or npm

Warning: You could run into errors if you don't populate the .env.local with the correct values

Setting up the Environment

Rename .env.example to .env.local and then you need to populate that with the respective values.

  • NEXT_PUBLIC_YOUR_SERVICE_ID: Go to the Admin Panel of emailjs.com. If you haven't already added a service then Click on the Add Service Button as shown in the image Then choose any method you want I am using Gmail

    • Then first click on the Connect Account and log in with your Gmail account that you want to use to get the emails from.
    • In the second step click on Create Service and then copy the Service ID and add this ID to NEXT_PUBLIC_YOUR_SERVICE_ID in .env.local
  • NEXT_PUBLIC_YOUR_TEMPLATE_ID: To get the Template ID visit the Email Templates section and click on Create New Template. And then you will see a window where you can edit your email template after you are satisfied with your template then click on the Save button in the top right corner. After that you will have your Template ID as shown in the image below:

  • NEXT_PUBLIC_YOUR_USER_ID: To get your User ID, Go to Account and then you will be able to see it:

  • NEXT_PUBLIC_BLOGS_API: I am using Dev.to API to fetch all the blog stats. You can get this API at the bottom of the Extensions section.

  • NEXT_PUBLIC_GA_MEASUREMENT_ID: You can follow this guide to get your Google Analytics ID and then you will be able to use Google Analytics in this project.

  • Spotify Integration: I have used Spotify API. So, you need three Environment Variable values-

    • SPOTIFY_CLIENT_ID
    • SPOTIFY_CLIENT_SECRET
    • SPOTIFY_REFRESH_TOKEN You need to follow this blog to get these variables' values.
  • Google Analytics Data API: I am using this API to get the analytics of this website so that I can show how many user visit this site in the last 7 days. In this you will need the value of the following properties:

    • GA_PROPERTY_ID
    • GA_CLIENT_EMAIL
    • GA_PRIVATE_KEY I have written a blog that shows how you can get these properties and guides to use them.
  • Supabase Integration: I am using Supabase with ISR to store all my projects and certificates for now. It provides an API that helps you to access the data. To access that data you need two things:

    • SUPABASE_URL: Database URL.
    • SUPABASE_KEY: It is safe to be used in a browser context.

    Steps-

    • To get these go to Supabase and log in with your account.

    • Click on New Project and fill all the fields.

    • Click on Create New Project.

    • Go to the Settings page in the Dashboard.

    • Click API in the sidebar.

    • Find your API URL and anon key on this page.

    • Now you can Create table and start using it.

      But before you use this there was one issue I had when I was using this it was returning the empty array ([]). It was because of project policies. By default, no-one has access to the data. To fix that you can do the following:

    • Go to Policies.

    • Select your Project.

    • Click on New Policy.

    • You will be presented with two options. You can choose either one. I chose the 1st option:

    • After that, you will have four options as shown in the following image. You can choose according to your need. I only need the read access so I went with 1st option.

    • Click on Use this template.

    • Click on Review.

    • Click on Save Policy

      After that, you will be able to access the data using @supabase/supabase-js. Install it and you just set up your project with Supabase.

  • REVALIDATE_SECRET: As I am using Supabase, It has a feature called webhooks which allow you to send real-time data from your database to another system whenever a table event occurs. So I am using it to revalidate my projects and certificates page. For that I am providing a custom secret value to verify that request is coming from authenticated source. Let's create webhook:

    • Go to webhooks page.

    • Click on Create a new hook

    • Enter the name of the function hook (example: update_projects)

    • Choose your table from the dropdown list

    • Select events which will trigger this function hook

    • Now Choose POST method and enter the revalidate URL (request will be sent to this URL)

    • Then add two HTTP Params secret and revalidateUrl

    • Now add this secret to your env.local and it will update the page when you made some changes to your supabase database.
    • pages/api/revalidate.ts is using revalidateUrl to update the page with new data.
  • GITHUB_TOKEN: Follow these steps to generate a GitHub token that I am using fetch my GitHub details:

    Step 1: Accessing GitHub Developer Settings

    • Log in to your GitHub account.
    • Click on your profile picture in the top-right corner of the page.
    • From the drop-down menu, select Settings.

    Step 2: Navigating to Developer Settings

    In the left sidebar, scroll down and click on Developer settings.

    Step 3: Creating a New Personal Access Token

    • In the Developer settings page, click on Personal access tokens and then Click on Tokens (Classic).

    • Next, click on the Generate new token button.

    • After selecting the necessary permissions, click on the Generate token button at the bottom of the page.

    • GitHub will generate a new token for you. Make sure to copy the token value.

    • Important: Treat this token like a password and keep it secure. Do not share it publicly or commit it to a version control repository.

  • EMAIL_VALIDATION_API: You can follow the following steps to get the API_KEY to validate the email address for the newsletter:

  • SANITY_PROJECT_ID:

    • Go to the Sanity.io website using your web browser.
    • Login with you account/Create a new account.
    • After logging in, you'll be redirected to the Sanity.io dashboard.
    • If you have an existing project, you'll see it listed on the dashboard. Click on the project's name to access it.
    • Once you're inside the project, look at the browser's address bar. The URL should look something like this: https://www.sanity.io/manage/project/your-project-id
    • The your-project-id in the URL is your Sanity project ID. It's a unique identifier for your specific project.

    That's it! You've now obtained your Sanity project ID, which you can use for interacting with your Sanity project via its API or other integrations.

  • TMDB_ACCOUNT_ID and TMDB_ACCESS_TOKEN: To enable seamless integration of movie and TV show data, we will use the TMDB API, which offers comprehensive information about media content. The following steps will guide you:

    1. Overview of TMDB Integration

    Previously, movie and TV show data were manually stored using Supabase, requiring tedious manual work. To streamline the process and automatically update ratings, we have switched to TMDB (The Movie Database).

    2. Creating or Logging into Your TMDB Account

    If you already have a TMDB account, log in with your existing credentials. Otherwise, visit TMDB's website and create a new account.

    3. Generating API Key

    After logging in, navigate to the API section in your account settings. Here, you can generate a new API key to access TMDB's data and services.

    generate api key

    Completing the API Key Request Form

    Fill in all the required details in the API key request form, and make sure to accept the terms and conditions.

    complete api key request form

    Obtaining API Key and Access Token

    Once you have completed the application registration, you will receive an API key and an access token. Assign the access token to the TMDB_ACCESS_TOKEN variable.

    API Key and Access Token

    Finding Your TMDB Account ID

    To get the TMDB_ACCOUNT_ID, log in to the TMDB system and visit the developer website. There, you will find your account ID associated with your account.

    Finding Your TMDB Account ID

    With the TMDB_ACCOUNT_ID and TMDB_ACCESS_TOKEN acquired from the steps above, you can now seamlessly access and update movie and TV show data through TMDB's API, automating the process and making it significantly more efficient. Enjoy your improved movie and TV show list management experience!

Screenshots & Demo

Documentation

I have written an in-depth blog on How I Made My Portfolio with Next.js. You can visit there to look at the detailed guide about this portfolio.

More Repositories

1

next-google

This web app allows users to search for information on the internet, similar to the Google search engine. It is powered by the Google Custom Search API, which allows it to display results that are exactly the same as those provided by Google.
JavaScript
21
star
2

react-chat-room

It is a communication platform that allows you to chat in a group. To use the application, users can log in with their Google account and join a chat. Once they are in the chat room, they can send messages and images to the chat room.
JavaScript
14
star
3

next-google-docs

Next Google Docs is a web app which uses draft.js to create a document for you. It also uses Firebase to store all the documents.
JavaScript
13
star
4

j471n

I'm a React developer from Uttar Pradesh, India. Who also code in Python and C++. Passionate towards learning, Reading and coding.
4
star
5

competitive-programming

Solution of Codechef problems
C++
2
star
6

next-hulu

This web app is a clone of Hulu, a streaming service for movies and television shows. It utilizes the themoviedb API to retrieve data for the content that is displayed in the application. However, the data may differ from the data on the original Hulu platform.
JavaScript
2
star
7

analog-clock

This is an Analog Clock Using HTML, CSS, Javascript
CSS
1
star
8

react-dictionary

The dictionary web app is a tool that allows users to look up the meanings of words in various languages. It offers support for more than 10 languages. It also provide pronunciation of the words being looked up.
JavaScript
1
star
9

next-fb-clone

It is the clone of the Facebook where you can upload the post with the images it is in realtime
JavaScript
1
star
10

Librarian

It is a GUI Software which can be used to mange, View books, issue book, add book, delete book and etc which is coded in Python and MySql
Python
1
star
11

weather-app-js

Weather App from JavaScript
CSS
1
star
12

react-keeper

The quick note taking web app that allows users to quickly and easily create and save notes. It is designed for use on a daily basis, providing a convenient way for users to note down ideas, tasks, or other information as needed.
JavaScript
1
star
13

jokes-generator

This is a fun project for entertaining users and to enjoy a bit of humor, whether they are looking for something quick and light or are in the mood for a more elaborate joke. It uses a public API to access a database of jokes and randomly select a joke to display to the user..
JavaScript
1
star