Start-Out / module-react

1 stars 0 forks source link
boilerplate golden-path react

StartOut React Project

Welcome to the StartOut React project. This project is set up with a comprehensive configuration including Prettier, ESLint, Tailwind CSS, and a sample folder structure to get you started quickly.


Folder Structure

Here is an overview of the folder structure in this project:

.
├─ public
│  └─ favicon.ico
├─ src
│  ├─ assets
│  ├─ components
│  │  ├─ footer
│  │  │  └─ footer.jsx
│  │  ├─ header
│  │  │  └─ header.jsx
│  ├─ pages
│  │  ├─ landing
│  │  │  └─ landing.jsx
│  │  ├─ error404
│  │  │  └─ error404.jsx
│  ├─ redux
│  ├─ exports.js
│  ├─ App.js
│  ├─ index.js
│  └─ index.css
├─ .env
├─ .eslintrc.json
├─ .gitignore
├─ .prettierignore
├─ .prettierrc
├─ package.json
├─ postcss.config.cjs
├─ tailwind.config.js
└─ README.md

Description of the Key Directories and Files


Setup and Usage

Option 1: Clone the Repository

First, clone the repository and install the dependencies:

git clone https://github.com/yourusername/startout-react-app.git
cd startout-react-app
npm install

Option 2: Use the Setup Script

This script automates the setup of a new React project, optionally including TypeScript. It installs necessary dependencies, configures Prettier and ESLint, adds useful scripts to package.json, and sets up Tailwind CSS. It also organizes the project structure by creating directories and files for components, assets, and pages.

Prerequisites

Features

Usage

  1. Make the script executable: chmod +x setup_react.sh

  2. Execute the script: ./setup_react.sh

Environment Variables

The script uses the following environment variables to customize the project setup (more will be added in the future):


Running the Development Server

To start the development server: npm start

This will run your app in development mode. Open http://localhost:3000 to view it in the browser.


Building for Production

To build the app for production:npm run build

This will create an optimized build of the app in the build folder.


Linting and Formatting

To check for code quality issues: npm run lint

To format the code: npm run format


Custom Configuration

This project comes with a set of predefined configurations for ESLint, Prettier, and Tailwind CSS. You can customize these configurations by editing their respective files:


Adding New Pages and Components