Forx News

Description
Forx News is a restaurant review website based on Yelp datasets. It aims to help users search restaurants in a simplistic way, and present them with insightful restaurant reviews.
Project Wiki: https://forx-news.gitbook.io/forx-news-wiki
Demo Video: https://youtu.be/nuDBwg3mG6o
Deployment on Heroku: https://forxnews.herokuapp.com
Tech Stack
System Architecture

Folder Structure
We host our backend codes in the root project folder, and nest frontend codes inside the client
folder.
.
├── client # Frontend
│ ├── public # Static resources, such as icons and images
│ └── src
│ ├── components # Pages, components and styles
│ ├── hooks # Custom hooks
│ ├── constants # Constants
│ ├── utils # Helper functions
│ ├── App.js
│ ├── index.css
│ └── index.js
├── config # Env variables, such as API keys and secrets
├── middlewares # Custom middleware functions
├── routes # Route handlers
├── services # Third-party services, such as Passport.js
├── database.js # MySQL connection
├── index.js # Configures server, middlewares and routes
└── schema.js # Request schema validation rules
Development Guidelines
Make sure you have installed git
, node
, npm
before starting.
1. Get Started
- Clone repo:
git clone [email protected]:ruichen199801/cis550-fa22-project.git
- Checkout feature branch:
git checkout -b <feature branch name>
- Install backend dependencies:
cd cis550-fa22-project && npm i
- Install frontend dependencies:
cd client && npm i
- Run frontend and backend concurrently:
cd .. && npm run dev
2. Before Commit
- Stash uncommited changes on your local branch:
git stash
- Fetch remote changes into local main:
git checkout main && git pull origin main
- Sync your branch with local main:
git checkout <your branch name> && git merge main
- Restore changes and continue your work:
git stash pop
3. Commit Your Work
- Sanity check:
git status
,git branch
- Push changes:
git add .
,git commit -m <commit message>
,git push
- Open pull request and assign code reviewer
- Merge codes after approval
4. After Merge
Archive branch according to https://gist.github.com/zkiraly/c378a1a43d8be9c9a8f9
5. DO NOT
- Push to main directly or force merge into main
- Push untested or bugged codes
- Use API keys and secrets explicitly in code
- Include node_modules in commits
- Overwrite package-lock.json without introducing new dependencies (use
npm ci
instead for subsequentnpm install
)
6. Common Issues
- Port already in use:
lsof -i tcp:<port>
, thenkill -9 <PID>
- Nodemon app crashed:
pkill -f nodemon
, then restart server - Node.js Error: connect ECONNREFUSED: make sure installed node version is
14.17.6
, as the app may not be compatible with newer versions
7. Debug
Heroku logs: heroku logs -t