├── .gitignore
├── src
├── styles.css
├── styles.scss
├── index.js
└── App.js
├── .DS_Store
├── my.test.js
├── README.md
├── dist
├── index.html
└── bundle.js.LICENSE.txt
├── server
└── server.js
├── package.json
└── webpack.config.js
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/src/styles.css:
--------------------------------------------------------------------------------
1 | h1 {
2 | color: white;
3 | background-color: black;
4 | }
--------------------------------------------------------------------------------
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PinkFairyArmadillos34/CafeQuery/HEAD/.DS_Store
--------------------------------------------------------------------------------
/my.test.js:
--------------------------------------------------------------------------------
1 | test('adds 1 + 2 to equal 3', () => {
2 | expect(1+2).toBe(3);
3 | });
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CafeQuery
2 | Open source project to find the best cafes for study or work
3 |
--------------------------------------------------------------------------------
/src/styles.scss:
--------------------------------------------------------------------------------
1 | $primary-color: white;
2 | $bg: black;
3 | h1 {
4 | color: $primary-color;
5 | background-color: $bg;
6 | }
--------------------------------------------------------------------------------
/dist/index.html:
--------------------------------------------------------------------------------
1 |
Webpack App
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./App";
4 | import "./styles.css";
5 | import "./styles.scss";
6 |
7 |
8 | var mountNode = document.getElementById("app");
9 | ReactDOM.render(, mountNode);
--------------------------------------------------------------------------------
/src/App.js:
--------------------------------------------------------------------------------
1 |
2 | import React from "react";
3 | import { hot } from 'react-hot-loader/root';
4 | import 'bootstrap';
5 | import 'bootstrap/dist/css/bootstrap.min.css';
6 |
7 | class App extends React.Component {
8 | render() {
9 | const { name } = this.props;
10 | return (
11 | <>
12 |
13 | Hello {name}
14 |
15 |
18 | >
19 | );
20 | }
21 | }
22 |
23 | export default hot(App);
24 |
--------------------------------------------------------------------------------
/server/server.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const mongoose = require('mongoose');
3 | const path = require('path');;
4 |
5 | const app = express();
6 |
7 | const PORT = 3000;
8 |
9 | // const mongoURI = "mongodb+srv://codesmith:cs@cluster0.di70nhs.mongodb.net/?retryWrites=true&w=majority";
10 |
11 | // need to determine how we are parsing data
12 | // app.use(express.json());
13 | // app.use(express.urlencoded({ extended: true }));
14 |
15 |
16 | // Global Error Handler
17 | app.use((err, req, res, next) => {
18 | const defaultErr = {
19 | log: 'Express error handler caught unknown middleware error',
20 | status: 400,
21 | message: { err: 'An error occured'}
22 | };
23 | const errorObj = Object.assign({}, defaultErr, err);
24 | console.log(errorObj);
25 | return res.status(errorObj.status).json(errorObj.message);
26 | });
27 |
28 | // Start server
29 | app.listen(PORT, () => {
30 | console.log(`Server listening on PORT ${PORT}`);
31 | })
--------------------------------------------------------------------------------
/dist/bundle.js.LICENSE.txt:
--------------------------------------------------------------------------------
1 | /*
2 | object-assign
3 | (c) Sindre Sorhus
4 | @license MIT
5 | */
6 |
7 | /*!
8 | * Bootstrap v5.1.3 (https://getbootstrap.com/)
9 | * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
10 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
11 | */
12 |
13 | /** @license React v0.20.2
14 | * scheduler.production.min.js
15 | *
16 | * Copyright (c) Facebook, Inc. and its affiliates.
17 | *
18 | * This source code is licensed under the MIT license found in the
19 | * LICENSE file in the root directory of this source tree.
20 | */
21 |
22 | /** @license React v17.0.2
23 | * react-dom.production.min.js
24 | *
25 | * Copyright (c) Facebook, Inc. and its affiliates.
26 | *
27 | * This source code is licensed under the MIT license found in the
28 | * LICENSE file in the root directory of this source tree.
29 | */
30 |
31 | /** @license React v17.0.2
32 | * react.production.min.js
33 | *
34 | * Copyright (c) Facebook, Inc. and its affiliates.
35 | *
36 | * This source code is licensed under the MIT license found in the
37 | * LICENSE file in the root directory of this source tree.
38 | */
39 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cafe-query",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "keywords": [],
7 | "author": "",
8 | "license": "ISC",
9 | "scripts": {
10 | "clean": "rm dist/bundle.js",
11 | "dev": "NODE_ENV=development webpack nodemon server/server.js & NODE_ENV=development webpack serve --hot --open",
12 | "start": "NODE_ENV=production node server/server.js",
13 | "build": "webpack",
14 | "test": "jest"
15 | },
16 | "dependencies": {
17 | "@reduxjs/toolkit": "^1.8.3",
18 | "bcryptjs": "^2.3.0",
19 | "bootstrap": "^5.1.3",
20 | "express": "^4.18.1",
21 | "jquery": "^3.6.0",
22 | "mongodb": "^4.8.0",
23 | "mongoose": "^5.11.8",
24 | "node-fetch": "^2.3.0",
25 | "nodemon": "^2.0.19",
26 | "popper.js": "^1.16.1",
27 | "react": "^17.0.2",
28 | "react-dom": "^17.0.2",
29 | "react-hot-loader": "^4.13.0",
30 | "react-router": "^6.3.0",
31 | "redux": "^4.2.0",
32 | "sass": "^1.53.0"
33 | },
34 | "devDependencies": {
35 | "@babel/core": "^7.18.6",
36 | "@babel/preset-env": "^7.18.6",
37 | "@babel/preset-react": "^7.18.6",
38 | "@hot-loader/react-dom": "^17.0.2+4.13.0",
39 | "babel-jest": "^28.1.3",
40 | "babel-loader": "^8.2.5",
41 | "css-loader": "^6.7.1",
42 | "eslint": "^8.19.0",
43 | "eslint-plugin-react": "^7.30.1",
44 | "html-webpack-plugin": "^5.5.0",
45 | "jest": "^28.1.3",
46 | "node-sass": "^7.0.1",
47 | "sass-loader": "^13.0.2",
48 | "style-loader": "^3.3.1",
49 | "url-loader": "^4.1.1",
50 | "webpack": "^5.73.0",
51 | "webpack-cli": "^4.10.0",
52 | "webpack-dev-server": "^4.9.3"
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | const webpack = require('webpack');
2 | const path = require('path');
3 | const HtmlWebpackPlugin = require('html-webpack-plugin');
4 |
5 | const config = {
6 |
7 | mode: process.env.NODE_ENV,
8 |
9 | entry: [
10 | 'react-hot-loader/patch',
11 | './src/index.js'
12 | ],
13 | output: {
14 | path: path.resolve(__dirname, 'dist'),
15 | filename: 'bundle.js'
16 | },
17 | module: {
18 | rules: [
19 | {
20 | test: /\.(js|jsx)$/,
21 | use: {
22 | loader: 'babel-loader',
23 | options: {
24 | presets: ['@babel/preset-env', '@babel/preset-react']
25 | }
26 | },
27 | exclude: /node_modules/
28 | },
29 | {
30 | test: /\.css$/,
31 | use: [
32 | 'style-loader',
33 | 'css-loader'
34 | ],
35 | exclude: /\.module\.css$/
36 | },
37 | {
38 | test: /\.png$/,
39 | use: [
40 | {
41 | loader: 'url-loader',
42 | options: {
43 | mimetype: 'image/png'
44 | }
45 | }
46 | ]
47 | },
48 | {
49 | test: /\.scss$/,
50 | use: [
51 | 'style-loader',
52 | 'css-loader',
53 | 'sass-loader'
54 | ]
55 | },
56 | {
57 | test: /\.css$/,
58 | use: [
59 | 'style-loader',
60 | {
61 | loader: 'css-loader',
62 | options: {
63 | importLoaders: 1,
64 | modules: true
65 | }
66 | }
67 | ],
68 | include: /\.module\.css$/
69 | }
70 | ]
71 | },
72 | devServer: {
73 | 'static': {
74 | directory: './dist'
75 | }
76 | },
77 | plugins: [
78 | new HtmlWebpackPlugin({
79 | templateContent: ({ htmlWebpackPlugin }) => '' + htmlWebpackPlugin.options.title + '',
80 | filename: 'index.html',
81 | })
82 | ]
83 | };
84 |
85 | module.exports = config;
--------------------------------------------------------------------------------