Code Monkey home page Code Monkey logo

backend-java's Introduction

Backend-Java

Table of contents

Overview

Water My Plants

Ensuring that all your plants are consistently watered is actually pretty difficult. Water My Plants is an app that helps to solve those problems.

With an easy to use interface for creating a plant watering schedule tailored to each individual plant, WaterMyPlants will remind users when it's time to feed that foliage and quench your plants' thirst.

API endpoints

⬆ Belows are only some basic endpoints, check out for more endpoints ⬆

Authentication

Method Endpoint Body (required) Comments Notes
register POST /api/auth/register username, password, phonenumber Creates a new user in the database.
login POST /api/auth/login username, password axios.post('https://jren-watermyplants.herokuapp.com/api/auth/login', <br>'grant_type=password&username=${form.username}&password=${form.password}', {<br>headers: <br>{'Basic ${btoa('lambda-client:lambda-secret')},<br>'Content-Type': 'application/x-www-form-urlencoded}) Returns a access token. (res.data.access_token)
logout GET /api/auth/logout AxiosWithAuth (required) Revokes the token of current user

➡ To access endpoints for users and plants, MUST include a request header as follows ⬅

For GET, DELETE: headers: {Authorization: 'Bearer ${token}'} For POST, PUT, PATCH : headers: {Authorization: 'Bearer ${token}', Content-type: 'application/json'}

EndPoints for Users

Method Endpoint Body (required) Comments Notes
get current user info GET /api/users/info Returns info of current user
update user PUT /api/users/:id username, password, phonenumber Updates the user with user id
delete user DELETE /api/users/:id Deletes the user with user id

Endpoints for Plants

Method Endpoint Body (required) Comments Notes
get plants GET /api/plants Fetches all plants of current user
add plant POST /api/plants nickname, species, h2ofrequency, image add plant to current user's plants
update plant PUT /api/plants/:id nickname, species, h2ofrequency, image Update plant with plant id
delete plant by Id DELETE /api/plants/:id Delete Plant by Id

backend-java's People

Contributors

jiayi-ren avatar

Watchers

James Cloos avatar

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.