Our e-commerce web application server, developed by Team Ninjas, facilitates smooth online shopping with features like user authentication, product cataloging, and secure payments. It's built to enhance the user experience with high performance and reliability. Suitable for any online marketplace looking to grow.
https://e-commerce-ninjas-platform-backend.onrender.com/
https://e-commerce-ninjas-platform-backend.onrender.com/api-docs
https://github.com/atlp-rwanda/e-commerce-ninjas-bn
- Welcome Endpoint
- Register Endpoint
- Verification Email Endpoint
- Resend verification Endpoint
- Login Endpoint
- Admin get users Endpoint
- Admin get user Endpoint
- Admin Update Status Endpoint
- Admin Update Role Endpoint
- Logout Endpoint
- Update User Profile Endpoint
- Get User Profile Endpoint
- Login Via google account
No | VERBS | ENDPOINTS | STATUS | ACCESS | DESCRIPTION |
---|---|---|---|---|---|
1 | GET | / | 200 OK | public | Show welcome message |
2 | POST | /api/auth/register | 201 CREATED | public | create user account |
3 | GET | /api/auth/verify-email/:token | 200 OK | public | Verifying email |
4 | POST | /api/auth/send-verify-email | 200 OK | public | Resend verification email |
5 | POST | /api/auth/login | 200 OK | public | Login with Email and Password |
6 | GET | /api/user/admin-get-users | 200 OK | private | Admin get all users Endpoint |
7 | GET | /api/user/admin-get-user/:id | 200 OK | private | Admin get user Endpoint |
8 | PUT | /api/user/admin-update-user-status/:id | 200 OK | private | Admin Update Status Endpoint |
9 | PUT | /api/user/admin-update-role/:id | 200 OK | private | Admin Update Role Endpoint |
10 | POST | /api/auth/logout | 200 OK | private | Logout user |
11 | PUT | /api/user/user-update-profile | 200 OK | private | Update User Profile Endpoint |
11 | GET | /api/user/user-get-profile | 200 OK | private | Get User Profile Endpoint |
12 | GET | /api/auth/google | 200 OK | public | Login Via google account |
-
Clone the repository:
git clone https://github.com/atlp-rwanda/e-commerce-ninjas-bn.git
-
Install dependencies:
npm install
-
Copy
.env.example
to.env
and add values to all variables. -
Start the server:
npm run dev
-
.env
: Secure environment variables. -
src/
: Source code directory.databases/
: Database related files.config/
: Database connectivity configuration.models/
: Sequelize models.
middlewares/
: Middleware functions.modules/
: Modules like User, Products, etc.user/
: user module.controller/
: user controllers.repository/
: user repositories.test/
: user test cases.validation/
: user validation schemas.
routes/
: API routes.helpers/
: Utility functions.validation/
: Validation schemas.services/
: Service functions like sendEmails.index.ts
: Startup file for all requests.
- Initialize Sequelize CLI:
npx sequelize-cli init
- Generate Seeder:
npx sequelize-cli seed:generate --name name-of-your-seeder
- Generate Migrations:
npx sequelize-cli migration:generate --name name-of-your-migration
- Define Migration: Edit the generated migration file to include the tables you want to create.
- Define Seeder Data: Edit the generated seeder file to include the data you want to insert.
- Run the Seeder:
npm run createAllSeeders
- Run the Migration:
npm run createAllTables
- Delete the Seeder:
npm run deleteAllSeeders
- Delete the Migration:
npm run deleteAllTables