Node-Express-EJS-TailwindCSS Starter

A starter template for building web applications with Node.js, Express, EJS, and Tailwind CSS.

Features

  • šŸš€ Express.js server setup
  • šŸŽØ EJS templating for dynamic web pages
  • šŸ’Ø Tailwind CSS integration for styling
  • šŸ“‚ Organized project structure (routes, views, public assets)
  • šŸ›  Ready-to-use middleware for request parsing

Project Structure

NODE-EXPRESS-EJS-TAILWINDCSS-STARTER
│── bin/                     # Server start script (if applicable)
│── node_modules/            # Dependencies (ignored in repo)
│── public/                  # Static assets (CSS, JS, Images)
│   ā”œā”€ā”€ images/              # Image files
│   ā”œā”€ā”€ javascripts/         # JavaScript files
│   ā”œā”€ā”€ stylesheets/         # CSS files (includes Tailwind)
│── routes/                  # Express route handlers
│   ā”œā”€ā”€ index.js             # Main route
│   ā”œā”€ā”€ users.js             # Example user route
│── views/                   # EJS templates
│   ā”œā”€ā”€ index.ejs            # Main page
│   ā”œā”€ā”€ error.ejs            # Error page
│── .gitignore               # Ignored files
│── .prettierrc              # Code formatting rules
│── app.js                   # Main application file
│── LICENSE.md               # License file
│── package.json             # Project dependencies (Update name "projectname" to your actual project name)
│── package-lock.json        # Dependency lock file
│── README.md                # Documentation

Installation

  1. Clone the repository:
    git clone [email protected]:mraxays/node-express-ejs-tailwindcss-starter.git
    cd node-express-ejs-tailwindcss-starter
    
  2. Install dependencies:
    npm install
    
  3. Start the server:
    npm start
    
    The server runs at http://localhost:3000/ by default.

Usage

  • Modify views/index.ejs to customize the homepage.
  • Add new routes in routes/ and link them in app.js.
  • Edit public/stylesheets/tailwind.css for custom styling.
  • Update package.json and change the name "projectname" to your actual project name.
  • Use npm run devcss to compile Tailwind CSS.
  • Use npm run dev to start the server with Nodemon for auto-reloading.

Dependencies

This project includes the following dependencies:

  • Express (^4.21.2)
  • EJS (^3.1.10)
  • Tailwind CSS (^4.0.15)
  • Morgan (~1.9.1 for logging)
  • Cookie Parser (~1.4.4 for handling cookies)
  • Debug (~2.6.9 for debugging)
  • HTTP Errors (~1.6.3 for error handling)
  • @tailwindcss/cli (^4.0.15 for Tailwind CLI)

Dev Dependencies

  • Nodemon (^3.1.9 for auto-restarting the server)
  • Prettier (^3.5.3 for code formatting)
  • Prettier Plugin TailwindCSS (^0.6.11 for Tailwind-specific formatting)

Scripts

The following scripts are available:

  • npm start - Start the server normally.
  • npm run dev - Start the server with Nodemon for auto-restarting.
  • npm run devcss - Compile Tailwind CSS and watch for changes.

License

This project is licensed under the MIT License.


Contributions & Support

Feel free to submit issues or pull requests to improve this starter template!

Top categories

tailwind logo

Need a Tailwind website built?

Hire a professional TailwindCSS developer today.
Loading Svelte Themes