Effortlessly sell your second-hand items
Sellio is a platform designed to simplify the process of selling second-hand items. This README will walk you through the setup and basic commands to get started with Sellio
Before starting, ensure you have the following installed:
Node.js(version 16 or higher recommended)
npm(usually bundled with Node.js)
To set up and run Sellio, follow these steps:
-
Clone the Repository Ensure you have a local copy of the Sellio repository. Just clone it
-
Navigate to the
/serverdirectory to manage the backend, and the/clientdirectory for the frontend -
Do
npm installon both directories -
Make sure MongoDB is installed and running, you can get it with
brew services start mongodb-community@8.0in Terminal -
Environment Variables: You need to create .env files for variables:
.env.development.localand.env.test.local. For both there are example files.env.developmentand.env.test. Rename them and put in the needed information. They are ignored in .gitignore and should not leave your computer..env.testis loaded whenNODE_ENV=testis set by a script inpackage.json(e.g.npm run test, see below) -
Get mock Data: Run
npm seedornpm seed_testin the/serverdirectory. It will create mock Data in the sellio Database, depending on the command in a Database called sellio or sellio_testing -
Use the following commands based on your needs (they do work on both directories):
npm run start_test: Starts both the server and client in the testing environmentnpm run start: Launches the application for regular usenpm run test: Executes the test suite to ensure everything is functioning correctly
-
Server tests are located in
/server/testand use mocha, chai and supertest to test the API routes (public and user routes only so far). In the test envionment, authMiddleware will be replaced a small custom middleware which takes the test user from the header sent by supertest, and injects it into the request.
Linting: Use npm run lint to ensure your code matches to project standards