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.
-
Next.js: React framework for developing full-stack web applications with hybrid rendering.
-
React & React DOM: The JavaScript library for building user interfaces.
-
Tailwind CSS: A utility-first CSS framework for building designs quickly and flexibly.
-
TypeScript: A superset of JavaScript that adds static typing.
-
ESLint: For detecting problems and ensuring compliance with coding standards.
-
Prettier: For automatic code formatting.
-
Husky & Commitlint: To ensure that all commit messages follow the Conventional Commits standard.
-
Lint-Staged: Runs linting and formatting commands only on staged files before commit.
Asegúrate de tener Node.js (versión LTS recomendada) y npm instalados en tu sistema.
- Clone the repository:
git clone <URL_OF_THE_REPOSITORY>
cd nextflow-starter
- Install the dependencies:
npm install or npm i
npm upgrade <package>@latest or npx npm-check-updates -u to update to the latest versions of all packages, if available.
- Configure Husky (required for pre-commit and pre-push git hooks):
npm run prepare
At the root of the project, you can run the following commands:
| Command | Description |
|---|---|
npm run dev |
Start the application in development mode. It can be accessed at http://localhost:3000. |
npm run build |
Start the production server after running npm run build. |
npm run start |
Runs the production server after npm run build. |
npm run lint |
Runs ESLint to analyze code and automatically fixes fixable issues. |
npm run format |
Run Prettier to automatically format files, followed by npm run lint to apply automatic linting fixes. |
npm run prepare |
Configure Husky's git hooks. Must be run after cloning the project. |
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.
The project uses Husky and Commitlint to enforce the Conventional Commits standard.
When you make a commit, your message should follow a specific format, such as:
feat(component): add support for dark mode fix(api): fix bug when obtaining user data
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:
git commit -m "chore: initial project setup"
-
feat: New functionality.
-
fix: Bug fix.
-
chore: General maintenance (updating dependencies, etc.).
-
refactor: Code restructuring that does not introduce functionality or fix bugs.
-
style: Changes that do not affect logic (spacing, formatting, etc.).
-
test: Adding or modifying tests.
-
docs: Changes to documentation.
Any commit that does not comply with this format will be blocked by Husky and Commitlint.