Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lissone/point-control-api
Api of a company points control application.
https://github.com/lissone/point-control-api
express nodejs nodemailer redis swagger typeorm typescript
Last synced: 3 days ago
JSON representation
Api of a company points control application.
- Host: GitHub
- URL: https://github.com/lissone/point-control-api
- Owner: Lissone
- Created: 2021-05-11T15:49:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-28T21:18:55.000Z (over 1 year ago)
- Last Synced: 2023-04-28T23:46:33.744Z (over 1 year ago)
- Topics: express, nodejs, nodemailer, redis, swagger, typeorm, typescript
- Language: TypeScript
- Homepage:
- Size: 489 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PointControl - Api
Description |
Demonstrations |
Requirements |
Technologies |
Usage |
Contributors
## Description
This project is the Back-end (Api) of a company point control application. To illustrate in a simple way, this api controls and stores all employee data, entry points, exit, pause, absences from work and all this being managed by employees of the company itself, who have specific and special credentials for this.
Project developed as an activity of my bachelor's degree in information systems, with the main objective of having a very descriptive and extensive documentation, for anyone to understand the features and learn from it. The api framework was built on clean architecture and documented with Swagger.
To facilitate the development of the project and better describe everything that was created, a flowchart of some of the project's features and relevant information at the time of its development was designed, using Whimsical.
To access the other projects integrated to this one, access:
- Front-end to admin users
- Front-end to employeesThis project was done in partnership with:
- Moises Morais
- Stenio Rapchan
- Vinicius Almeida## Demonstrations
Front-end to admin users
https://user-images.githubusercontent.com/57052110/194934760-04bbc99d-4cce-464e-a93d-7f47beb80742.mp4
Front-end to employees
https://user-images.githubusercontent.com/57052110/200085812-502e5746-05b4-4497-82eb-796c923ff65b.mp4
## Requirements
- [Npm](https://www.npmjs.com/)
- [Yarn](https://yarnpkg.com/)
- [Nodejs](https://nodejs.org/en/)
- [Redis](https://redis.io/)
- [SqlServer](https://www.microsoft.com/pt-br/sql-server/sql-server-downloads)## Technologies
- Nodejs
- Typescript
- Express
- TypeORM
- IoRedis
- Nodemailer
- Swagger (Documentation)
- Eslint
- Airbnb-config with another pessoal rules
- Import helpers plugin
- Prettier
- Commitizen## Usage
You can clone it on your pc using the command:
```bash
git clone https://github.com/Lissone/pointControl-api.git
cd pointControl-api
```### Initial settings before running project
Because we use external services, it is necessary to make some simple configurations before running the project.
### Database configuration
You must create the database before running an api (dbPointControl).
```typescript
// .\src\external\database\dbConfig.tsconst connection = createConnection({
type: 'mssql',
host: process.env.DB_HOST,
port: 1433,
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
entities: [**Entities**],
synchronize: true,
logging: false,
options: {
enableArithAbort: true
}
})
```Need create first global admin user:
Default password: 123456
```sql
INSERT INTO [dbo].[user]
(id, name, email, password, role, first_access, company_cnpj, created_at, updated_at)
VALUES (
'08e5ad8d-5fa3-41a2-a732-b997336b4cf5',
'Global Admin',
'[email protected]',
'$2a$05$MG6XoOEDPjtXVesTW8P2S.UkNzii1ai7VEAvBnToDHZq03sSij2vi',
'global.admin',
1,
NULL,
'2001-12-11T22:30:00Z',
'2001-12-11T22:30:00Z'
)
```### Email configuration
If you are using your gmail account to use the messaging system with Nodemailer, you should give access to your account to less secure apps, even though they are secure.
Need to add environment variables:
```bash
# .\.env# DEFAULT
# APP
APP_PORT=5000
APP_NAME=point-control-api
APP_VERSION=0.0.0# AUTH
SECRET_KEY=super_scret # JWT secret key# REDIS
REDIS_HOST=localhost
REDIS_PORT=6379# DATABASE
DB_USERNAME=sa
DB_PASSWORD=123456
DB_NAME=dbPointControl
DB_HOST=localhost# NODEMAILER
NODEMAILER_USER= # Email used for sending messages
NODEMAILER_PASS= # Your email password
```If you have Docker, and want to run the container, use the command:
```bash
# Build the project container
docker-compose build
# Up container
docker-compose up
```Install dependencies using:
```bash
yarn
#or
npm install
```Run api:
```bash
yarn dev
#or
npm run dev
```## Contributors
Thanks goes to these wonderful people, who were part of the project from start to finish:
Moises Morais
Stenio Rapchan
Vinicius Almeida
## License
Distributed under the MIT License. See `LICENSE` for more information.