UCLA SWE's event portal. Coming Soon!
- Docker: Tool to deploy applications in containers
- React: JS library for building UIs
- Node.js: JS run-time environment
- Express: Web application framework for Node.js
- Postgres/Docker Postgres/Amazon RDS for PostgreSQL: Open source relational database
- Postman: API development and testing, used to generate API documentation
- AWS EB: Service for deploying and scaling web applications
-
More specific READMEs are located in
client/
andserver/
. -
Client: React
- The client service contains the React app
- Makes API calls to the Express server through proxy in
client/package.json
-
Server: ExpressJS
- The server service runs the Express app
- Serves the Companies, Events, and Users APIs
- Serves the static files from the production build of the React Client in
client/
-
Database: Postgres
- Docker Postgres used for local development
- Amazon RDS for PostgreSQL used for production
- Main configuration with connection information in
server/db/index.js
- Diagrams for the database schema as of
3/7/19
is found in./database/pg_db_diagram.pdf
- NOTE: In order to run the app, developers need the
.env
file- Should be kept in the same directory as the
Makefile
/thisREADME
/etc. .env.example
is an example.env
file
- Should be kept in the same directory as the
- Stack Dependencies
- Docker install and run daemon
- Should include Docker-Compose in install
- Node install
- Create React App docs
- Postgres install
- Docker install and run daemon
- Store initial sample test data in order to restore data if modified
- Sample data will be initially populated with
make dev
- Once generated, store it in a zip file with
make store
- NOTE: if there is some bug with the database, try resetting it by deleting the folder
database/postgres/
then runningmake dev
again- Following the below commands will be necessary to repopulate with sample data
- Sample data will be initially populated with
# If database/postgres does not exist, will create postgres container and populate with sample data.
$ make dev
# Only needs to be run once and then will be able to restore initial sample data from the generated zip.
$ make store
# Unzip sample data and move to proper folder within database/. Can also overwrite current database data with this command.
$ make restore
$ make dev
-
Both
client/
andserver/
are separate Docker Containers linked withdocker-compose-dev.yml
- The React Client is available at http://localhost:3000
- The Express Server is available at http://localhost:5000
-
The
database/
container has locally mounted data for development at port5432
-
Can access
psql
shell for running Postgres container -
$ make pg
-
-
Local directories are mounted into the containers
- Changes will reflect upon save/refresh
- Exceptions: changes to package.json, new css files, etc.
- Changes will reflect upon save/refresh
$ make prod
-
Available at http://localhost (port 80)
-
Creates static build of the React Client app in
client/build/
-
Runs Express Server which handles serving both the API and the static client files
-
Uses environment variables from
docker-compose.yml
to connect with Amazon Postgres database-
Can access
psql
shell for Amazon RDS for PostgreSQL database -
$ make db
-
-
Works for both production and development modes
-
In same terminal tab that we ran stack, Ctrl+C or:
$ make stop
- Commit all relevant changes in
swe-ucla/Event-Portal
repository - Bundle application source code
- Only includes files stored in git, excluding ignored files and git files
- Specify version number by setting environment variable with call
- Version defaults to 666, should be manually fixed
$ make zip VERSION=4.2
- Login to AWS Developer Console
- Navigate to the Elastic Beanstalk Service in region
us-east-1
, aka N. Virginia - Select the environment
EventPortalEnv
in applicationswe-event-portal
- Navigate to the Elastic Beanstalk Service in region
- Select
Upload and Deploy
in the EB dashboard- Upload zip from earlier step
- Should autogenerate label of the format:
event_portal_v#.#
- Deploy!
- Changes should appear after environment update has completed successfully