https://github.com/digitalinteraction/thinkactive-api
API component for the thinkactive project
https://github.com/digitalinteraction/thinkactive-api
Last synced: about 1 year ago
JSON representation
API component for the thinkactive project
- Host: GitHub
- URL: https://github.com/digitalinteraction/thinkactive-api
- Owner: digitalinteraction
- License: bsd-2-clause
- Created: 2019-02-06T17:05:11.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-06T17:20:36.000Z (over 7 years ago)
- Last Synced: 2025-02-09T22:11:16.852Z (over 1 year ago)
- Language: JavaScript
- Size: 383 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Think Active Api
## Configure
Add your database and session key in the configuration files:
```text
app/config/db.js
.env
```
## Db Setup
To set up the database for this project use the [SequelizeJs CLI](https://github.com/sequelize/cli) and ensure you have entered your db credentials in the config/db.js (see db.example.js)
```bash
sequelize db:create
```
## Running
To run, use the docker-compose command to spin up the container and run the proejct
```bash
docker-compose up -d
```
## Sequelize CLI
Running sequelize CLI for generating models etc can be done using docker exec (already running docker container)
```bash
# Run the sequelize cli inside your container
docker-compose exec web npx sequelize model:generate \
--name Organisation --attributes name:string, logo:string
# Or run locally (If you have packages installed on the host)
npx sequelize # ...
```
## Sequelize commands
```bash
# Run migrations
docker-compose exec web npx sequelize db:migrate
```
```bash
# Run seeds
docker-compose exec web npx sequelize db:seed:all
```
## Deployment
This project is deployed through [Docker](https://www.docker.com/what-docker). It uses a Continuous Integration to build a docker image when you push a [git tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging) to the GitLab repository.
The project is versioned using NPM's semantic versioning through the `npm version` command.
```bash
# Deploying a version (commit your changes before this)
npm version # ... (minor | major | patch)
git push
# Migrating the live db
docker exec -it your_container_name npm run migrate
```