|
1 | 1 | # Mappening-Backend |
2 | 2 |
|
3 | | -## Overview |
4 | | -A single platform for events across campus. Mappening helps raise awareness of events by aggregating event information from various sources of advertising. |
5 | | - |
6 | 3 | ## Documentation |
7 | 4 | Hosted on GitHub Pages at http://ucladevx.com/Mappening-Backend/ |
8 | 5 |
|
9 | | -## Built With |
10 | | -- Python 2.7.14 |
11 | | -- Flask (Port 5000): Web microframework for Python |
12 | | -- mLab: Database-as-a-Service cloud-hosted MongoDB |
13 | | -- Pymongo: Database Connector between MongoDB and Flask |
14 | | -- Facebook Graph API + Login/OAuth for getting event information and user authentication |
15 | | -- Google Maps/Places API Web Service for getting place information |
16 | | -- AWS EC2/Elastic Container Service for deployment |
17 | | -- Sphinx to automatically generate documentation |
18 | | -- Tkinter, Selenium, Google chromedriver for internal tools |
19 | | -- Beautiful Soup for web scraping |
20 | | - |
21 | 6 | ## Setting Up the Environment |
22 | | -- Download [Docker](https://www.docker.com) and [Docker-Compose](https://github.com/docker/compose/releases) release 1.16.1. |
23 | | - - Run the Docker daemon |
24 | | -- Clone this repository |
25 | | - - `git clone https://github.com/ucladevx/Mappening-Backend.git` |
26 | | -- For Mac users, install Xcode developer tools `xcode-select --install` |
27 | | -- Get the `.env` file which contains sensitive information from a dev and add it to src/mappening/utils/ |
| 7 | +- Follow instructions in main [Mappening](https://github.com/ucladevx/Mappening) repository |
| 8 | +- Get the `.env` file which contains sensitive information from a dev and add it to `src/mappening/utils/` |
| 9 | +- Build the base image that contains all dependencies that are fairly static but take a while to install |
| 10 | + - `make build-base` |
28 | 11 | - NOTE: the database connection doesn't seem to work over UCLA_WEB wifis, a more secure connection is needed (UCLA_WIFI) |
29 | 12 |
|
30 | | -#### For AWS Access |
31 | | - |
32 | | -- Install [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) |
33 | | - - Configure CLI with `aws configure` |
34 | | - - Requires AWS secret info (only for PM/TL) |
35 | | - - NOTE: Computer local time must be accurate lol @Hakan |
36 | | - |
37 | | -## How to Push Image to AWS ECS |
38 | | -- Enter the repository |
39 | | - - `cd Mappening-Backend` |
40 | | -- Login, build, and push image to AWS |
41 | | - - For production deployment: `make push` |
42 | | -- For dev site deployment: `make dora` |
43 | | - - NOTE: for Windows/Linux users that must use `sudo` with Docker commands, use the `docker login` command generated by `make ecr-login` and run it with `sudo` before running above commands |
44 | | - |
45 | | - |
46 | 13 | ## How to Run Backend Locally |
47 | | -- Build and run container |
| 14 | + |
| 15 | +- Build and run container using local Postgres database |
48 | 16 | - `make dev` |
49 | | -- Navigate to `localhost` |
50 | | -- Access flask api directly at port 5000 |
| 17 | + - To use production database (not recommended for local development): |
| 18 | + - `make prod` |
| 19 | +- Navigate to [http://localhost](http://localhost) |
| 20 | +- Access flask api directly at port [5000](http://localhost:5000/) |
51 | 21 | - Use `localhost:5000/api/<insert_api_route_here>` |
52 | 22 | - e.g. `localhost:5000/api/events` |
53 | 23 | - Stop running with `CTRL+C` or `make stop` in a separate terminal window |
54 | 24 |
|
55 | | -## More Info |
56 | | -- Check out the [frontend](https://github.com/ucladevx/Mappening-Frontend) repository |
57 | | -- Check out the [deployment](https://github.com/ucladevx/Mappening-Deployment) repository |
58 | | - - Contains instructions for local development and production |
59 | | - |
60 | 25 | ## Repo Breakdown |
| 26 | + |
| 27 | +- Database config/data in `/database` |
61 | 28 | - Backend source code in `src/` |
62 | 29 | - tkinter GUIs in `tkinter/` |
63 | 30 | - Autodocumentation in `docs/` |
|
0 commit comments