Conecta project fosters partnerships in an innovation ecosystem.
Before running the project, you need to install the the following programs: Docker docker-compose
$ git clone https://github.com/aceleradora-TW/conecta.git
$ cd conecta
Build the docker application image whenever you change the Gemfile. To build it, run the command:
$ make build
The command make build takes a long time so it is recommended to use it only if you really need to change the Gemfile.
To have Companies and Research Centers available in the project you need to import their data from CSV files.
You can find such files in Aceleradora's Google Drive.
The CSV files should be located in:
csv/files/company.csv
csv/files/research_center.csv
With the files in the right folder, you can run the import command (It is faster now, with postgres =D )
$ make db-seed
The database schema must be created before starting the application, or it will crash otherwise. To do so, you have two options:
-
Run the command mentioned above, importing the data from the CSV files
-
Create the schema without any data, by running
make db-migrate
.
Once you set up your schema, you can run the server with:
$ make run
Open browser in:
$ localhost:9393
To run all the tests with Capybara and Rspec, run the command:
$ make test
If you want to access application container bash (terminal), run the following command:
$ make bash
There are a few make targets that help with schema management with PostgreSQL in Docker:
Generate and/or migrate database schema
Which will run DataMapper.auto_upgrade!
.
make db-migrate
Reset database data and recreate schema
Which will run DataMapper.auto_migrate!
.
make db-reset
Access Postgres Client in a running Docker container
make db-console
Insert data from CSV files into a database (see Import Data section of this document to get some context)
make db-seed
Since some of the above operations require a previously started Psql container,
they all execute db-start
, which will start the psql container with
Docker Compose.
Postgres container data are saved in ./data/postgres
https://conectatw-staging.herokuapp.com/
https://conectatw.herokuapp.com/