Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front end #11

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ebea260
update leasing card
May 6, 2018
0a2d846
Merge branch 'front-end' of https://github.com/UCSDCSSA/Duanzu into f…
May 6, 2018
d9f8e76
add image uploader
Hannahh1425 May 6, 2018
8fe1b65
Merge branch 'front-end' of https://github.com/UCSDCSSA/Duanzu into f…
Hannahh1425 May 6, 2018
821b79b
home page update
May 6, 2018
551d75a
Merge branch 'front-end' of https://github.com/UCSDCSSA/Duanzu into f…
May 6, 2018
8fe2fa3
new branch
ZixinShen May 6, 2018
b9a48b2
fixed modal
ZixinShen May 7, 2018
98f45bb
Minor Fixes
Liby99 May 13, 2018
7d4a15d
Merge branch 'front-end' of github.com:UCSDCSSA/Duanzu into front-end
Liby99 May 13, 2018
eaa39a2
home page
May 13, 2018
b532b76
Merge branch 'master' into front-end
Liby99 May 13, 2018
fe1b311
Merge branch 'front-end' of github.com:UCSDCSSA/Duanzu into front-end
Liby99 May 13, 2018
75f0903
Add Popup Sample
Liby99 May 13, 2018
36dd027
update publish page and change index css
Hannahh1425 May 13, 2018
bba6f7c
Merge branch 'front-end' of https://github.com/UCSDCSSA/Duanzu into f…
Hannahh1425 May 13, 2018
66e7e46
update login
ZixinShen May 13, 2018
8fd6c8d
merge conflict
ZixinShen May 13, 2018
6d994c6
header update
ZixinShen May 13, 2018
5aea73a
Minor Modifications
Liby99 May 13, 2018
c32fee5
Merge branch 'front-end' of github.com:UCSDCSSA/Duanzu into front-end
Liby99 May 13, 2018
1ed1cec
search page using multiple row
ltyDion May 14, 2018
68dad32
search page using multiple rows
ltyDion May 14, 2018
6f2650c
Resolved Conflict
Liby99 May 20, 2018
24e3b33
tmp
May 20, 2018
19ade4a
Merge branch 'master' of https://github.com/UCSDCSSA/Duanzu into fron…
May 20, 2018
49f6fff
temp
May 20, 2018
dfda5e5
Improved Login
Liby99 May 20, 2018
8e78ce6
Merge branch 'front-end' of https://github.com/UCSDCSSA/Duanzu into f…
May 20, 2018
c3bd4b9
Merge branch 'front-end' of https://github.com/UCSDCSSA/Duanzu into f…
May 20, 2018
978a28a
update image-uploader
Hannahh1425 May 20, 2018
248a8cd
Merge branch 'front-end' of https://github.com/UCSDCSSA/Duanzu into f…
Hannahh1425 May 20, 2018
28f0d4c
update home page
May 20, 2018
3b45ab8
Merge branch 'front-end' of https://github.com/UCSDCSSA/Duanzu into f…
May 20, 2018
2e9c5a2
New infra structure
ltyDion Oct 20, 2018
0125fa6
add description for package.json
ltyDion Oct 20, 2018
8fa1105
change styles about some files
ltyDion Oct 20, 2018
df1f6b0
Merge pull request #10 from UCSDCSSA/front-end-2.0
Liby99 Oct 20, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions source/deploy/ajax/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,45 @@ module.exports = {
"name": "李子阳"
}, {
"name": "糜雨健"
}, {
"name": "尹一阳"
}
]);
},

/**
* [search description]
* @param req.body: {
* "wifi": true / false [Optional],
* "start_date": Date [Optional]
lola98 marked this conversation as resolved.
Show resolved Hide resolved
* }
* @return {[type]} [description]
*/
search (req, res) {

var criteria = {};

if (req.body.wifi) {
criteria["wifi"] = req.body.wifi;
}

if (req.body.start_date) {
criteria["start_date"] = {
"$gte": req.body.start_date;
}
}

if (req.body.price_range) {
criteria["room_avail.price"] = {
"$gte": req.body.price_range[0],
"$lte": req.body.price_range[1]
}
}

Leasing.find(criteria).toArray(function (err, result) {
if (err) {
res.error();
}
});
}
}
1 change: 0 additions & 1 deletion source/react/.babelrc

This file was deleted.

13 changes: 13 additions & 0 deletions source/react/.flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[ignore]

[include]

[libs]

[lints]

[options]
module.name_mapper='.*\(.scss\)' -> 'empty/object'
module.name_mapper='^~/\(.*\)$' -> '<PROJECT_ROOT>/src/\1'

[strict]
3 changes: 3 additions & 0 deletions source/react/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
node_modules/
build/
107 changes: 39 additions & 68 deletions source/react/README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,90 +1,61 @@
# UCSD CSSA Duanzu - React Front-end
# React Starter Web Repo

This repository contains all the (biased) setup files for a react web application:

- Folder structures
- Webpack & webpack dev server: You can develop fluently
- Flow typing: You get types in javascript
- `scss` & `css` loader: `import 'style.scss'` in your javascript files
- Home directory when import: You can write `import '~/components'` when import
- React Router: Front-end routing plugin
- An express server, so that you can build and then run the application on your server

## Setup

Make sure you are in this folder (`source/react/`), and run the following
command to install the dependencies before you can run anything.
To setup this repo, first clone this to your local machine. Make sure you have node (10.0+) and npm (6.2+) installed,
and then

```sh
```
$ npm install
```

Then you are good to go! Type
At the same time, make sure that you fill in all the `FILL-IN-` placeholders in
`package.json`. Also do install `flow-bin` in your computer in order to run the flow
type check.

```sh
$ npm start
```
## Development

to start the WebPack server and you can now go to your browser and type in
To develop this repo on your local machine, run

```
http://localhost:8080/
$ npm run dev
```

to access the pages.
This will open up port `9000` on your machine. If you want to change the port, go to `src/config/webpack.dev.config.js`.
So now go to `localhost:9000/` on your browser, you can then see the page showing up.

## File Structure
## Build & Deploy

We will generate an express server serving a single-page application. To do that, run

```
react/

---Dependencies---
|- node_modules/

---Working Files---
|- public/
|- js/
|- css/
|- index.html
|- components/
|- index.js

---Config Files Beyond This Point---
|- package.json
|- package-lock.json
|- webpack.config.js
|- .babelrc
$ npm run build
```

The Dependencies Folder will not be there before you have used `npm install` to
install all the dependencies. Please do not touch any file in the directory.

What we are working on are the Working Files. Before getting into anything,
please do remind yourself for most of the cases we don't need to change any file
in `public/` folder as well as the `index.js` file. All we want to do is to
add files and modify them in `components/`. If you have any need to modify
`public/` or `index.js` please tell the administrator. All the files in
`components/` will be in `.js` format and will be React Renderable JSX files.

You also should not touch any file among the config files please notice.

## File Organizing, Naming Instructions and Formatting
This command will create several compiled files under `src/build/`. Make sure `index.html`, `main.css`, `main.js` are
all there, then run

### JSX Naming Instructions

For every file under `./components/`, please name the file using 'Capitalize
the first character for every word'. For example `AboutUs.js`, `Main.js` and so
on. In every `.JSX` file, you should have an `export`. Please make sure that
*the item you export* has exactly the same name as the file name. For example,
in `Main.js` you must have the last line `export default Main;`.

### Router Naming Instructions

In `./components/Main.js` we define a bunch of routes for the application. Here
for every route that you create, we must keep the route has naming style 'all
lower-case words concatenated by `_`'. For example `/about_us`,
`/profile/change_password` and so on. Please note that you should not hesitate
to add extra path to group the routes.
```
$ npm start
```

### Formatting
to start the express server. This will open up port `3000` on your machine. Go to `localhost:3000` to view the webpage
if you are running the production server on your own machine. If you are deploying this on a server, make sure you
redirect the requests to the port `3000`. Or if you want to pick another port, go to `src/config/express.config.js` and
change the `port` property there.

To make things easy and consistent, in all JSX files in `./components`, we use
the *default setting* of *Atom Beautifier* to format your code. If you are
using Atom, please go to [here](https://atom.io/packages/atom-beautify)
to install this plugin to Atom. If not, then *at least* follow the following
rules:
## Clean

- All white-space using space (` `). No Tab (`\t`).
- All indentation are 4 spaces.
- All the JavaScript part of the code must not exceed 80 chars per line.
- Add semi-colon (`;`) to everywhere you need to.
```
$ npm run clean
```
25 changes: 0 additions & 25 deletions source/react/components/Header.js

This file was deleted.

143 changes: 0 additions & 143 deletions source/react/components/Home.js

This file was deleted.

Loading