This project implements a backend API for a community feature in a cross-platform mobile app using Node.js and TypeScript.
- User registration and login
- Post management (create, edit, delete)
- Upvoting and downvoting posts
- Commenting on posts
- Sorting and filtering posts
The project follows an MVC pattern with separate directories for controllers, models, routes, services, and utilities.
- Node.js (v14.x or later)
- MongoDB
- TypeScript
-
Clone the repository:
git clone https://github.com/yourusername/hospyta-backend.git cd hospyta-backend
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory with the following variables:MONGODB_URI=your_mongodb_uri CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret
-
Start the development server:
npm run dev
-
The server should now be running on
http://localhost:8000
.