This is a template repository for an ERN (Express.js, React.js, Node.js) stack application. This template includes boilerplate code for:
- Node.js backend
- React.js frontend
- Redux for frontend global state management
- Build pipeline (using Webpack)
- Unit tests (Jest and React Testing Library)
- WebSockets (using Socket.IO)
- Backend event emission framework (using Node's EventEmitter API)
- Development server with hot reloading
- PR build pipeline (using Github Actions)
- Git hooks (using Husky)
To get started, follow these steps:
-
Clone the repository:
git clone <repository-url> cd <repository-dir>
-
Install the dependencies:
npm install
This application provides the following npm scripts for different purposes:
build
: Build the server and client code in production mode.build:client
: Build the client code.build:server
: Build the server code.dev
: Start the development server.dev:client
: Start the client development server.dev:server
: Start the server in development mode.lint
: Run ESLint to check for lint errors.lint:fix
: Run ESLint and automatically fix lint errors.start
: Start the application.test
: Run all tests.test:client
: Run client-side tests.test:server
: Run server-side tests.
To use these scripts, you can run them using npm. For example:
# Build the client and server code in production mode
npm run build
# Start the development server
npm run dev
# Run ESLint to check for lint errors
npm run lint
# Run all tests
npm test
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request.
Feel free to customize and expand the content as needed. Replace `<repository-url>` with the actual URL of your repository.
Make sure to update the `Installation` section to include any additional steps specific to your project setup.
Let me know if you need any further assistance!