This is back-end API for e-commerce in Team emma
The backend API for an e-commerce app
You can clone this repo and start to add/change some features
- Languages
- TypeScript
- Package Manager
- npm
- Software
- NodeJs
- PostgreSQL
- Text Editor or IDE
- Testing
- jest
- supertest
- API Documentation
- Swagger Documentation
- Stack to use PERN: PostgreSQL ExpressJS ReactJS NodeJS
git clone https://github.com/atlp-rwanda/e-comm-team-emma25-bn.git e-commerce-backend
cd e-commerce-backend
npm install
run npm list
if you find UNMET or other package related errors re-install npm i
Before running the app you need to create .env file to write environment variables
touch .env
Required Environment Variables
PORT =
JWT_SECRET =
DBLINK =
TWILIO_AUTH_TOKEN =
TWILIO_SERVICE_SID =
TWILIO_PHONE_NUMBER =
TWILIO_ACCOUNT_SID =
CLIENT_ID=
CLIENT_SECRET=
CallBackURL=
USER=
NODEMAILER_CLIENT_ID=
MODEMAILER_CLIENT_SECRET=
MAILER_REFRESH_ACCESSTOKEN=
MAILER_ACCESS_TOKEN=
FAKE_TOKEN =
SELLER_TOKEN =
DBLINK is an online postgresql DB you can put your own
npm start
or
npm run dev
To run the tests you have to run:
npm run test
To write the test for your features you need to place your test files in the __tests__
directory in your working directory
Your tests files should be named like filename.test.ts
📦src
┣ 📂config # Configuration files like auth configs
┣ 📂controllers # All Controller classes/functions.
┣ 📂db # Includes all database data/configs/models/migrations ...
┃ ┣ 📂migrations # Migration files
┃ ┣ 📂models # All models
┣ 📂docs # Includes swagger doc configurations
┣ 📂helper # All helpers to be used
┣ 📂middlewares # Application middlewares
┣ 📂models # Some app models [Soon will be moved into db/models]
┣ 📂routes # All Application routes
┣ 📂utils # App instance file
Feel free to create/add a feature or report a bug.
You can pull a request here 👉Create a pull request.
Report a bug here 👉Submit issue
🛑⚠ Read Engineering Playbook You can follow these steps in order to contribute on this project:
- Create a branch
git checkout -b prefix-branch-name
prefix can be:- ft: feature
- bg-fx: bug fix
- After all your changes (includes documentation) push the source codes
- Open a pull request
- Tag at least 2 team members for review and make sure to add a label for the branch status.