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
GET /api/users/
GET /api/users/:userId
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": "[email protected]",
"password": "9876",
"phone": "+1 (919) 797-2875",
"address": "123 Rue St.",
"isAdmin": 1
}
POST /api/users/sign-in
Request`s body example:
"email": "[email protected]",
"password": "1234"
}
-
You will need MySql installed.
-
Populate your .env ( present as
.env.example
, remove the.example
before ) with your database configuration. -
run
npm install
to install the packages.
Perform the following commands inside the database
folder:
-
run
knex migrate:latest
to create the tables on your database. -
run
knex seed:run
to populate your tables with initial values.
On the root folder:
- run the server using
npm start
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.
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.