Skip to content

Commit

Permalink
uploading the project from 2019
Browse files Browse the repository at this point in the history
  • Loading branch information
Rico authored and Rico committed Jul 7, 2023
0 parents commit e5ff103
Show file tree
Hide file tree
Showing 86 changed files with 16,761 additions and 0 deletions.
141 changes: 141 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Room Booking Application (2019)

A room booking web-application originally created as a final project for AW Academy's Coding Bootcamp -programming course.

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development purposes.

### Prerequisites

#### Backend

- PostgreSQL
- Node.js
- Express

```
"dependencies": {
"async": "^3.1.0",
"bcrypt": "^3.0.6",
"body-parser": "^1.19.0",
"concurrently": "^4.1.2",
"cookie-parser": "^1.4.4",
"cors": "^2.8.5",
"dotenv": "^8.1.0",
"express": "^4.17.1",
"jest": "^24.9.0",
"jsonwebtoken": "^8.5.1",
"nodemailer": "^6.3.0",
"pg": "^7.12.1",
"pg-hstore": "^2.3.3",
"sequelize": "^5.15.1",
"sequelize-cli": "^5.5.0",
"uuidv4": "^4.0.0",
"validator": "^11.1.0"
},
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/node": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"@babel/register": "^7.5.5",
"faker": "^4.1.0",
"lodash.random": "^3.2.0",
"lodash.times": "^4.3.2",
"nodemon": "^1.19.1"
}
```

#### Frontend

- React.js

```
"dependencies": {
"axios": "^0.19.0",
"jwt-decode": "^2.2.0",
"moment": "^2.24.0",
"react": "^16.9.0",
"react-datepicker": "^2.8.0",
"react-dom": "^16.9.0",
"react-moment": "^0.9.2",
"react-reveal": "^1.2.2",
"react-router-dom": "^5.0.1",
"react-scripts": "3.1.1",
"semantic-ui-react": "^0.87.3"
}
```

### Installing

First, clone the repository to your computer:

```
git clone https://github.com/kirsi-k/loppuprojekti-tilavaraus-applikaatio.git
```

Then, follow these steps:

```
0. Create postgres database to your computer (remember the name of your database)
1. Create .env-file in the root of server folder
2. Add the following lines to the file:
NODE_ENV=development
PORT=9999
DATABASE= *put here the name of your database*
DATABASE_USER=postgres
DATABASE_PASSWORD= *your password*
SECRET= *put here your secret*
GMAILPW= *put here your gmail password*
GMAIL_ADDRESS= *put here your gmail address*
3. Run npm install in client folder and server folder
4. Run npm start in client folder and server folder
```

### Features and limitations

- Only registered users can book rooms
- Bookings can be made seven days a week between 6 am and 10 pm
- Each booking slot is 30 minutes, i.e. if the client would need a room between 1 pm and 1.45 pm they'd have to book it for a full hour
- It is important that booking a room is easy and user-friendly; most people book the rooms by using their phones, so mobile view should be as readable and as easy to use as desktop view
- Bookings are anonymous for basic users, they can only see that the room is booked in the calendar view
- Basic users can cancel their bookings up until 24 hours before the booking's start time, unless the user has booked the auditorium which needs to be canceled a week before
- Admin user should be able to:
- invite new users to register (random internet people cannot register as users)
- make bookings for basic users so that it'll show to them the same way a booking they've made themselves would
- delete and edit users (except their password)
- edit users' bookings and cancel (delete) them at anytime
- delete and edit rooms
- see who's booking it is in the calendar view
- get a summary of bookings (hours) per user on a monthly basis for billing purposes
- grant admin rights to other users

## Technologies

### Backend

- **Node.js**
- Express
- Postgres
- Sequelize
- JSON Web Token
- Bcrypt
- Nodemailer

### Frontend

- **React.js**
- Axios
- Semantic UI
- Moment.js
- JWT Decode

### Deployment

- Amazon RDS (Relational Database Service)
- Docker
- Amazon ECR (Elastic Container Registry)
- Amazon Elastic Beanstalk
- Amazon S3 (Simple Storage Service)
- Amazon CloudFront
- Amazon Certificate Manager
27 changes: 27 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

/.idea

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

package-lock.json
68 changes: 68 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br>
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.<br>
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

### Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

### Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

### Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

### Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

### `npm run build` fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
40 changes: 40 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.19.0",
"jwt-decode": "^2.2.0",
"moment": "^2.24.0",
"react": "^16.9.0",
"react-datepicker": "^2.8.0",
"react-dom": "^16.9.0",
"react-moment": "^0.9.2",
"react-reveal": "^1.2.2",
"react-router-dom": "^5.0.1",
"react-scripts": "3.1.1",
"semantic-ui-react": "^0.87.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"proxy": "http://localhost:5000"
}
Binary file added client/public/faviconr.ico
Binary file not shown.
48 changes: 48 additions & 0 deletions client/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />-->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<link
rel="stylesheet"
href="//cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.css"
/>
<meta
name="description"
content="Roba43 room booking application"
/>
<link rel="shortcut icon" href="/faviconr.ico" type="image/x-icon">
<link rel="icon" href="/faviconr.ico" type="image/x-icon">
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Roba43</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file added client/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/public/logo1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/public/logo3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions client/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
2 changes: 2 additions & 0 deletions client/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
39 changes: 39 additions & 0 deletions client/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
body{
/*Background image Unsplah: https://unsplash.com/photos/LFjxCbhs0QM*/
background-image: linear-gradient(to bottom, rgba(255,255,255,0.5) 100%,rgba(255,255,255,1) 100%),url(".\images\mountains.jpg");
}

.components{
background-color: white;
}

.ui container{
margin: 0!important;
}

/*.div ui container components {*/
/* margin-left: 10px;*/
/* margin-right: 10px;*/
/* padding-left: 10px;*/
/* padding-right: 10px;*/
/*}*/

/*.components{*/
/* margin-left: 10px!important;*/
/* margin-right: 10px!important;*/
/* padding-left: 10px!important;*/
/* padding-right: 10px!important;*/
/*}*/

/*@media only screen and (max-width: 767px) {*/
/* .ui.container.mobile {*/
/* width: auto !important;*/
/* margin-left: auto!important;*/
/* margin-right: auto!important;*/
/*}*/
/*}*/
/*.mobile{*/
/*width: auto !important;*/
/* margin-left: auto!important;*/
/* margin-right: auto!important;*/
/*}*/
Loading

0 comments on commit e5ff103

Please sign in to comment.