This repo contains the Back-End for SalVeg.
SalVeg is a web application created by Team Six Bits for the final 4 week project at the School of Code (Nov 2021 - Mar 2022).
We were given a very open-ended brief - to solve a problem.
With this in mind, we decided to put our efforts towards solving the problem of food waste.
Of all fresh food that's produced, roughly a third of it is wasted. Despite supermarkets' high cosmetic standards, a consumers are prepared to buy wonky or otherwise edible vegetables, but there is no easy way to communicate between producers and consumers.
We created an app that works as a platform to connect people who have excess fresh produce (whether this is farmers or home growers) to people who are happy to buy vegetables directly from producers even if they don't meet the standards held by supermarkets.
- Clone this repo by running
git clone https://github.com/SchoolOfCode/final-project-api-six-bits.git
cd final-project-api-six-bits
npm install
- Create an app with the Heroku PostgreSQL add-on
- Set up Continuous Deployment pipeline, linking Heroku to GitHub
- Copy database credentials from Heroku to your local copy of .env
If you're new to Heroku or PostgreSQL on Heroku, read here for more information
- Create users table
npm run db:createusers
- Create posts table
npm run db:createposts
- Run local server
npm run start
npm run dev
Starts local development server at http://localhost:3000npm run build
Runs buildnpm run start
Runs API servernpm run test
Runs a suite of tests
- Express - Routing and Server Middleware
- GitHub - Sharing and Reviewing Code
- Heroku - Continuous Deployment of Database
- Jest - Unit Testing
- Node - Back-End JS / API
- PostgreSQL - Database