1.4.0 • Published 11 months ago

express-simplicity v1.4.0

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

Express Simplicity: Default Folder Structure And Essential Packages For Express.js

Jumpstart your Express.js and Node.js projects with the Express.js Starter Kit. This npm package provides a default folder structure and installs essential npm packages to help you quickly set up and build robust web applications.

:point_right: Key Features

  • Organized Folder Structure: The Express.js Starter Kit creates a predefined folder structure with neatly organized directories for routes, controllers, models, views, and public assets.
  • Pre-configured Express.js Server: Get started right away with a basic Express.js server that comes pre-configured with routing and error handling.
  • Essential NPM Packages: Save time and effort by having commonly used npm packages for Express.js, such as nodemon, express, and dotenv, automatically installed. These packages enhance security and streamline your development process.
  • Best Practices and Sample Code: The Starter Kit includes sample code and configuration files that follow best practices, allowing you to start building your application immediately.

:point_right: Requirements

  • Node js should be installed.
  • npm or yarn should be installed.

:point_right: Installation

To get started,

  • Install the Express Simplicity Starter Kit globally using npm:
npm install -g express-simplicity
  • Then open your terminal and navigate to your folder where you wont to install the template
cd < path to the project directory >
  • After navigating to the folder run this command it will generate the files and install the dependencies.
express-simplicity
  • After generating the files run this command to start the server.
npm run express
  • Move on to your preferred browser and paste this URL.
http://localhost:3000/

:point_right: Packages

  • dotenv: Loads environment variables from a .env file into process.env.
  • nodemon: Automatically restarts the Node.js application when changes are detected in the source code.
  • express: A web framework for Node.js that simplifies the process of building web applications. you can access the api routes similarly.
  • mysql: The MySQL Node package: Simplifying MySQL database interactions in Node.js.

:point_right: Additional Comments

  • Change the env-example.txt file to .env to enable the usage of environment variables in your project.
  • I have added some boilerplate code in the controllers, models and routes folder. I have use the MVC architecture in this.
http://localhost:3000/api/users
http://localhost:3000/api/users/5
  • To connect this application to the database you can replace these .env variables with your db credentials.
DB_HOST=
DB_USERNAME=
DB_PASSWORD=""
DB_NAME=

# If you are getting any unexpected errors you can add the socket path to
SOCKET_PATH=
  • I have added comments on the userModels files and the userController file on how to get data from the database once the db is connected.

:point_right: License

The Express.js Starter Kit is licensed under the ISC License.

1.4.0

11 months ago

1.3.0

11 months ago

1.2.0

12 months ago

1.0.14

12 months ago

1.0.12

12 months ago

1.0.11

12 months ago

1.0.10

12 months ago

1.0.9

12 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago