Giter Club home page Giter Club logo

filmstund's Introduction

Filmstund

A web application for making it easier planning to go to the cinema with your friends

CI Deploy beta

React frontend

cd web
yarn
yarn build
yarn test

Requirements

  • yarn
  • Node 16

Go backend

The backend is written in Go and is currently also serving up the frontend using a file server.

Linting and sanity checks

These checks need to pass in order to be able to merge a pull request:

make checks

Build

You can use the provided Makefile to build the project.

make build

Running

export OIDC_CLIENT_ID=jyXDFia9V5Hjy43pweTHo3A1onBRJEHk
export OIDC_CLIENT_SECRET=<ask-a-dev>
export OIDC_AUDIENCE=https://filmstund-dev
export OIDC_ISSUER=https://dev-filmstund.eu.auth0.com/
export LOGGER_VERBOSITY=10
make run

Requirements

The following sections details how to setup the requirements to run the backend server.

  • go >1.17
  • postgres
  • redis

Database

To run the app you will need to have access to a Postgres instance.

Docker

An easy solution is to run Postgres using docker:

docker run --name postgres -e POSTGRES_PASSWORD=filmstund -e POSTGRES_USER=filmstund -e POSTGRES_DB=filmstund -d -p 5432:5432 postgres:14

Podman

Alternatively, you can use podman instead of docker:

sudo podman run -d --rm -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=filmstund -e POSTGRES_USER=filmstund -e POSTGRES_DB=filmstund postgres:14

Migrations

Our database migrations are written in migrate-go format. To run the migrations, do the following:

go run ./cmd/migrate --path configs/database/migrations

Note that the username, password etc are configured using environment, and the same rules as the normal backend applies.

Add new migration

To add a new migration, do the following:

# Skip the first step if you already have migrate installed and in your $PATH
go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
migrate create -ext sql -seq -dir configs/database/migrations <migration_name_goes_here>

Redis

Redis is used as a cache for ephemeral data that expire after some duration.

You can configure Redis using environment variables:

export REDIS_HOST=127.0.0.1
export REDIS_PORT=6379

note that the above values are the defaults

If your redis instance is setup to use a "master" password, you can configure that using the REDIS_PASSWORD env var.

Installation (macOS)

On macOS, you can use Brew:

brew install redis
brew services start redis
# Optionally configure:
vim /usr/local/etc/redis.conf

Or docker/podman:

docker run -d --name redis -p 6379:6379 redis
podman run -d --rm --name redis -p 6379:6379 redis

filmstund's People

Contributors

dependabot[bot] avatar dr-horv avatar edholm avatar erica-edholm avatar juiceit avatar kalior avatar kirayatail avatar lindskogen avatar mattiasnilsen avatar renovate-bot avatar renovate[bot] avatar tejpbit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

filmstund's Issues

Confirm showing

  • Let admin mark as confirmed
    • Prevent further slot-picking
  • Notify users confirmed

Mark booking as done.

Markera bokning som färdig (Done, admin har fått in pengar mm, bokningen behövs inte synas publikt längre)

Notifications to users

Email

  • On new showing/invite
  • On showing confirmation

Push

  • On new showing/invite
  • On showing confirmation

Remember target url after logging in

At the moment, after logging in you get redirected to the profile page always. It would be neat to land on the url you tried to enter before the login prompt.

Admin confirm order

Ingen ska kunna ändra sin besöks-status efter att admin har utfört confirm
Ingen kan gå med, ingen kan lämna.

Filter meta info from titles

Currently when fetching movies from SF they include stuff like "- Klassiker" and " - Bollywood" which makes it difficult to lookup external info about the movie.

I propose we create a currated list of stuff they include, that we simply remove.

/api/movies error 500

exception: "#<NoMethodError: undefined method `split' for :"user-agent":Symbol>"

0: {id: 16, trace: "app/models/movie.rb:85:in 'download_data'"}
1: {id: 17, trace: "app/models/movie.rb:81:in 'request'"}
2: {id: 18, trace: "app/models/movie.rb:68:in 'current'"}
3: {id: 19, trace: "app/controllers/movies_controller.rb:6:in 'index'"}

Generate payment summery for admin

Admin must be able to easily perform the payment and thus needs all information available, bioklubbkortsnummer, företagsbiljetter mm

Remove Opera "movies"?

Would people be opposed if we filtered/removed movies from SF that are operas?

Vote with thumbs up or down I guess.

Confirm payment done

  • Let admin mark payment for individual user
  • Let admin mark showing as payed for (complete)

Expand README

Describe necessary steps for getting a new developer up and running.

Validate first match on IMDb before assigning a movie the ID

Currently there are some weird matches.

Case in point:

Jul 07 03:07:20 jupiter java[27505]: 2017-07-07 03:07:20.599  INFO 27505 --- [pool-1-thread-1] r.d.sefilm.schedulers.AsyncMovieUpdater  : Fetching extended info for 'Raula - Bollywood' with id=9294dac3-3699-41ce-ab6a-a24cb259f452
Jul 07 03:07:20 jupiter java[27505]: 2017-07-07 03:07:20.600  INFO 27505 --- [pool-1-thread-1] r.d.sefilm.schedulers.AsyncMovieUpdater  : [TMDb] Fetching movie details by IMDb ID=tt1003021
Jul 07 03:07:20 jupiter java[27505]: 2017-07-07 03:07:20.990  WARN 27505 --- [pool-1-thread-1] r.d.sefilm.schedulers.AsyncMovieUpdater  : An error occurred when updating 'Raula - Bollywood' ID=9294dac3-3699-41ce-ab6a-a24cb259f452, S

404 - page

  • Image asset
  • 3D asset
  • 3D rendering of cinema

Unable to login

When trying to login with either google or facebook I get this error message
2017-02-16-105454_1527x130_scrot

UX + Design for MVP

  • Select time slots
  • Confirm showing
  • Confirm payment
  • Saving profile (if successful or not)
  • Make site look okay on desktop

Handle case when movie does not exist in TMDb

I kind of assumed that if we have a valid IMDb ID it would exist in TMDb as well.

The below stacktrace is generated when searching for IMDb ID=tt5879988

Jul 07 03:10:40 jupiter java[27505]: org.springframework.web.client.RestClientException: Error while extracting response for type [class rocks.didit.sefilm.domain.dto.TmdbFindExternalResults] and content type [application/json;chars
Jul 07 03:10:40 jupiter java[27505]:  at [Source: (PushbackInputStream); line: 1, column: 356] (through reference chain: rocks.didit.sefilm.domain.dto.TmdbFindExternalResults["movie_results"]->java.util.ArrayList[0]->rocks.didit.sef
Jul 07 03:10:40 jupiter java[27505]:         at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:113) ~[spring-web-5.0.0.RC2.jar!/:5.0.0.RC2]
Jul 07 03:10:40 jupiter java[27505]:         at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:954) ~[spring-web-5.0.0.RC2.jar!/:5.0.0.RC2]
Jul 07 03:10:40 jupiter java[27505]:         at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:938) ~[spring-web-5.0.0.RC2.jar!/:5.0.0.RC2]
Jul 07 03:10:40 jupiter java[27505]:         at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:687) ~[spring-web-5.0.0.RC2.jar!/:5.0.0.RC2]
Jul 07 03:10:40 jupiter java[27505]:         at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:644) ~[spring-web-5.0.0.RC2.jar!/:5.0.0.RC2]
Jul 07 03:10:40 jupiter java[27505]:         at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:562) ~[spring-web-5.0.0.RC2.jar!/:5.0.0.RC2]
Jul 07 03:10:40 jupiter java[27505]:         at rocks.didit.sefilm.clients.ImdbClient.lookupTmdbIdFromImdbId(ImdbClient.kt:113) ~[classes!/:na]
Jul 07 03:10:40 jupiter java[27505]:         at rocks.didit.sefilm.clients.ImdbClient.movieDetails(ImdbClient.kt:77) ~[classes!/:na]
Jul 07 03:10:40 jupiter java[27505]:         at rocks.didit.sefilm.schedulers.AsyncMovieUpdater.updateFromTmdbByImdbId(AsyncMovieUpdater.kt:124) [classes!/:na]
Jul 07 03:10:40 jupiter java[27505]:         at rocks.didit.sefilm.schedulers.AsyncMovieUpdater.fetchExtendedInfoForMovie(AsyncMovieUpdater.kt:81) [classes!/:na]
Jul 07 03:10:40 jupiter java[27505]:         at rocks.didit.sefilm.schedulers.AsyncMovieUpdater.updateInfo(AsyncMovieUpdater.kt:70) [classes!/:na]
Jul 07 03:10:40 jupiter java[27505]:         at rocks.didit.sefilm.schedulers.AsyncMovieUpdater.synchronousExtendMovieInfo(AsyncMovieUpdater.kt:48) [classes!/:na]
Jul 07 03:10:40 jupiter java[27505]:         at rocks.didit.sefilm.schedulers.AsyncMovieUpdater.scheduledMovieUpdates(AsyncMovieUpdater.kt:35) [classes!/:na]
Jul 07 03:10:40 jupiter java[27505]:         at rocks.didit.sefilm.schedulers.AsyncMovieUpdater$$FastClassBySpringCGLIB$$686c8073.invoke(<generated>) [classes!/:na]
Jul 07 03:10:40 jupiter java[27505]:         at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) [spring-core-5.0.0.RC2.jar!/:5.0.0.RC2]
Jul 07 03:10:40 jupiter java[27505]:         at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:676) [spring-aop-5.0.0.RC2.jar!/:5.0.0.RC2]
Jul 07 03:10:40 jupiter java[27505]:         at rocks.didit.sefilm.schedulers.AsyncMovieUpdater$$EnhancerBySpringCGLIB$$7465cee8.scheduledMovieUpdates(<generated>) [classes!/:na]
Jul 07 03:10:40 jupiter java[27505]:         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
Jul 07 03:10:40 jupiter java[27505]:         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
Jul 07 03:10:40 jupiter java[27505]:         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
Jul 07 03:10:40 jupiter java[27505]:         at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
Jul 07 03:10:40 jupiter java[27505]:         at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65) [spring-context-5.0.0.RC2.jar!/:5.0.0.RC2]
Jul 07 03:10:40 jupiter java[27505]:         at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-5.0.0.RC2.jar!/:5.0.0.RC2]
Jul 07 03:10:40 jupiter java[27505]:         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_121]
Jul 07 03:10:40 jupiter java[27505]:         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_121]
Jul 07 03:10:40 jupiter java[27505]:         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_121]
Jul 07 03:10:40 jupiter java[27505]:         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_121]
Jul 07 03:10:40 jupiter java[27505]:         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
Jul 07 03:10:40 jupiter java[27505]:         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
Jul 07 03:10:40 jupiter java[27505]:         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
Jul 07 03:10:40 jupiter java[27505]: Caused by: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Instantiation of [simple type, class rocks.didit.sefilm.domain.dto.TmdbMovieResult] value failed f
Jul 07 03:10:40 jupiter java[27505]:  at [Source: (PushbackInputStream); line: 1, column: 356] (through reference chain: rocks.didit.sefilm.domain.dto.TmdbFindExternalResults["movie_results"]->java.util.ArrayList[0]->rocks.didit.sef
Jul 07 03:10:40 jupiter java[27505]:         at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.readJavaType(AbstractJackson2HttpMessageConverter.java:247) ~[spring-web-5.0.0.RC2.jar!/:5.0.0.RC2]
Jul 07 03:10:40 jupiter java[27505]:         at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.read(AbstractJackson2HttpMessageConverter.java:229) ~[spring-web-5.0.0.RC2.jar!/:5.0.0.RC2]
Jul 07 03:10:40 jupiter java[27505]:         at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:98) ~[spring-web-5.0.0.RC2.jar!/:5.0.0.RC2]
Jul 07 03:10:40 jupiter java[27505]:         ... 29 common frames omitted
Jul 07 03:10:40 jupiter java[27505]: Caused by: com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class rocks.didit.sefilm.domain.dto.TmdbMovieResult] value failed for JSON property 
Jul 07 03:10:40 jupiter java[27505]:  at [Source: (PushbackInputStream); line: 1, column: 356] (through reference chain: rocks.didit.sefilm.domain.dto.TmdbFindExternalResults["movie_results"]->java.util.ArrayList[0]->rocks.didit.sef
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.module.kotlin.KotlinValueInstantiator.createFromObjectWith(KotlinValueInstantiator.kt:44) ~[jackson-module-kotlin-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:189) ~[jackson-databind-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:421) ~[jackson-databind-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1266) ~[jackson-databind-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:325) ~[jackson-databind-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159) ~[jackson-databind-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:285) ~[jackson-databind-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:244) ~[jackson-databind-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) ~[jackson-databind-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:519) ~[jackson-databind-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:527) ~[jackson-databind-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:416) ~[jackson-databind-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1266) ~[jackson-databind-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:325) ~[jackson-databind-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159) ~[jackson-databind-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3999) ~[jackson-databind-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3060) ~[jackson-databind-2.9.0.pr3.jar!/:2.9.0.pr3]
Jul 07 03:10:40 jupiter java[27505]:         at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.readJavaType(AbstractJackson2HttpMessageConverter.java:241) ~[spring-web-5.0.0.RC2.jar!/:5.0.0.RC2]
Jul 07 03:10:40 jupiter java[27505]:         ... 31 common frames omitted

GÅ PÅ BIO

När vi väl kan använda systemet för det... :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.