https://github.com/jusemon/botkeeping-api
A backend demo project
https://github.com/jusemon/botkeeping-api
Last synced: 5 months ago
JSON representation
A backend demo project
- Host: GitHub
- URL: https://github.com/jusemon/botkeeping-api
- Owner: jusemon
- License: mit
- Created: 2022-12-31T04:54:36.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-04T17:24:52.000Z (over 1 year ago)
- Last Synced: 2025-06-29T10:43:24.556Z (12 months ago)
- Language: TypeScript
- Homepage: https://botkeeping.jusemon.com/api/v1/
- Size: 2.65 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Botkeeping API
## Requirements
- Last stable version of redis
- Last stable version of MySQL/MariaDB
- A PC
## Installation
For run locally it needs a `.env` file with the environment variables defined in
the `.env.example`
The database scripts are under the scripts folder, please run them in order.
### Development
ALLOWED_ORIGINS includes a comma-separated list of the allowed CORS sites.
Install dependencies `npm install` or `yarn` To start the project run
`npm run dev` or `yarn dev`
### Production
For run it in docker just run `docker compose up`
Alternatively, you can run the image without cloning this repo using the image
published
[here](https://git.jusemon.com/jusemon/-/packages/container/botkeeping-api/1.0.0)
With docker run (replace ${ENV_VARIABLE} with your values):
```sh
docker run -p ${PORT}:${PORT} -e NODE_ENV=${NODE_ENV} -e HOST=${HOST} -e PORT=${PORT} -e API_VERSION=${API_VERSION} -e ALLOWED_ORIGINS=${ALLOWED_ORIGINS} -e DB_HOST=${DB_HOST} -e DB_DATABASE=${DB_DATABASE} -e DB_USER=${DB_USER} -e DB_PASSWORD=${DB_PASSWORD} -e DB_PORT=${DB_PORT} -e REDIS_HOST=${REDIS_HOST} -e REDIS_PORT=${REDIS_PORT} git.jusemon.com/jusemon/botkeeping-api:1.0.0
```
With docker compose (the ${ENV_VARIABLE} will be taken from the .env
automatically):
```yaml
name: botkeeping
services:
api:
image: git.jusemon.com/jusemon/botkeeping-api:1.0.0
ports:
- ${PORT}:${PORT}
environment:
NODE_ENV: ${NODE_ENV}
HOST: ${HOST}
PORT: ${PORT}
API_VERSION: ${API_VERSION}
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS}
DB_HOST: ${DB_HOST}
DB_DATABASE: ${DB_DATABASE}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_PORT: ${DB_PORT}
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
```
## Libraries Used
- bullmq (for asynchronous work)
- threads (for asynchronous work)
- koa (for api rest)
- mysql2 (for database operations)
## Credits
- Created by Juan Sebastián Montoya
## License
This project is licensed under the
[MIT License](https://opensource.org/licenses/MIT).