create-basic-auth-express-app
v1.0.5
Published
create basic auth express server with npx create-basic-auth-express-app
Downloads
2
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-app
Create Basic Auth Setup
To create a setup with basic authentication APIs (register, login, logout, profile), run:
npx create-basic-auth-express-app
Included 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.md
Usage
Install dependencies:
npm install
Start the server:
npm run dev
or
npm start
Environment Variables: Configure the
.env
file with necessary environment variables like database connection strings, secret keys, etc.