The project is built in React and Ruby on Rails. There are two main parts of the project - server-side rails application and client-side react application. Backend is written on Rails while React is used to build front-end
In addition to React we are using ES6, Sass and Semantic UI, with Webpack bundler. The structure of the whole project is following:
srcdirectory contains all the source filesdistdirectory keeps production versionstestdirectory is supposed to store all the unit and integration testscfgprovides webpack configuration for test, production and development builds
src/actionscontains all the Redux actionssrc/apicontains the server-side codebase written on Railssrc/componentskeeps all the React Componentssrc/datacontains all the data files used in application (JSON, txt, etc.)src/imagescontains all the media files used in the projectsrc/pagescontains main all the pages user can navigate to using LafTechsrc/stylesdirectory provides stylesheets written in Sass
To be developed....
In order to set up the project on the local machine, at first clone the repo:
git clone git@github.com:prosperi/LafTech.git
Navigate to the project directory:
cd LafTech
Install all the packages:
npm install
Start webpack dev-server:
npm start
After this react will be serving on port 3000, hence navigate to localhost:3000 in your browser and view the client-side.
Create an SSH tunnel to the Lafayette server using
ssh -fN -L 5432:localhost:5432 yourLafUsername@139.147.9.191
You may want to save this as an alias in ~/bash_profile as alias cs320db='ssh -fN -L 5432:localhost:5432 yourLafUsername@139.147.9.191'
Once the ssh tunnel is enabled, configure /config/database.yml to use the port 5432, your lafayette username and your LID as a password (copy from previous project). You can now proceed to the next steps.
Follow this tutorial to set up Ruby and Rails
To start the rails server, navigate to api directory:
cd src/api
Start rails on port 3001:
bin/rails s -p 3001