desktop view: A Food barter app where you can exchange food grown in your garden with other urban farmers or anyone who wants to eat better, reduce food waste and form a community.
- People could make their own meetups at parks around the city or barter at their nearest community garden, recreation centers, food banks.
- 18 - 80 years old people.
- Users who are foodies/bee keepers / urban gardeners / fashionistas / thrifters.
- Browse items
- Add posts - new items
- Barter - write in individual posts
- Bright cool greens, yellow and blue. Usage of icons, Open sans type, user friendly layout.
- Express - Node.js
- Posgresql
- Auth0 - User authentication & authorization
- React UX/UI
- Growstuff API - https://github.com/Growstuff/growstuff/wiki/API
- OpenFarm - https://github.com/openfarmcc/OpenFarm
- Growstuff API - https://github.com/Growstuff/growstuff
- OpenFarm - https://github.com/openfarmcc/OpenFarm free and open database and web application for farming and gardening knowledge
- Wikipedia - https://en.wikipedia.org/wiki/Main_Page
- cohort 2019
Thanks to: Tony, Julia, Shweta, Agrima, David, Shalani, Danielle, the cohort and everyone I might of missed who are great volunteers and that are awesome.
-
open terminal
-
mkdir - myproject
-
make a folder for backend
-
cd to backend dir
// to create a package json -add name, //github if you want remember to add entry point: (index.js or server.js)
-
create .gitignore file - add .env to file
-
create .env file
-
add it to .gitignore
-
psql postgres // to get it to connect to postgres database - log in
-
postgres=# //Shows your inside psql postgres db and logged in as superuser or root.
-
create role and password, CREATE ROLE me WITH LOGINPASSWORD ‘password’; //(hit return) then write, ALTER ROLE me CREATEDB //(we want to create db
-
write \d to list all users/roles in postgres
-
\q to quit postgres
-
Now in terminal, to connect to ‘me’ write: psql -d postgres -U me �//(you are now logged in as me)
-
(run command) CREATE DATABASE sweets;
-
\c mytable //(to connect to sweets database)
-
make a table - use postgresql docs to insert, create, update etc. example: CREATE TABLE mytable(id SERIAL PRIMARY KEY, name VARCHAR(20), description VARCHAR(25), order_date DATE;�
-
after creating tables, open new tab in terminal bash
-
Cd backend/ - go to backend folder, (inside)
-
use express.js documentation to instantiate express connections
-
go back to .env file and fix according to posgres CRUD passwords, etc.
-
to start it just write nodemon [your node app, server.js or index.js
-
use port 3001 or 3005, (react app opens http://localhost:3000 )
-
body-parser: This is a library that you will use to convert the body of incoming requests into JSON objects.
cors: This is a library that you will use to configure Express to add headers stating that your API accepts requests coming from other origins. This is also known as Cross-Origin Resource Sharing (CORS).
express: This is Express itself.
morgan: This is a library that adds some logging capabilities to your Express app.
make another directory in root folder, call it client and type:
-
cd my-cool-app and npm start to see that its running on port 3000
-
my-cool-app’s package.json add (make sure it is the last object), ”proxy": "http://localhost:3005”} . - this is the express port to get your api’s
-
create account with Auth0, follow documentation for react SPA & look into securing backend -- see node guidelines in Auth0 for users.