create-basic-auth-express-app
v1.0.5
Published
create basic auth express server with npx create-basic-auth-express-app
Downloads
7
Readme
Basic Express.js Server and Folder Structure
Overview
This project provides a setup for a basic Express.js server with a predefined folder structure and basic APIs. It includes commands to quickly scaffold a new Express.js application and set up authentication-related endpoints.
Quick Start
Create a Basic Express.js Server
Run the following command to create a basic Express.js server with a predefined folder structure:
npx create-demo-express-appCreate Basic Auth Setup
To create a setup with basic authentication APIs (register, login, logout, profile), run:
npx create-basic-auth-express-appIncluded APIs
The basic authentication setup includes the following prewritten APIs:
- Register
- Login
- Logout
- Profile
Folder Structure
The scaffolded application will have the following folder structure:
project-root
│
├── public
│ ├── avatar
│ └── ...other static files
│
├── controllers
│ └── userController.js
├── models
│ └── User.js
├── routes
│ └── userRoute.js
├── middlewares
│ └── auth.js
├── utils
│ └── jwtToken.js
├── config
│ └── database.js
│
├── app.js
│
├── .env
├── package.json
└── README.mdUsage
Install dependencies:
npm installStart the server:
npm run devor
npm startEnvironment Variables: Configure the
.envfile with necessary environment variables like database connection strings, secret keys, etc.
