Giter Site home page Giter Site logo

unit2-project-anime-blog's Introduction

How to install this app on their local machine:

1. Clone code by coping URL: https://github.com/JoeyZ56/unit2-project-anime-blog.git

2. Open terminal make a folder you want to put the code in "mkdir anime-blog-clone"

3. From terminal (and in the folder you want code to be) run command "git clone https://github.com/JoeyZ56/unit2-project-anime-blog.git"

4. cd to "unit2-anime-blog" from terminal

5. run terminal command "code ." to open files in VS code

Global installations you need and files you need to create that didn't come in the github repo:

Installations requires:

- (You will need Node Js installed globally on your computure) From terminal be in file location that "unit2-anime-blog" is in or cd there then npm i to install all dependencies

Files to add:

- (For this next step you must have a Mongodb atlas account) From terminal in code location make a file called ".env" place your MONGO_URI and your "SHA-256" hashed SECRET in this file

    MONGO_URI=
    SECRET=

How to start the app in dev mode:

To start the app in dev mode from the terminal run command line "npm run dev"
You will know server is up and running when the terminal says "Our army is 3000 strong", and "Mongo is witchcraft"

How to make an api request in Postman (i.e what port, what url etc):

Manual testing with Postman:

URL: http://localhost:3000, PORT:3000

From breadcrum:

Body -> raw -> json

For user testing:

Create user: Post route -> http://localhost:3000/users -> (follow steps from models/user.js) body{
"name": " ",
"email": " ",
"password": " "
} -> send request

Login user:

Post route -> http://localhost:3000/users/login -> (remove "name") body{
"email": " ",
"password": " "
}
copy token -> breadcrum: Auth {type: Bearer Token} paste token -> send

Update user:

Put route -> http://localhost:3000/users/:id -> (only keep what your updating) body{
"email": "different email"
} -> (copy :id put at the end of /users/) -> copy token -> breadcrum: Auth {type: Bearer Token} paste token -> send

Delete user:

Delete route -> http://localhost:3000/users/:id -> (copy :id put at the end of /users/) -> copy token -> breadcrum: Auth {type: Bearer Token} paste token -> send

Logout user:

Post route -> http://localhost:3000/users/logout -> copy token -> breadcrum: Auth {type: Bearer Token} paste token -> send

For testing Posts: (user must be logged in for testing all routes)

Create Post: Post route - http://localhost:3000/posts -> body{
"title": " ",
"description": " "
} -> copy token -> breadcrum: Auth {type: Bearer Token} paste token -> send

Update Post:

Put route -> http://localhost:3000/posts/:id -> (only keep what your updating) body{
"title": " "
} -> (copy :id put at the end of /users/) -> copy token -> breadcrum: Auth {type: Bearer Token} paste token -> send

Delete Post:

Delete route -> http://localhost:3000/posts/:id -> (copy :id put at the end of /posts/) -> send

Show user posts:

Get route -> http://localhost:3000/posts/:id -> (copy :id put at the end of /posts/) -> send

Show posts feed:

Get route -> http://localhost:3000/posts/feed -> (copy :id put at the end of /posts/) -> send

How to run tests:

- For Jest testing: From the terminal (make sure your not connected to Mongodb server), write in command line "npm i test" this will start the Jest testing for posts / user tests (ALL 8 should be passing).

- For Artillery testing: Open a sepreate terminal (make sure your connected to mongodb in the main terminal) cd to the folder that hold all the files for the blog then in that seperate terminal run command "npm run load" (Should get 20 (200) message from results)

How to start the app without dev mode:

- (Make sure you not in "Dev Mode") in terminal run command "npm run start"

WIREFRAME: https://excalidraw.com/#json=yrBXBk5BACny5M8wS7L33,MpY6UyOztplZLnzp2_lZMw

Diagram: https://lucid.app/lucidchart/65e88c1f-90c5-43cb-9afa-a2f4405bb371/edit?viewport_loc=-194%2C-178%2C1590%2C748%2C0_0&invitationId=inv_05ca3a98-9a46-4d06-be12-118fdcf3e4d1

unit2-project-anime-blog's People

Watchers

Joey Zazzi avatar

unit2-project-anime-blog's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.