A dockerised create-react-app that stores data express server with GraphQL to connect to a MongoDB database. The application allows the user to add clients, projects and view sample_airbnb data from mongo atlas.
- Dockerised
- Frontend built with create-react-app, graphql, mongoose, apollo
- Backend built with express, graphql, mongodb
- Install Docker for your operating system.
- Install the Docker Compose tool.
- Create a mongoDB Atlas account.
- Create a database on a mongoDB Atlas cluster with provided mongoDB sample_data.
- Copy and paste the mongoDB connection string into a .env file in server
- Run docker-compose up
NODE_ENV = 'development' #Toggles if we show GraphiQL for dev or production#Port for the client
NODE_PORT = 5002 #Port for the server
MONGO_URI_ATLAS = 'mongodb+srv://<mongodbuser>:<mongodbpassword>@genesis.xsdlwrf.mongodb.net/sample_airbnb?retryWrites=true&w=majority' #Remote URI
MONGO_URI_LOCAL = 'mongodb://localhost:27017/sample_airbnb' #Local URI
docker-compose up
Alternatively you could cd into 'client' and 'server' then run the below to run the projects as normal outside of docker.
yarn && yarn start
To run the applications outside of docker.