Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kfirfitousi/arous-style

Online Catalog for Arous Elbahar's Second-Hand Store. Built with React, Next.js, TypeScript, React Query, React Hook Form, zod, TailwindCSS and Contentful CMS.
https://github.com/kfirfitousi/arous-style

contentful nextjs react react-hook-form react-query tailwindcss typescript zod

Last synced: 22 days ago
JSON representation

Online Catalog for Arous Elbahar's Second-Hand Store. Built with React, Next.js, TypeScript, React Query, React Hook Form, zod, TailwindCSS and Contentful CMS.

Awesome Lists containing this project

README

        

# Arous Style

### Online catalog for Arous Elbahar's second-hand store.

- Built with `React`, `Next.js` and `TypeScript`
- Managing state with `React Query`
- Handling forms and validation with `React Hook Form` and `zod`
- Managing content with `Contentful CMS`
- Styling with `TailwindCSS`
- Deployed with `Vercel`

![React](https://img.shields.io/badge/react-%2320232a.svg?style=for-the-badge&logo=react&logoColor=%2361DAFB)
![Next JS](https://img.shields.io/badge/Next-black?style=for-the-badge&logo=next.js&logoColor=white)
![Typescript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)
![React Query](https://img.shields.io/badge/-React%20Query-FF4154?style=for-the-badge&logo=react%20query&logoColor=white)
![React Hook Form](https://img.shields.io/badge/React%20Hook%20Form-%23EC5990.svg?style=for-the-badge&logo=reacthookform&logoColor=white)
![TailwindCSS](https://img.shields.io/badge/tailwindcss-%2338B2AC.svg?style=for-the-badge&logo=tailwind-css&logoColor=white)
![Vercel](https://img.shields.io/badge/vercel-%23000000.svg?style=for-the-badge&logo=vercel&logoColor=white)

# Configuration

### Contentful CMS

The products are managed in the Contentful CMS dashboard (https://app.contentful.com).

#### Locales

Under `Settings` -> `Locales`, set the default to `Hebrew (he)` and add a new locale `English (en)`.
For the English locale, tick the "Allow empty fields for this locale" checkbox and don't provide a fallback locale.

#### Content Model

Under `Content model`, click on `Add content type` and create a new content model `Product`.
It should contain the following fields:

1. Title
- Short text
- Enable localization on this field and set as required
2. Price
- Integer
- Set as required
3. Pictures
- Media, many files
- Set as required

#### Product Categories

Contentful's tags are used to categorize products.
You can edit these tags under `Settings` -> `Tags`.
The tag name is used as a label for the category.
To apply a tag to a product, go to the product's entry under `Content` and click the `Tags` tab.

### Environment Variables

For a quick start, rename `.env.local.example` in the project root to `.env.local` and open it. This file contains all the neccessary environment variables for the project.

NEXT_PUBLIC_CONTENTFUL_SPACE_ID

Your Contentful space ID.
You can find it under `Settings` -> `General Settings` -> `Space ID`.

NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN

Your Contentful access token.
You can create a new access token under `Settings` -> `API keys` -> `Add API key`.
After creating your API key, copy the "Content Delivery API - access token" value.

NEXT_PUBLIC_EMAIL_ADDRESS

This Gmail address will send itself a new mail for every contact form submission.
This google account must generate and use an App Password (see `NEXT_PUBLIC_PASSWORD`).

NEXT_PUBLIC_PASSWORD

An App Password for the google account mentioned in `NEXT_PUBLIC_EMAIL_ADDRESS`.
See https://support.google.com/accounts/answer/185833?hl=en for information on how to generate an App Password.

### Contact Form

The contact form is using the `nodemailer` package to send a new mail for every submission.
The mail is sent from the Gmail address mentioned in `NEXT_PUBLIC_EMAIL_ADDRESS`.
The mail recipient, the subject and the body are configurable in [src/config/index.ts](src/config/index.ts).

# Development

To start the development server, run:

```bash
npm run dev
```

Then open http://localhost:3000 with your browser.

# Deployment

The easiest way to deploy this project is with Vercel.
Click the button below to start.

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fkfirfitousi%2Farous-style&env=NEXT_PUBLIC_CONTENTFUL_SPACE_ID,NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN,NEXT_PUBLIC_EMAIL_ADDRESS,NEXT_PUBLIC_PASSWORD&envDescription=Contentful%20and%20Nodemailer%20configuration&envLink=https%3A%2F%2Fgithub.com%2Fkfirfitousi%2Farous-style%2Fblob%2Fmaster%2FREADME.md&project-name=arous-style&repo-name=arous-style)