This is the backend of the GreenMatch system.
- The environment file ".env" already has the connection string which points to our populated database. If you want to connect to your local database change the property "DB_URI".
- The JWT_SECRET can also be changed, but we advise against it.
- If you intend to use your own stripe account change the STRIPE_SK. (Afterwards you cannot use our database. We also advise against this.)
- Install all the project dependencies:
npm install
- Run the project:
npm start
- Supplier login: email
[email protected]
password123
- Buyer login: email
[email protected]
password123
- MongoDB Atlas: email
[email protected]
passwordB4T#Ly3zM!86
- Stripe (use test mode): email
[email protected]
passwordB4T#Ly3zM!86
- Yahoo Mail: email
[email protected]
password8QYJcRd6KyAZnxw
api/
auth/
POST login
POST register
GET logout
GET setupIntent --> returns Stripe client secret to set up payment method for future payments
GET email/:id --> if user exists return true else false
GET|POST powerplants/ --> only powerplants of supplier
GET|PATCH|DELETE :id
GET offers/ --> all live offers
GET :id
GET|POST ppas/ --> returns only ppas of user
GET :id PATCH :id --> only for supplier, cancles PPA
GET notifications/
PATCH :id --> mark notification as read