Skip to content

AndrianiP/EventExplorerReimagined

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo
Whales Technology Co.

Capstone CSCE 490 - University of South Carolina

Professor: Dr. Jose M Vidal

Event Explorer

Event Explorer seeks to solve the fragmentation of event advertisement within the University of South Carolina ecosystem. Events are currently posted to a number of different university-affiliated, student-run, or independent social media platforms; physical flyers or displays; via email or text message; or other methods. As such, it can be challenging for students to keep up to date with what events are occurring, even with the university event calendar.

External Requirements

In order to build this project you first have to install:

This project is compatible with Windows, MAC OS, and Linux.

Setup

Install Dependencies

After cloning the repo, navigate to the Node project and install the required npm packages:

cd eventexplorer
npm install

Configure .env

Configure your development .env file for environment variables:

cp .env.example .env

In .env, add a NEXTAUTH_SECRET environment variable:

# You can generate a new secret on the command line with:
# openssl rand -base64 32
# https://next-auth.js.org/configuration/options#secret
NEXTAUTH_SECRET="secret"

Postgres Database

You can run the development database using docker

docker run --name postgres -e POSTGRES_PASSWORD=password -d -p 5432:5432 postgres

Then set your DATABASE_URL environment variable in .env

DATABASE_URL="postgres://postgres:password@localhost:5432"

To configure your database schema, run the migration script

npx prisma migrate deploy

You can optionally seed the database using

npx prisma db seed

Email Server

Make sure your email .env variables are populated:

# Email
EMAIL_SERVER=""
EMAIL_FROM=""

AWS S3 Storage Bucket

To connect the AWS S3 Storage bucket to the application for file storage/upload, make sure the following environment variables are set correctly:

# S3
AWS_ACCESS_KEY_ID="xxxxxxxxxxxxxxxxxxxx"
AWS_SECRET_ACCESS_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
AWS_REGION="us-east-1"
BUCKET_NAME="eventexplorer-demo"
ROOT_STORAGE_FOLDER="CHANGE_ME_some-unique-id"

Change your ROOT_STORAGE_FOLER to be a unique identifier that you can recognize and won't cause conflicts with other developers using the storage bucket. I recommend naming it your name following by a random, unique ID or number you can find a generator for online.

Running

Make sure you have setup all dependencies properly. See Setup for more information.

Run a local development version of the website:

cd eventexplorer
npm run dev

Deployment

Deployment will be handled by Vercel. Any push to a branch on GitHub will spawn a feature branch deployment automatically on Vercel and we can determine which deployment instances are ready for production.

Testing

Pre-requisites

Before running tests, make sure to have Docker installed and running on your machine. Docker is needed to run a local Postgres database for testing that will not affect any other databases you may have. Otherwise, you can run tests via the GitHub Actions workflow.

Please also create a .env.test (you can copy .env to .env.test for defaults) file in the root of the project and make sure it has the following environment variables:

CYPRESS=true
DATABASE_URL="postgres://postgres:password@localhost:5432"

Running Tests

We automate testing with jest. Any file matching **/*.test.ts is a test file and will be included in the test suite when running jest. These test files can be kept in the same file as the module being tested.

Example:

src/
  lib/
    someCoolModule.ts       // The module
    someCoolModule.test.ts  // The test suite testing the module

We automate end-to-end testing with Cypress. Any file in the eventexplorer/cypress/e2e directory ending with *.cy.ts will be included in the test suite when running cypress.

Example:

cypress/e2e/
  behavior.cy.ts  // The e2e test for a user behavior
cd eventexplorer
npm run test

To run only Jest unit tests or Cypress e2e tests:

cd eventexplorer
npm run test:unit # just unit tests
npm run test:e2e  # just e2e

If you want to run the Cypress GUI to see detailed information about tests, you will have to start the dev server manually:

# Start and setup the test DB
npm run db:start-test
npm run db:push-test
npm run db:seed-test

# Start the dev server that pulls from .env.test
npm run dev:test

# Startup Cypress
npx cypress open

You will also have to manually shutdown/cleanup and remaining resources when doing it this way.

# Removes the testing db
npm run db:kill-test

Style Guide

We will be using Prettier to automatically format our code. It is available as a plugin for most IDEs and can be run from the command line as well. We will likely set up a pre-commit hook to automatically format code before it is committed and a GitHub action to check all PRs.

Authors

About

Redesiging EventExplorer.net

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published