Skip to content

marcelkalveram/the-sustainable-list

Repository files navigation

The Sustainable List

Vercel

This is the README file for the project "The Sustainable List". It provides instructions on how to set up and deploy the project on Vercel.

This project runs on the React framework Next.js and gets deployed on Vercel for maximum performance and infrastructure efficiency.

Prerequisites

Before getting started, make sure you have the following:

  • Vercel account
  • Node.js installed
  • Git installed

Getting Started

  1. Clone the repository:
git clone https://github.com/marcelkalveram/the-sustainable-list.git
  1. Navigate to the project directory:
cd the-sustainable-list
  1. Install dependencies:
npm install

Environment variables

Create an .env.local file in the root directory of the project and add the necessary environment variables:

CONTENTFUL_ACCESS_TOKEN=""
CONTENTFUL_SPACE_ID=""
SENDGRID_API_KEY=""

NEXT_PUBLIC_RECAPTCHA_SITE_KEY=
RECAPTCHA_SECRET_KEY=

After logging in to Vercel (see Deployment below), these can be pulled directly from there using the following command:

vercel env pull .env.local

Pulling content from Contentful

Run the following to pull in the latest content from the Contentful API:

npm run contentful:pull:local

IMPORTANT: this requires the two CONTENTFUL_... keys above to be set to pull content from the Contentful space. Ask the project owner for access.

This script saves the data consumed by the app in the public folder at /public/data/index.json so it can be access by the app at runtime.

Running this locally vs. Vercel

The contentful:pull:local script only works on localhost and sets the environment variables for Contentful for local dev environments before running the node script.

On Vercel, the build command runs the non-local version of this script (contentful:pull) since the environment variables are already available at build time.

Development

  1. Start the development server:
npm run dev
  1. Open your browser and visit http://localhost:3000 to see the project running locally.

Deployment

To deploy the project on Vercel, follow these steps:

  1. Install the Vercel CLI:
npm install -g vercel
  1. Log in to your Vercel account:
vercel login
  1. Configure the above environment variables for this project, following this guide: https://vercel.com/docs/projects/environment-variables

  2. Deploy the project:

vercel
  1. Follow the prompts to configure the deployment settings.

  2. Once the deployment is complete, you will receive a unique URL for your project.

Contributing

If you would like to contribute to this project, please follow the guidelines outlined in the CONTRIBUTING.md file.

License

This project is licensed under the MIT License.

About

Index with sustainable and eco brands from all over the world

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published