REST API Developed with Node.js, Express, Typescript and Mongoose to provide datas from a Mongodb database to a Front-End application.
The idea of this application is to provide the relationship between the Siscop-REACT application with the database MongoDB, where the data, necessary for the perfect functioning of that application, are kept.
- User's passwords go through a password hashing process.
- Sessions are managed by express-session and kept in database for 30 minutes.
- Mongodb database
git clone https://github.com/Cardosojl/siscop-API.git ./siscopApi
cd siscopApi
npm install
touch .env
- PORT= (port value the API will run on)
- HOST= (api host)
- dbNAME = (your database name)
- dbURI= (mongodb uri) ex:
mongodb://username:password@host:port/databaseNAME?options
- SECRET= (session secret)
- ORIGIN= (origins that will be allowed in cors. They need to be separated by commas ',')
npm run migrate up
npm start
- To be able to make requests, you must log in. Login is by accessing the URL
HOST:PORT/login
and in the body of the request it is necessary to pass the parameters"name": "ADM"
"password": "123456"
-
Login - Used to log in (necessary to use the application)
-
Users - Manage application users
-
Processes - Manage application process
-
Process States - Manage processes states
-
Sections - Manage the sections present in the Entity/Company
-
Years - Manage processes years
-
Acquisition Ways - Manage the kind of processes
-
Messages - Manage received messages
-
Messages Sent - Manage Sent messages
-
Messages Archived - Manage Archived messages
-
Files - Manage processes files
-
Index - Displays all collection elements: GET
HOST:PORT/users
-
Show - Displays only one element from the collection (It is necessary to use some search filter): GET
HOST:PORT/users/user?name=ADM
-
Store - Saves an element within the collection (It is necessary send the body request): POST
HOST:PORT/users
-
Update - Update a collection element (It is necessary send the body request and a search filter): PUT
HOST:PORT/users?name=ADM
-
Delete - Delete an element from the collection (It is necessary to use some search filter): DELETE
HOST:PORT/users?name=ADM