- Clone the repository
- Open the terminal and navigate to the directory where the repository is located
- Run the command
npm install
to install the dependencies - Run the command
npm start
to start the program ornpm run dev
to start the program in development mode Note: The server will run on port 4000 by default. If you want to change the port, you can do so by changing the value of the PORT variable in the .env file
- React, React Native (for the mobile app)
- Redux, Redux Toolkit (for state management)
- React Navigation (for navigation)
- React Native Paper (for UI)
- Axios (for making HTTP requests) -- still not installed
- FlashList (replace for FlatList)
- AsyncStorage (replace for LocalStorage)
- Lodas (for functions)
- The app is divided into 3 main parts: components, pages and navigators
- Components are reusable UI components
- Pages are the screens of the app
- Navigators are the navigators of the app
- The app uses Redux for state management
- Create a new folder in the pages folder
- Create a new file in the folder you just created
- Add the code to the file you just created
- Modify the
config
object in the src/app.tsx file to add the new page to the app - Add new page name to type
AppStackParamList
in the src/AppNavigator.tsx file - Add
Stack.Screen
toAppStack
in the src/navigators/AppNavigator.tsx file to add the new page to the app Note: Remember to import the new page in the src/AppNavigator.tsx file
- Create a new file in the src folder
- Create a .env file in the backend folder with the following content:
DB_USER=postgres
DB_HOST=localhost
DB_NAME=ticktack
DB_PORT=5432
DB_PASS=your-password-here
JWT_SECRET=jwts3cr3t
GOOGLE_REFRESH_TOKEN=your-refresh-token-here
GOOGLE_CLIENT_ID=your-client-id-here
GOOGLE_CLIENT_SECRET=your-client-secret-here
GOOGLE_REDIRECT_URI=https://developers.google.com/oauthplayground
GOOGLE_DRIVE_FOLDER_ID=your-folder-id-here
COOKIE_PARSER_SECRET=cookieparsersecret
- As we use python to insert data into the database, you need to install the following packages:
pip install psycopg2
pip install json
pip install python-dotenv
pip install pathlib
pip install numpy
- Open pgAdmin and create a new database named "ticktack"
- Run the sql script in the backend/src/database folder to create the tables
- Run the python script in the backend/src/database folder to insert the data into the tables
- Change the directory to the
recommender
folder - Create a virtual environment in the
recommender
folder with python 3.10
python -m venv venv
- Activate the virtual environment
venv/Scripts/activate
- Install the required packages
pip install -r requirements.txt
- Run the 2 scripts in the
recommender
folder separately
python .\model_builder.py
python .\recommender.py
- Change the directory to the
recommender
folder - Build the docker image for the first time or after changes
docker compose up --build
- If you want to run the docker image without building it
docker compose up
If successfully run, the recommender will be available at http://127.0.0.1:8080/recommend
. The request format is as follows: http://127.0.0.1:8080/recommend?userId=1&number=5
. The userId
is the user id and the number
is the number of recommendations to be returned.
model_builder.py
will track the changes in the database and update the model accordingly. recommender.py
will start a flask server to serve the recommendations.