A food sharing platform built with MongoDB, Express, and Node.js.
- Node.js (v18 or higher)
- MongoDB
- npm or yarn
- Clone the repository:
git clone <repository-url>
cd food_sharing_system- Install dependencies:
npm install- Create a
.envfile in the root directory and add the following variables:
PORT=3000
MONGODB_URI=mongodb://localhost:27017/foodshare
NODE_ENV=development
JWT_SECRET=your_jwt_secret_key_here
- Start the development server:
npm run devnpm start: Start the production servernpm run dev: Start the development server with hot reloadnpm test: Run tests
food_sharing_system/
├── src/
│ ├── server.js
│ ├── models/
│ ├── routes/
│ ├── controllers/
│ └── middleware/
├── tests/
├── .env
├── .gitignore
├── package.json
└── README.md
This project is deployment-friendly and can be deployed to various platforms like Heroku, DigitalOcean, or AWS. Make sure to:
- Set up the environment variables in your deployment platform
- Configure your MongoDB connection string for production
- Set NODE_ENV to 'production'
- Use a process manager like PM2 in production
MIT