This project is a basic Express.js backend application built with TypeScript.
- TypeScript for better development experience.
- Includes core functionalities such as CORS, environment variables, and JSON handling.
- Uses
bcryptjsfor password hashing andjsonwebtokenfor authentication. - Integrated with MongoDB via
mongoose.
- Node.js (v16 or higher)
- npm or yarn
git clone <repository-url>
cd <repository-folder>npm install
Create a .env file in the root directory and set the following variables:
env PORT=3000 || 3000
### 4. Run the Application
```bash
For Development:
npm run dev
#### or
For Production:
Build the application:
npm run build
#### or
Run the compiled code:
npm start
.
├── src
│ ├── server.ts # Main server file
│ ├── utils
│ │ └── startup.ts # ASCII art startup message
├── .env # Environment variables
├── package.json # Project configuration
├── tsconfig.json # TypeScript configuration
├── README.md # DocumentationExample Endpoint Test the main endpoint after starting the server:
/GET
dev: Start the server in development mode with live reload.
build: Compile TypeScript to JavaScript.
start: Run the compiled server in production.express: Web framework.
dotenv: Environment variable management.
cors: Cross-origin resource sharing.
bcryptjs: Password hashing.
jsonwebtoken: Token-based authentication.
mongoose: MongoDB ORM.
Dev Dependencies
typescript: TypeScript compiler.
nodemon: Live reload for development.
eslint and prettier: Code linting and formatting.
License This project is licensed under the MIT License.