This is the project for MyUI - a contextual UI generation tool. This is part of the Software Engineering Project for BCS students 2021-22 at the Eindhoven University of Technology.
Boilerplate author: Nishad Guha (n.guha1@student.tue.nl)
Run the command make setup
in the project directory. This will build and run the docker containers, install frontend dependencies, create the database connection in Hasura as well as apply all the migrations.
- Clone this repository
cd
into the project folder- Run
npm i
to install all node dependencies - Run
yarn
to install all yarn dependencies - Make sure you do not have already running docker containers in this directory and run
make build-dev
to create the development environment. - Open Hasura console:
make console
- Check Hasura console for an existing database schema. If there are none, create a database schema under the
Data
tab calledHasura-test
. - Close Hasura console with
Ctrl + C
and run all database migrations:make run-migrations
- Open http://localhost:3000 to view the React frontend in the browser.
In the project directory, you can run:
This builds and runs the containers in the development mode.
Open http://localhost:3000 to view the React frontend in the browser.
The page will reload if you make edits.
The Postgres database runs on port 5432.
Builds the React app for production to the build
folder and hosts it on an NGINX server.
Open http://localhost:8000 to view the React frontend (production mode) in the browser.
Your app is ready to be deployed!
This runs the containers in the development mode.
Open http://localhost:3000 to view the React frontend in the browser.
The page will reload if you make edits.
The Postgres database runs on port 5432.
This runs the React app for production and hosts it on an NGINX server.
Open http://localhost:8000 to view the React frontend (production mode) in the browser.
Your app is ready to be deployed!
This restarts the all containers in the currently running environment.
This runs the Hasura console.
Open http://localhost:9695 to view the Hasura-GraphQL console in the browser.
For any change made to the database in the Hasura console, a migration is automatically generated in the directory ./hasura/migrations
This squashes all the migrations in the hasura folder starting from the migration mentioned in the from
argument. The from
argument receives the ID of the migration from which you want to start squashing till the last migration available. Please also give the squashed migration a name with the name
argument first. Whether you want to delete the previous migrations or not is your own choice.
Squashed migrations are generated in the directory ./hasura/migrations
This checks the code quality for the entire project and gives a detailed list of errors.
In order to disable linting for a particular line, the comment // eslint-disable-next-line
can be used.
This will run all available tests.
- Download Make for Windows: http://gnuwin32.sourceforge.net/packages/make.htm
- Add the path (i.e. C:\Program Files (x86)\GnuWin32\bin) to your Path variable
- Restart your pc