Skip to content

fac19/work-in-progress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Work In Progress

WIP - Fresh eyes for fresh ideas

A social media platform for creatives to receive feedback on their works in progress.

Weeks 11-13 Student Project

Deployed on Netlify

Netlify Status

Build Status

In this README

  1. Database set up
  2. Scripts codecov
  3. API routes Run in Postman

Credits

Logo designed by Jessica Gooding

The team

Kat - Scrum Master

Campbell - UX/UI lead

Hannah - DevOps lead

Jack - QA lead

Technologies Used:

  • React
  • Node
  • Express
  • PostgreSQL
  • Jest
  • Husky
  • Codecov
  • ES Lint
  • Prettier

Prototype:

First draft protoyped in Figma for user testing


Working with our project

Database set up

schema

Add the following information into a .env file inside the wip-rest-api/ folder:

PGDATABASE=wip_db
PGUSER=user
PGPASSWORD=password
JWT_SECRET=jwtsecret

How to set up development and test databases:

Set up instructions

  1. git clone this repo
  2. cd into wip-app directory and npm install
  3. Type in psql in terminal and hit enter.
CREATE USER user WITH PASSWORD 'password';
ALTER USER user WITH SUPERUSER;

Initialise the dev and test databases:

CREATE DATABASE wip_db WITH OWNER user;
CREATE DATABASE wip_test WITH OWNER user; -- database name is important for tests to run
\c wip_db;
\i database/init.sql;
\c wip_test;
\i database/init.sql;
  1. Ensure the test script in package.json refers to your local test database, i.e.
  "scripts": {
    "test": "PGDATABASE=wip_test jest src/test/*.test.js --watch"
  }
  1. Run npm test to run tests inside wip-rest-api directory
  2. Run npm run dev to start development server
  3. If you are having issues with anything related to accessing the databases you have created, you may need to assign your user again:
    • ALTER DATABASE wip_db OWNER TO user;

Scripts

You can set everything up using CLI from the project root.

npm run i-all => installs everything you need

npm run app => runs the front end on localhost:3001

npm run api => runs the back end on localhost:3000 (once you've set up your database)

Tests

Jest is used for all testing.

npm test => run tests for whole project; press q once you're happy with each review

npm run app-test => test just the front end

npm run api-test => test just the back end

API routes

REST API deployed on Heroku
You can make requests to the Heroku App URL, e.g. POST to https://wip-rest-api.herokuapp.com/signup

πŸ” = Authorization required

Users

POST /signup

Creates access token

Request body example:

{
  "username": "username",
  "email": "[email protected]",
  "bio": "graphic design is my passion",
  "vocation": "graphic designer",
  "password": "password"
}

POST /login

Receive access token

Request body example:

{
  "username": "username",
  "email": "[email protected]"
}

GET /user πŸ”

Get your user info when signed in

PUT /user πŸ”

Update your user info

Request body example:

{
  "bio": "I love Comic Sans",
  "vocation": "graphic designer"
}

Projects

GET /project/:projectid πŸ”

Get a project by project id

GET /followedprojects πŸ”

Get your watched (followed) projects

GET /userprojects πŸ”

Get your own projects

GET /exploreprojects πŸ”

Get your unwatched (unfollowed) projects

POST /newproject πŸ”

Add a new project to your account

Request body example:

{
  "project_name": "new project",
  "project_description": "first sketch, feedback welcome"
}

Steps

GET /steps/:projectid πŸ”

Get project steps by project id

POST /steps/:projectid πŸ”

Add project steps by project id

Request body example:

{
  "step_name": "Sketch in pen",
  "step_description": "Adding more details",
  "step_link": "image.jpg"
}

Feedback

GET /feedback/:stepid πŸ”

Get feedback for step by step id

POST /feedback/:stepid πŸ”

Add feedback for step by step id

Request body example:

{
  "feedback": "wow, that's amazing!",
  "tag": "compliment"
}

PUT /feedback/:feedbackid πŸ”

Update feedback by feedback id

Request body example:

{
  "feedback": "wow, that's really amazing - keep up the good work!",
  "tag": "compliment"
}

Watching

POST /watching/:projectid πŸ”

Start watching (following) a post by project id

DELETE /watching/:projectid πŸ”

Stop watching (following) a post by project id


Co-authored-by: Alexreid95 [email protected] Co-authored-by: Hannah Gooding [email protected] Co-authored-by: CampbellDocherty [email protected] Co-authored-by: Jack Heriz-Smith [email protected]

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •