Skip to content

mrmezan06/doctor-appointment

Repository files navigation

Server

Server Configuration

Node Modules

  • Express
  • jsonwebtoken
  • bcrypt
  • bcryptjs
  • dotenv
  • moment
  • mongoose
  • nodemon

Database

  • MongoDB

Server Structure

  • Node Server

Deployment & Testing

Heroku Configuration

  • Server.js - [x] Below is the configuration for Heroku After Your Route
if(process.env.NODE_ENV === 'production') {
    app.use(express.static('client/build'));
    app.get('*', (req, res) => {
        res.sendFile(path.resolve(__dirname, 'client', 'build', 'index.html'));
    } );
}

const port = process.env.PORT || 5000;

app.get('/', (req, res) => res.send('Hello World!'));

  • package.json
  • Below is the configuration for Heroku After "main": "index.js",
"engines": {
    "node": "17.8.0",
    "npm": "8.13.2"
  },
  "scripts": {
    "client-install": "npm install --prefix client",
    "server": "nodemon server.js",
    "client": "npm start --prefix client",
    "dev": "concurrently \"npm run server\" \"npm run client\"",
    "start": "node server.js",
    "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
  },
  
  • gitignore
    • node_modules
    • If in gitignore .env is also is listed then remove from it otherwise MONGO_URL can't be found

Run The Server In Your Local Machine

  • Clone the repository
  • Install the dependencies
    • npm install
  • Set up .env
    • MONGO_URI=YOUR_MONGO_URL\DATABASE_NAME
    • JWT_SECRET=YOUR_JWT_SECRET
    • If Local MONGO_URI=mongodb://127.0.0.1:27017/doctor-appointment
  • Run the server
    • nodemon server
  • Run the tests
  • Deploy the server

Media Devices Query

/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {...}

/* Small devices (portrait tablets and large phones, 600px and up) */
@media only screen and (min-width: 600px) {...}

/* Medium devices (landscape tablets, 768px and up) */
@media only screen and (min-width: 768px) {...}

/* Large devices (laptops/desktops, 992px and up) */
@media only screen and (min-width: 992px) {...}

/* Extra large devices (large laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {...}

Start Node server

  • nodemon server

Start React App

  • cd client
  • npm start

About

React Node MongoDB Express

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published