Skip to content

Server Side of an E-commerce platform developed as a capstone to my graduation from BrainStation`s Bootcamp

Notifications You must be signed in to change notification settings

andressamachado/vintage-server

Repository files navigation

vintage-server

This is the Server side of the Vintage Culture project. The Frontend can be found here

Every year half a million tons of textiles are dumped by Canadians and this number can be even higher in countries like the USA where 11.3 Million tons are dumped every single year. Those textiles will end up in countries like India, Chile, Kenya, and Ghana, causing an environmental crisis, especially in those countries.

Vintage Culture emerged with the purpose of making thrifting part of our shopping routines. To increase the lifespan of our clothes by putting them on the market again after they do not fit us anymore. Our goal here is to make an application as practical as possible, easy to navigate through, and intuitive so it can be incorporated into our lives with ease.

A little presentation about the project

Tech Stack

652581_code_command_develop_javascript_language_icon 8546986_node_icon Screenshot 2023-10-18 at 6 23 16 PM icons8-jwt-48 pngwing com 62a73b7d223343fbc2207cf3

Endpoints [ WIP ]

Get a list of users registered (for test purposes)

GET /api/users/

Get a single user instance selected by the id

GET /api/users/:userId

Register a new user

POST /api/users/register

note: by default, the user is registered as a buyer ( value of 0 ). To register as a vendor, for now, it has to be directly from an HTTP request.

Request`s body example:

{
    "first_name": "admin",
    "last_name": "admin",
    "email": "admin@email.com",
    "password": "9876",
    "phone": "+1 (919) 797-2875",
    "address": "123 Rue St.",
    "isAdmin": 1
}

Sign in

POST /api/users/sign-in

Request`s body example:

    "email": "user@email.com",
    "password": "1234"
}

Running locally

  1. You will need MySql installed.

  2. Populate your .env ( present as .env.example, remove the .example before ) with your database configuration.

  3. run npm install to install the packages.

Perform the following commands inside the database folder:

  1. run knex migrate:latest to create the tables on your database.

  2. run knex seed:run to populate your tables with initial values.

On the root folder:

  1. run the server using npm start

Data

To get the application running locally, Migration and Seed files are present under the database folder to populate the database. We use MySql2 on this project.

Database relational diagram [ WIP ]

Finally

It is a project in development and any feedback is welcomed and appreciated! Thank you for taking the time to study my project this far.

About

Server Side of an E-commerce platform developed as a capstone to my graduation from BrainStation`s Bootcamp

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published