This README provides an overview of the Condiviso app's backend structure, setup, and usage. Condiviso helps users to arrange food events and avoid food waste.
Link to hosted api: https://condiviso-be.onrender.com/api/events
- Setup
- [Usage] (#usage)
- Database
- Environment Variables
- [Contributors] (#contributors) -[License] (#license)
Ensure node (v14.1.0 or higher) is installed.
- Clone this repository to your local machine.
git clone https://github.com/catherine-newman/condiviso-be
- Install dependencies using the command:
npm install
. - Set up your environment variables (see Environment Variables).
- Start the development server with:
npm run dev
.
The endpoints available allow the following functionality:
- POST event/user/recipe
- GET api/event/events(filterable by location and associated user)/recipe/recipe/user
- PATCH event/recipe/user
- DELETE recipe
The backend uses MongoDB to store user data, events, and recipes. Database connection and management are handled by the db/connection.js module. Data seeding is performed using the db/data/run-seed.js script.
Create the following environment variable files in the root directory:
.env.production
: Environment variables for production..env.test
: Environment variables for testing.
Example of .env.production
:
ATLAS_URI=mongodb+srv://:@/condivisoproject?retryWrites=true&w=majority
Note: Replace , , and with your MongoDB Atlas credentials.
Catherine Newman, Harriet Hall, Luke Ford, Stephen Lancaster and Simone Dessi.
This project is licensed under the [MIT License]