The goal of the association is to add paid ADS with specific duration and location in the application (popup
or above-footer
or under-services
) and the type of target device (mobile
or desktop
or both
) for this ADS through the website's owner, where users can see ADS after they login and activate their account via email.
Step 1
: To use this project must install Node.js and pgadmin Then Download the source code
git clone https://github.com/MohamedAlabasy/Node.JS-ADS-System.git
Step 2
: Enter the project file then install package
npm i
Step 3
: Open pgadmin then create a database called ads_system
, then to run migrations :
db-migrate up
├── src
│ ├── controllers
│ │ ├── adsController.ts => `for handel ADS function`
│ │ └── authController.ts => `for handel authentication function`
│ │
│ │
│ ├── middleware
│ │ ├── morganMiddleware.ts => `for log url, method and statue of requests`
│ │ │── notFoundMiddleware.ts => `for not Found Middleware`
│ │ └── errorMiddleware.ts => `for error Middleware`
│ │
│ │
│ ├── models
│ │ ├── emailVerificationModels.ts => `for handel email verification Models`
│ │ │── resetPasswordModels.ts => `for handel reset password Models`
│ │ │── adsModels.ts => `for handel ADS Models`
│ │ └── userModels.ts => `for handel user Models`
│ │
│ │
│ ├── Public
│ │ └── assets => `contains ADS (photos and videos)`
│ │
│ │
│ ├── routes
│ │ ├── api
│ │ │ │── authRouter.ts => `for handel authentication route`
│ │ │ └── adsRouter.ts => `for handel ADS route`
│ │ └── routes.ts => `import all routes and exports it to index`
│ │
│ │
│ ├── tests => `for testing purposes`
│ │ ├── helpers
│ │ │ └── reporter.ts
│ │ └── indexSpec.ts => `for testing endpoint api`
│ │
│ │
│ ├── utilities
│ │ ├── helpers
│ │ │ │── emailVerification.ts => `for send email message`
│ │ │ └── emailMessagesDesign.ts => `for email messages design ( HTML & CSS )`
│ │ │── checkTokens.ts => `for Request check Tokens`
│ │ └── validateRequest.ts => `for validate Request`
│ │
│ │
│ └── index.ts => `to run the server`
└──
Step 4
: To run project
node run start
Step 5
: Open postman and import : API Collation You will find it in the project file.
After completing the registration as a new user, you must go to your email to confirm the email through the code sent to you
To run eslint to check error
npm run lint
To run eslint and auto fixed error
npm run lint:f
To compile the TS code
npm run build
To run the JS code
node dist/index.js
Here are the Command that were used in the project, You will find it in the project file.