Fullstack React home sharing application, https://www.newline.co/tinyhouse
Install all dependencies with yarn or npm. This is the same for both client and server project.
yarn install
A Apollo Server with MongoDB backend for storing rental houses.
All server code is located in the /server
folder.
Create a environment variable, .env
file in the /server
folder:
PORT=9000
DB_USER=<username>
DB_USER_PASSWORD=<password>
DB_CLUSTER=<mongodb cluster>
G_CLIENT_ID=<Google OAuth client id>
G_CLIENT_SECRET=<Google OAuth API secret>
PUBLIC_URL=<http://localhost:3000>
SECRET=<some secret text>
NODE_ENV=<development for local dev>
After you have configured your variables you can seed with some mock data
yarn seed
Start the server with yarn.
yarn start
In development mode you can access the GraphQL Playground on URL http://localhost:9000/api/
Create a production build with yarn.
yarn build
A React Apollo Client that display rental listings.
All client code is located in the /client
folder.
Start the client with yarn.
yarn start
The client uses Apollo CLI to generate types from the server API.
Read the server API schema and stores it locally to the client.
yarn codegen:schema
Reads the local schema file and generate types where GraphQL queries are defined.
yarn codegen:generate