MyExpressTypeScriptApp is a Node.js application built with Express, TypeScript, and Mongoose. It includes validation with Joi and other useful tools.
- Prerequisites
- Installation
- Running the Application
- Configuration
- Project Structure
- Scripts
- Testing
- Deployment
- Contributing
- License
- Contact
Before you begin, ensure you have met the following requirements:
- You have installed Node.js (version 14.x or later).
- You have installed MongoDB and it is running on your local machine or you have access to a MongoDB Atlas cluster.
- You have a package manager like npm (comes with Node.js) or yarn.
To install the application, follow these steps:
- Clone the repository:
git clone https://github.com/SumonRahman24/assignment-2.git
- Navigate to the project directory:
cd MyExpressTypeScriptApp
- Install dependencies:
or if you use yarn:
npm install
yarn install
To run the application locally, follow these steps:
- Ensure you are in the project directory.
- Compile the TypeScript code:
or if you use yarn:
npm run build
yarn build
- Start the application:
or if you use yarn:
npm run dev
yarn start
- Open your web browser and go to:
http://localhost:5000
The application requires a configuration file to connect to the MongoDB database and set up other environment variables. Here’s how you can set up your configuration:
-
Create a
.env
file in the root directory. -
Add the following environment variables in the
.env
file:PORT=5000