Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tamimehsan/node-architecture-with-oracle
https://github.com/tamimehsan/node-architecture-with-oracle
Last synced: about 15 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/tamimehsan/node-architecture-with-oracle
- Owner: TamimEhsan
- License: mit
- Created: 2021-11-16T20:25:37.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-17T09:59:23.000Z (about 3 years ago)
- Last Synced: 2023-03-05T05:03:50.405Z (almost 2 years ago)
- Language: JavaScript
- Size: 55.7 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Node-Architecture
This is aimed to create a basic architecture for data flow in nodejs.
The structure is separated in several layers.
Some major functionality that is implemented now is
- Router
- Passport Authentication
- Validation middlewares (Not included in this one)
- Controller
- Service (Didn;t use in this project)
- Repository
- Oracle Database Connection## Data Flow
### Router
- At first http request is accepeted from app.js and routed to route/api.js
- There it is passed to whatever path it is### Authentication
Router here checks if the user is authorized or not. It filters all the api calls in api route### Validation
Validation middleware validates and sanitized the user input to minimize security risks. Not included in this project### Controller
- The main/business logic is implemented is controller layer
- It asks for data from service layer (But for this straight from repository)### Service
Not included
- Service layer implements all logic related to sql queries
- But it doesn't fetch the data itself### Repository
- Repository is where the query is executed and served
- Redis or Node Caching is done here (Not included)## Download
Download zip of this repository, or clone this from git cli
## Dependencies
The project runs on NodeJS environment. So at first you should download node in your machine. Bear in mind node takes huge amount of to download
## Installing
Run the script
```
npm install
```## Configure
The envionment variables and other sensitive info like password are kept in a env file. Create a `.env` file in the root folder.
Add the following variables in it```dotenv
PORT=4000
DB_USER=YOUR_DB_USER
DB_PASS=YOUR_DB_PASSWORD
DB_CONNECT_STRING=YOUR_DB_CONNECT_STRING
JWT_SECRET=YOUR_JWT_SECRET
```## Executing program
Run the script
```
npm start
```
to start nodemonitor realtime updater for node environment.
To kill process type cltrl+c in terminal## Help
Any advise for common problems or issues ask directly
## Authors
Contributors names and contact info
Tamim Ehsan
## Version History
* 0.2
* Sequelize, redis, service layer removed
* Changed from POSTGRE to ORACLE
* 0.1
* Initial Release## License
This project is licensed under the MIT License - see the LICENSE.md file for details