COMP3900 Group Project - Dump Stat Intelligence
To run the project, ensure most recent version of:
- nodejs is installed: https://nodejs.org/en/download/
- python3 https://www.python.org/downloads/
- yarn package manager: https://yarnpkg.com/
- pipenv package manager: https://pipenv-fork.readthedocs.io/en/latest/
are all installed.
To install required packages for backend:
- create a new python3 virtual environment with
pipenv --threewhen in the root directory of the project - Run
pipenv installin the root directory to install all required packages
To install required packages for the frontend:
- cd into
/frontend - run
yarn install(note if you get to a message that says the installer is "locking" and doesn't end you can control-c and continue)
To run the project:
- ensure no other processes are running on ports 3000, 8000
- open 2 terminal windows in the root directory of the project
- run
make frontendin one window - in the other window run
pipenv shellto use the pipenv environment - run
make backendin the other window - visit
http://localhost:3000and use the project
Ensure you have concurrently installed (yarn global add concurrently) and are in the python virtual environment for backend (pipenv shell in /backend/pantrypirate). You can use these commands to run the project:
make backend: run the backend on port 8000make frontend: run the frontend on port 3000make all: simultaneously make frontend and backend
See The API Spec for details on what the frontend expects
- Ensure nodejs and yarn are installed
- Install required packages:
yarn install
Dev server (hot reloading): yarn run dev
Build for production: yarn run build
/components
/lib
/api
/redux
/utils
/pages
/public
/styles
/componentscontains shared React components used in various routes/liblibrary of helper scripts/apiscripts associated with making calls to and from the backend/reduxfiles associated with the state management of the site, including the redux actions and reducers/utilsremaining helper scripts, mainly are localstate management
/pagescontains views for routes. Routes for the frontend are created based on the file structure underneath this folder (https://nextjs.org/docs/routing/introduction)/stylescontains GLOBAL styles. For most Sass work you should create a module for each component in the same directory as the component. I.e. createcomponents/Button.jsand then also createcomponents/Button.module.scssand import the scss file in the component.
/pantrypirate
db.sqlite3
manage.py
/pantrypirate/backend
/migrations
admin.py
apps.py
models.py
serializers.py
tests.py
urls.py
views.py
/pantrypirate/pantrypirate
/pantrypiratedb.sqlite3database for backendmanage.pybackend interaction entry point/backend/migrationsDjango Sqlite database temporary migration folderadmin.pyregistering models for editing on Django admin pageapps.pyregistering backend as an application for the adminmodels.pycontains Django models for database interactionserializers.pycontains REST serializers for interaction between frontend and databasetests.pycontains tests for the backendurls.pycontains routes for backend viewsviews.pycontains scripts to deal with each route
/pantrypiratecontains high level application configuration for Django