This repository contains the source code for a Backend Developer Task: 10Xers, built using Express.js.
Explanation video: https://www.loom.com/share/aed1ee03f4804547954037170711cac6?sid=edd5ff42-6694-45c2-b6e3-d3f4d78f6661
You can access the Postman documentation through this link: Postman Documentation
Alternatively, you can download and import it yourself using the following file:
./Mobile Phone Store.postman_collection.json
- Node.js (minimum version: 16)
- npm (Node Package Manager)
-
Clone the repository to your local machine:
git clone https://github.com/neuthos/10xers-backend-test.git
-
Navigate to the project directory:
cd 10xers-backend-test
-
Install dependencies:
npm install
-
Change your development database config at
src/configs/config.json
: -
Run migration and seeder with:
npm run init-data npm run undo-data (to undo)
- Create a
.env
file in the root directory of the project. - Add the following configurations to the
.env
file:ACCESS_TOKEN_SECRET=[Access token hashing secret] PORT=3000
To start the Express server, run the following command:
npm run dev
The server will start on port 3000 by default. You can access the application by navigating to http://localhost:3000
in your web browser.
index.js
: Main entry point of the application.src/routes
: Contains route handlers for different endpoints.src/controllers
: Contains controller logic for each route.src/services
: Contains service files for handling business logic and data manipulation.src/models
: Contains database models.src/configs
: Contains configuration files.
To run tests, use:
npm run test