Opla.ai Backend using Node es7 react and redux.
First of all, make sure you have Node 8.x and Yarn installed.
You will also need MariaDB 10.2 or mysql 5.7. We provide a Docker Compose configuration to get you started quickly.
-
Install the (dev) dependencies:
$ yarn install
-
Run the configuration tool:
$ bin/opla init
Important: if you want to use Docker Compose, accept all the default settings and run
docker-compose up -d
, otherwise configure your MariaDB instance. -
Run the migrations:
$ bin/opla migrations up
-
Start the dev environment:
$ yarn dev
This application should be available at: http://127.0.0.1:8081/.
We use flyway to manage the
database migrations with a specific configuration for this project. By using the
bin/opla
tool, this configuration is automatically generated and db-migrate
is bound to the bin/opla migrations
command.
-
Read about terminology here : https://flywaydb.org/documentation/migrations.
-
Add your migration file to this repo under migrations/sqls
To apply all migrations at once, run:
$ bin/opla migrations up
The CI/CD pipeline produces a Docker image that you can use to run the Backend.
env | default | description |
---|---|---|
SKIP_MIGRATIONS | false | Skips the database migration step. Useful for production use, where database schema is most likely already set. |
MIGRATIONS_ONLY | true | Only does the migration step. Useful for production use, to use the backend container to initialise the db for the very first time. |
OPLA_BACKEND_DATABASE_HOST | db | Database host |
OPLA_BACKEND_DATABASE_NAME | opla_dev | Database name |
OPLA_BACKEND_DATABASE_USER | opla | Database user |
OPLA_BACKEND_DATABASE_PASS | foo | Database password |
Please, see the CONTRIBUTING.md file.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See CODE_OF_CONDUCT.md file.
You have 2 options:
- pass ENV variables to override config properties one by one. See Dockerfile ENV
statement for available environment variables.
- override config.json
by mounting your own /src/config/config.json
file. You can create such a file by running bin/opla init
locally.
opla-front is released under the GPL v2.0+ License. See the bundled LICENSE file for details.