Skip to content

LuonaMill/my-vinted-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Logo

Replica project : Vinted API

My very first back-end project from zero, improved along my intensive training @ Le Reacteur Paris

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage

About The Project

Welcome to this API project ! I did not know what a backend could look like a few months ago, and I am so happy with this first project where I learned so much about server side, database, routes, and so on. Thanks to this project, I can now run a full stack Vinted replica project for both web and mobile apps. Please find my replicas for Vinted front-end projects here :

(back to top)

Built With

  • Platform : Node.js
  • Framework : Express
  • Database : MongoDB
  • Pictures upload & storage : Cloudinary
  • Payment : Stripe

(back to top)

Getting Started

To use this API you can request to the online API, hosted with Northflank : https://site--backend-vinted--wbbmf4gr4bwy.code.run/

Installation

  1. Clone the repo
    git clone https://github.com/your_username_/Project-Name.git
  2. Install NPM packages
    npm install
  3. Add your environment variables in a .env file with :
MONGODB_URI=
CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=
SK_STRIPE=
PORT=
  1. Start server
    npx nodemon

(back to top)

Routes

User

/user/signup (POST)

Create a new user

Body Type Required
email string Yes
password string Yes
username string Yes
phone string No


/user/login (POST)

Log a user

Body Type Required
email string Yes
password string Yes


Offer

/offers/ (GET)

Receive a list of offers. Possibility to filter the results.

Query Required Description
title No get a list of offers that contain title
priceMin No get offers above priceMin
priceMax No get offers below priceMax
sort No date-asc : get a list of offers sort by ascending dates
date-desc: get a list of offers sort by descending dates
price-asc: get a list of offers sort by ascending prices
price-desc: get a list of offers sort by descending prices
page No set the results page
limit No set the limit of results


/offer/:id (GET)

Get an offer using its id

Param Required Description
id Yes offer id


/offer/publish (POST)

Create a new offer

formData Required Description
title Yes offer title
picture Yes product picture
category Yes product category
price Yes product price
description No product description
brand No product brand
size No product size
condition No product condition
color No offer color
city No the city in which the offer is located

Headers Required Description
Bearer token Yes user token


(not available yet) /offer/update/:id (PUT)

Update an offer



(not available yet) /offer/delete/:id (DELETE)

Delete an offer



Favorites

/favorites/:userId (GET)

Get identified user's favorites

Param Required Description
userId Yes user id


/favorites/:userId (PUT)

Add an article to favorite

Body Required Description
offerId Yes offer id
userId Yes user id


/favorites/:userId (DELETE)

Delete an article from favorites

Body Required Description
offerId Yes offer id
userId Yes user id


Payment

/payment/ (POST)

Handle payments through Stripe

Body Type Required
stripeToken string Yes


(back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published