Giter Club home page Giter Club logo

portfolio's Introduction

My personal website

Hello world! I'm Ronilson Alves, a software developer from Brazil. This is the source code of my personal website/portfolio, which is available at ronilsonalves.com – English home page or ronilson.dev.br – página inicial em Português.

Table of Contents

Features

Some of the features of this website are:

  • Internationalization (i18n)
  • Light and Dark themes
  • Responsive design
  • SEO friendly
  • AMP support
  • Blogging system with Sanity
  • Comments in the blog posts with Giscus
  • Support to related posts
  • Blog posts instant search with Algolia
  • Contact form with Resend
  • Support to Google Tag Manager
  • Support to Google AdSense

Development

This website was built using TypeScript, React, Next.js, Tailwind CSS, shadcn/ui and deployed to Vercel and as personal challenge to learn more about these technologies.

Main Used Libraries

Running Locally

Prerequisites

  • Node.js (v14.15.4 or higher)
  • npm (v1.22.10 or higher)
  • Sanity CLI (v3.26.1 or higher)
  • A Sanity account to manage the blog posts (you can create one for free)
  • An Algolia account to index the blog posts
  • A Resend account to receive the contact form submissions (required only if you want to receive the contact form submissions)
  • A Vercel account to deploy the website (required only if you want to deploy the website)

Installation

Clone this repository and install the dependencies:

git clone https://github.com/ronilsonalves/portfolio.git
cd portfolio
npm install

Create a .env.local file in the root directory of the project and add the environment variables to it. You can find the necessary variables in the .env.example file.

Running

First of all, you need to create a Sanity project. Create a new project using the Sanity CLI and select the Clean project with no predefined schemas template. Then update the Sanity environment variables at .env.local. You can find the necessary variables in the .env.example file.

# Assuming you are in the root directory of the project, create a temporary directory to run the Sanity CLI, since we need only the Sanity project id and dataset name generated by the cli.
# The cli will ask you to login to your Sanity account if you are not already logged in.
npm create sanity@latest
# Now you can delete the temporary directory.

After, you can run the npm dev script to start the development server as normally you would do with a Next.js project.

# Run Next.js and Embebbed Sanity Studio development server
npm run dev

Now you can access the Sanity Studio at http://localhost:3000/studio (you can customize the path) and the website at http://localhost:3000.

At this point, you can start to create your own schemas and documents in the Sanity Studio. You can find more information about Sanity in the official documentation.

To index the blog posts in Algolia, you need to create an Algolia index and set the environment variables in the .env.local file. You can find more information about Algolia in the official documentation. This project already has a webhook to trigger the indexing when you publish a new document in the Sanity Studio and a script to index all the documents in the Sanity Studio. You can find more information about this in the official documentation and the docs of the official Sanity Algolia plugin.

To allow the comments in the blog posts, you need to configure the giscusapp. You can find more information about Giscus in the official documentation.

Deploying

Vercel

If you are familiar with Vercel, you can deploy the website using it. You can find more information about Vercel in the official documentation. Also, you can build the website using the npm build script and deploy it to any other hosting service that supports Next.js. Or you can build a docker image and deploy it to a container service.

To use Algolia indexing, you need to create a Sanity Webhook and set 'https://your-website.vercel.app/algolia/webhook' to trigger the indexing when you publish a new document. You can find more information about this in the official documentation and the docs of the official Sanity Algolia plugin.

A warning: Currently, every time that you publish a new document in the Sanity Studio, you need to redeploy the website to Next.js generate the new static pages. This is because the Sanity Studio is embebbed in the Next.js development server and the Next.js development server doesn't support incremental static regeneration. You can find more information about this in the official documentation. There's a plugin to redeploy the website automatically when you publish a new document, but I didn't test it, also I'm working on my own solution to this problem.

Building a Docker Image

You can build a docker image and deploy it to a container service. You can find more information about Docker in the official documentation. You can use the Dockerfile in the root directory of the project to build the image.

More information coming soon...

License

This project is open source and available under the MIT License.

portfolio's People

Contributors

ronilsonalves avatar

Watchers

 avatar

portfolio's Issues

Next.js DYNAMIC_SERVER_USAGE error trowing in dynamic routes [locale/slug] after add manual language switcher feat

Expected Behavior

Use could choose the preferred language to navigate at website

Actual Behavior

Use is able to choose the preferred language to navigate at website but the dynamic routes such the institutional pages (about, blog, projects and services) are crashing trowing a 500 error (Digest: DYNAMIC_SERVER_USAGE).

Steps to Reproduce the Problem

  1. Access the website
  2. Click in any header's link (excluding home and language selection)
  3. Trow the error

Specifications

  • Version: 0.5.1
  • Next.js Version: 14.1.0
  • Node.js Version: 20

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.