🔗 Website
This is the backend of a Portfolio and Blog website, built with Node.js and Express.js. It provides API endpoints for managing user authentication, projects, and blog posts. Users can log in, upload projects, delete them, retrieve details, and manage blog content efficiently.
-User Authentication: Secure login system.
-Project Management: Upload, delete, and retrieve project details.
-Blog Management: Create, edit, and delete blog posts.
-Database Integration: Stores user, project, and blog data.
-TypeScript for strong typing and enhanced developer experience.
-Express.js for creating the server and APIs.
-MongoDB for database management using Mongoose.
-Environment Variable management with dotenv
.
-Linting and Formatting with ESLint and Prettier.
-Development server with ts-node-dev for live reload.
-Modular architecture for scalability.
Make sure you have the following installed:
- Node.js (version 16 or above)
- npm or yarn
- MongoDB instance (local or cloud-based)
-
Clone the repository:
git clone <repository-url> cd <repository-folder>
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory and configure your environment variables:PORT=5000 DATABASE_URL= your-mongodb-uri
-
Start Development Server:
npm run start:dev
-
Build for Production:
npm run build
-
Start Production Server:
npm run start:prod
-
Lint Code:
npm run lint
-
Fix Lint Issues:
npm run lint:fix
-
Format Code with Prettier:
npm run prettier
-
Fix Formatting Issues:
npm run prettier:fix
├── src
│ ├── app
│ ├ ├── config
│ ├── Modules
│ ├----├── Project
│ ├ ├── interface.ts
│ ├ ├── model.ts
│ ├ ├── route.ts
│ ├ ├── controller.ts
│ ├ ├── service.ts
│ ├----├── Project
│ ├ ├── interface.ts
│ ├ ├── model.ts
│ ├ ├── route.ts
│ ├ ├── controller.ts
│ ├ ├── service.ts
│ ├----├── Message
│ ├ ├── interface.ts
│ ├ ├── model.ts
│ ├ ├── route.ts
│ ├ ├── controller.ts
│ ├ ├── service.ts
│ └── server.ts
│ └── app.ts
├── dist # Compiled JavaScript files
├── .eslintrc.json # ESLint configuration
├── .prettierrc # Prettier configuration
├── tsconfig.json # TypeScript configuration
└── package.json # Project metadata and scripts
cors
: Enable Cross-Origin Resource Sharingdotenv
: Load environment variables from.env
fileexpress
: Web framework for Node.jsmongoose
: MongoDB object modeling tool
typescript
: TypeScript compilereslint
: Linting tool for JavaScript/TypeScriptprettier
: Code formatterts-node-dev
: Development server for TypeScript