- Install Node.js 12+ &
yarn 1
- Execute
yarn install
in client path. - Execute
yarn install
in server path. - Prepare Docker environment if you do not have
- Execute
yarn start
in client path to launch dev react server, http://localhost:3000. You can also useVSCode+F5
to useDebugger for Chrome
. - To launch PostgreSQL database, execute
docker run -p 5432:5432 --name some-postgres -d postgres:12.1
- Use
VSCode+F5
to launch and debug API server, http://localhost:3001 which mainly uses GraphQL and only uses RESTFUL for authentication part. Or just executeyarn start
to launch it. - (optional) load the restaurant data, follow https://github.com/grimmer0125/full-stack-example#load-data
Open http://localhost:3000 to play this example.
- TypeScript (3.7+)
- React
- CRA (Create React App)
- Redux Toolkit (which enhances Redux development, such as
write "mutating" logic in Redux Toolkit
since Immer inside) - PostgreSQL
- NestJS (a Node.js server framework)
- TypeORM
- Passport (jwt)
If you do not see restaurant list, please execute this step. If you already see, doing this will duplicate the data.
Open http://localhost:3001/graphql, in the playground, paste
mutation fetchRawData {
etlRestaurantRawData(sourceURL:"https://gist.githubusercontent.com/seahyc/7ee4da8a3fb75a13739bdf5549172b1f/raw/f1c3084250b1cb263198e433ae36ba8d7a0d9ea9/hours.csv")
}
to ask the server to load the Data.
p.s. A few restuarants(~11) in the raw data has duplicate row. Currently the code just choose the first one.
No email verification and password reset yet.
In /dashboard
, click the +
button in a restaurant cell, input a restaurant collection, then click submit
to store it. You can input a new or existing collection name. For existing collection, click a collection to copy its name to speed up.
To browse collection list, click collection
link in the top bar to navigate to /collection
. You can also click a collection to see its restaurant list in the right panel.
- Before doing this, your target user must signup first.
- In
/collection
, click+
to input the email of the target user. - The target user will be authorized to see this shared collection and able to add a restaurant into it !!
Current done:
- User A chooses a shared collection to see its detailed restaurant list.
- User B add a restaurant into this shared collection.
- User A will see the added one without refreshing.
docker-compose up -d
Try http://fullstack.grimmer.io/, deployed on Azure. You can use http://api.grimmer.io/graphql to import restaurant data if there is no data yet.
Command: Load data
traefik: https://docs.traefik.io/
Steps:
- Install docker, docker-compose and login private docker registry.
- Frontend setting:
export REACT_APP_API_URL=api.grimmer.io
- db setting:
export POSTGRES_USER=YOUR_USER
export POSTGRES_PASSWORD=YOUR_PASSWORD
export POSTGRES_DB=YOUR_DB
docker network create traefik_net
docker-compose -f traefik-docker-compose.yml up -d
docker-compose -f docker-compose.azure.yml up -d