|
| 1 | +# 🚀 Initial Next.js + Tailwind Project |
| 2 | + |
| 3 | +This project is a modern and scalable starter template, set up with Next.js (React) and Tailwind CSS. It includes robust configuration for code quality, formatting, and commit management using TypeScript, ESLint, Prettier, Husky/Commitlint and Lint-Staged. |
| 4 | + |
| 5 | +## 🛠️ Key Technologies |
| 6 | + |
| 7 | +- [Next.js](https://nextjs.org/): React framework for developing full-stack web applications with hybrid rendering. |
| 8 | + |
| 9 | +- [React](https://react.dev/) & [React DOM](https://react.dev/learn): The JavaScript library for building user interfaces. |
| 10 | + |
| 11 | +- [Tailwind CSS](https://tailwindcss.com/): A utility-first CSS framework for building designs quickly and flexibly. |
| 12 | + |
| 13 | +- [TypeScript](https://www.typescriptlang.org/): A superset of JavaScript that adds static typing. |
| 14 | + |
| 15 | +- [ESLint](https://eslint.org/): For detecting problems and ensuring compliance with coding standards. |
| 16 | + |
| 17 | +- [Prettier](https://prettier.io/): For automatic code formatting. |
| 18 | + |
| 19 | +- [Husky](https://typicode.github.io/husky/) & [Commitlint](https://commitlint.js.org/): To ensure that all commit messages follow the Conventional Commits standard. |
| 20 | + |
| 21 | +- [Lint-Staged](https://github.com/okonet/lint-staged): Runs linting and formatting commands only on staged files before commit. |
| 22 | + |
| 23 | +## 🌟 First Steps |
| 24 | + |
| 25 | +### Requirements |
| 26 | + |
| 27 | +Asegúrate de tener **[Node.js](https://nodejs.org/)** (versión LTS recomendada) y **npm** instalados en tu sistema. |
| 28 | + |
| 29 | +### Installation: |
| 30 | + |
| 31 | +1. Clone the repository: |
| 32 | + |
| 33 | +``` |
| 34 | +git clone <URL_OF_THE_REPOSITORY> |
| 35 | +cd nextflow-starter |
| 36 | +``` |
| 37 | + |
| 38 | +2. Install the dependencies: |
| 39 | + |
| 40 | +``` |
| 41 | +npm install or npm i |
| 42 | +``` |
| 43 | + |
| 44 | +**⚠️ WARNING:** |
| 45 | +_The dependencies have exact versions. Run the **`npm upgrade`** command to update to the latest versions if desired._ |
| 46 | + |
| 47 | +3. Configure Husky (required for pre-commit and pre-push git hooks): |
| 48 | + |
| 49 | +``` |
| 50 | +npm run prepare |
| 51 | +``` |
| 52 | + |
| 53 | +## ⚙️ Available Scripts |
| 54 | + |
| 55 | +At the root of the project, you can run the following commands: |
| 56 | + |
| 57 | +| Command | Description | |
| 58 | +| :---------------- | :----------------------------------------------------------------------------------------------------- | |
| 59 | +| `npm run dev` | Start the application in development mode. It can be accessed at http://localhost:3000. | |
| 60 | +| `npm run build ` | Start the production server after running npm run build. | |
| 61 | +| `npm run start` | Runs the production server after npm run build. | |
| 62 | +| `npm run lint` | Runs ESLint to analyze code and automatically fixes fixable issues. | |
| 63 | +| `npm run format` | Run Prettier to automatically format files, followed by npm run lint to apply automatic linting fixes. | |
| 64 | +| `npm run prepare` | Configure Husky's git hooks. Must be run after cloning the project. | |
| 65 | + |
| 66 | +## 📐 Code Standards and Commits |
| 67 | + |
| 68 | +### 💡 Code Format and Style |
| 69 | + |
| 70 | +The `npm run format` and `npm run lint` commands help you keep your code clean. What's more, thanks to Husky and lint-staged, your code is automatically formatted and checked (linted) before each commit. |
| 71 | + |
| 72 | +#### 📝 Commit Convention |
| 73 | + |
| 74 | +The project uses Husky and Commitlint to enforce the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard. |
| 75 | + |
| 76 | +When you make a commit, your message should follow a specific format, such as: |
| 77 | + |
| 78 | +> feat(component): add support for dark mode |
| 79 | +> fix(api): fix bug when obtaining user data |
| 80 | +
|
| 81 | +#### ⚠️ IMPORTANT NOTE FOR THE FIRST COMMIT: |
| 82 | + |
| 83 | +> _If you run npm run prepare before the first commit, the traditional message such as "Initial commit" will fail. You must use a valid commit type, for example:_ |
| 84 | +
|
| 85 | +``` |
| 86 | +git commit -m "chore: initial project setup" |
| 87 | +``` |
| 88 | + |
| 89 | +#### Example of Permitted Commit Types: |
| 90 | + |
| 91 | +- **feat:** New functionality. |
| 92 | +- **fix:** Bug fix. |
| 93 | + |
| 94 | +- **chore:** General maintenance (updating dependencies, etc.). |
| 95 | + |
| 96 | +- **refactor:** Code restructuring that does not introduce functionality or fix bugs. |
| 97 | + |
| 98 | +- **style:** Changes that do not affect logic (spacing, formatting, etc.). |
| 99 | + |
| 100 | +- **test:** Adding or modifying tests. |
| 101 | + |
| 102 | +- **docs:** Changes to documentation. |
| 103 | + |
| 104 | +**_Any commit that does not comply with this format will be blocked by Husky and Commitlint._** |
| 105 | + |
| 106 | +--- |
0 commit comments