Sokoni is a swahili word for 'market'. Sokoni is a web-based online shop written in Node.js with Ejs.
The application has the normal online shopping functionality but controls impulsive buying behavior of customers by restricting their spending. This is enabled by periodical account recharge and tracking of currently cart products and totals.
Jest had been used for unit and intergration tests while Selenium has been employed for end-to-end tests.
There are two users of the application, sellers(admins) and customers.
Sellers can add , edit and delete products from the application. They can also view their sales which are shows through dashboards with a variety of charts.
Customers buy products from the shop and see their purchases. They top up their balance at their own convinience which is later deduced during shopping. They are shown the current purchasd items.They can also download invoices as pdf. They have a dashboard showing their current balance and details.
- The home page, product page and pages for different categories have accurate paginations(first page,next page, prev, last page).
- Good feedback message. Success messages are shown in green,errors shown in red and notifications are shown in blue.
- Ultimate validation and standardization of input and output data.
- Incorporation of email for signup and reset confirmations, sms for phone number validation.
- Mobile phone payment integration using M-PESA.
Node.js .
Ejs
Jest for unit and integration testing.
Selenium for End-to-End testing.
Mongo DB database.
Mongoose for Object Document Mapping.
Cloudinary for image hosting.
Sendgrid for email sending.
Twillio for sms sending(used mostly for confirming telephone numbers).
MPesa (a mobile transfer platform in Eastern Africa) for account recharge.
- Resused most page login,sign-up
- Comprehensive unit, integration and end-to-end tests
- Small and single purpose functions, classes, routes, controllers.
- Use of some design patterns such as builder pattern.
- Some tests are failing but most are passing. Includes unit, integrated and e2e testing.
- Can watch the video from the youtube video https://youtu.be/ata3ngksGGU
- clone the repository
- put all key-values pairs for all the fields exported in the src/config/env.js file in a .env file such as MONGO_URI
- run npm install
- npm start
- Open the browser at http://localhost:3000/ (in my case,3000 was set as the PORT number in the .env file. Put your port as the port number when opening in the browser)
- create an empty MongoDB database, say test.
- Put the name of the database in the MONGO_TEST_URI field in the .env file.
- Download chrome driver for your chrome version and include the path where one has unziped it in the PATH in the system. The chrome driver is used to run end-to-end tests
- Run npm test