701-t4 / flatshare Goto Github PK
View Code? Open in Web Editor NEWFlat management made simple. This project was conducted for a SOFTENG701 assignment at the University of Auckland.
Home Page: https://flat-split.web.app
License: MIT License
Flat management made simple. This project was conducted for a SOFTENG701 assignment at the University of Auckland.
Home Page: https://flat-split.web.app
License: MIT License
Our application should have the correct metadata tags so it displays nicely in embeds, has a proper browser tab title, etc.
Update the public index.html file, manifest file etc to be representative of the app. When posted on twitter/discord etc, our website should embed correctly with a nice image and description (see https://ogp.me/).
This is not urgent, and not part of the initial milestone.
Describe the bug
After sigint in the start:dev root script, the applications don't properly close. May be a windows issue.
To Reproduce
Steps to reproduce the behavior:
start:dev
Expected behavior
Killing the script should kill all processes (hence freeing the ports).
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Authenticated users need a sort of 'home screen' to take them to different parts of the app.
Is your feature request related to a problem? Please describe.
It is frustrating to have to install mongodb before being able to run the app or do any work. We should have some way for developers to be able to get started without having to install anything.
Describe the solution you'd like
Ideally we can find some free online hosting for mongodb.
A sharing link is helpful to quickly get people to join flats, even if they do not have an account yet.
Users in the flat can get a sharing link. People who go to the URL of that sharing link will be added to the flat.
Some (not finalized) specs
Describe the bug
Currently the endpoint /api/v1/house
returns an empty body if the user doesn't have a house assigned. Instead we should return 404 status.
To Reproduce
Steps to reproduce the behavior:
/api/v1/house
with a user that doesn't have a house assignedExpected behavior
http 404 should be returned
Additional context
Now that #28 adds the typings for our API, we should be able to use this in order to provide type hints for our useApi hook.
A hook that provides autocomplete and type hinting for making api requests. It should be able to know what path params there are, and the format of message body. Since this is likely going to be a best-effort type of system, an alternative untyped hook should also be available in case there are issues with the typings.
We could just not do this and rely on developers to manually type things themselves.
If we want to use NextUI we need to set up its context and themes.
Bill splitting is an essential part of a flat sharing application
WIP - we will need to have a meeting to spec this task out.
Potential requirements:
Is your feature request related to a problem? Please describe.
Task splitting would be a nice part of the app to complete.
Describe the solution you'd like
Here are the current specifications:
Is your feature request related to a problem? Please describe.
The backend code should be uniform and have good style guidelines.
Describe the solution you'd like
Setup ESLint rules and make husky fail the commit if any rules generate warnings.
You can use common sense to select what rules should be enabled. Make sure that you have added rules specifically for nest and for typescript.
Describe alternatives you've considered
We currently have prettier but it does not enforce style
Is your feature request related to a problem? Please describe.
Our application will likely require 3rd party services to handle things that we probably shouldn't (i.e. auth).
Describe the solution you'd like
Firebase setup with auth and hosting enabled. Firebase added to the project. Members have access to the firebase project.
Discussion
Do we want to use another hosting provider or another auth provider? Firebase auth and hosting will be free for us, and its very easy to use, which is why I've suggested it, but open to new ideas.
Is your feature request related to a problem? Please describe.
Often we want to use components like toasts to respond to user actions, to acknowledge that something is happened. It would be useful to have an easy-to-use component API to allow for this.
Describe the solution you'd like
A toast/corner alert, callable via a easy function or hook.
Is your feature request related to a problem? Please describe.
It is frustrating when getting started with the project to manage the environment files. The back-end currently manages the .env files using templates while the front end relies on overriding the default config.
Describe the solution you'd like
We should make the back-end use the same logic as the front-end so that the code works by default without any additional config.
Ideally we also move the .env files to the root directory and merge the front-end and back-end env files.
Is your feature request related to a problem? Please describe.
Implement database
Describe the solution you'd like
Implement mongodb (most likely using mongoose) into the back-end code
Describe alternatives you've considered
We considered postgresql but decided against it due to the short time available to work on this project
Additional context
https://www.mongodb.com/
We need to authenticate users to show them the relevant information.
useAuth()
should give access to the current user, using this context.Firebase authentication - sign in with google
Auth0 - Less familiar and would be more effort to setup.
Our own Auth system - Significantly more effort, increases security risk, not as convenient for users.
Is your feature request related to a problem? Please describe.
We do not currently have a way to find a users name without the user actively providing their token. This will become an issue when we want to display the other members in the same house.
Describe the solution you'd like
When creating a user, we should also save their name into the database. We will also have to update endpoints that return the user to also include the name, as it may diverge from the firebase name.
Describe alternatives you've considered
We could alternatively save their firebase token but this would require significant stripping to not cause security issues. It will be better to simply save info as we need it.
Is your feature request related to a problem? Please describe.
Currently the frontend is not built and tested on CICD.
Describe the solution you'd like
Add CICD steps to build and test the frontend on a pull request to the existing workflow file.
Is your feature request related to a problem? Please describe.
Once we start getting more complicated dependencies we need to make sure our app is quick and easy to set up a development environment.
Describe the solution you'd like
We should use docker to automatically create the environment needed for development
Describe alternatives you've considered
alternatively we could provide instructions for setting up everything manually. This would quickly get out of hand as we add dependencies and need to maintain instructions for many operating systems.
Describe the bug
After logging in you are redirected to /home
after a refresh you are directed back to /landing
and must log in again to access /home
To Reproduce
Steps to reproduce the behavior:
/home
Expected behavior
The user should stay on /home
if they navigate back to /landing
the sign in button should either immediately redirect to /home
instead of auth or should change the text to Go to App
or something similar.
Desktop (please complete the following information):
Is your feature request related to a problem? Please describe.
There are quite a lot of project specific steps missing on the PR and issue templates that should be added.
Describe the solution you'd like
Checklists should be extended based off of items on GitHub checklist. Not all items on there will be applicable so use discretion.
Issue templates should have checklists added
Is your feature request related to a problem? Please describe.
This replaces the previous passwords page. It has slightly larger scope. The intent is to allow flatmates to share general information.
Describe the solution you'd like
Front-End Specification
Is your feature request related to a problem? Please describe.
There is currently no way to logout on the frontend.
Describe the solution you'd like
there should be a route /logout
that removes the token from the cache. Links to the logout screen should be added when appropriate.
Users need to be able to add and join houses.
Once a user is logged in, they need to be able to create or join a house. Detailed specification for the entire milestone is on this page.
For this task, the specs are as follows (not yet final):
An easy way to waste time is to wonder why some API calls aren't working as we'd expect. Since we are using swagger (OpenAPI), it would be nice if we could leverage that, alongside typescript, to create type definitions for our API.
Investigate tools that will allow the generation of TypeScript interfaces from swagger documents, such as this. These tools will likely want to use the swagger json located at http://localhost:4200/api-json (when the api is running).
If something like this looks promising, then implement an npm script (located in the frontend package.json
) that will generate a file containing all type definitions for our API. If more complex logic is required, then the npm script can always simply run a single javascript file with the logic implemented in there.
If I run a script (for example, npm run generate
), then a file inside the frontend directory (maybe in src/typings
) will be generated/updated that has type definitions for our API.
Task splitting (i.e. chores) is essential for any flat sharing application.
WIP - we will need to have a meeting to spec this task out.
Potential requirements:
Is your feature request related to a problem? Please describe.
In order to start integrating the app together, we should add a dashboard for logged in users.
Describe the solution you'd like
A dashboard page (partially functioning) that allows users to navigate to other parts of the application.
Bill splitting is an essential part of a flat sharing application and is the backbone of this app. Users should be able to create and share bills with their flatmates.
{
"id": "ObjectID",
"name": "string",
"description": "string",
"owner": "FirebaseID",
"due": 23424223,
"users": [
{
"id": "FirebaseID",
"amount": 23.00,
"paid": false,
"proof": "BlobID" //Optional, should get from front-end
}
]
}
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
Bill splitting is a core feature of the application.
Describe the solution you'd like
Is your feature request related to a problem? Please describe.
We could integrate l10n related features even without the requirement of having this web service in another language
Describe the solution you'd like
As we may constantly adjust our front-end design, change/addition of textual content (i.e. text paragraph, button text, etc) could be necessary. The use of hard-coded inline string within JSX could be difficult to make changes to these texts, and potentially cause bugs. Such hard-coded smell could easily be fixed by introducing a centralized configuration file that contains all textual content of the front-end service, which makes this file the only place that needs to be changed for textual adjustments. This could even be helpful for the textual content formatting purpose, and if we decide to expand the service to support another language.
Describe alternatives you've considered
react-intl https://formatjs.io/docs/react-intl/
Is your feature request related to a problem? Please describe.
As a developer, I would like to have a common code style in the React application to make the code consistent and more readable.
Describe the solution you'd like
A Wiki page outlining the code style of the react side of the app.
The proposed react conventions are written here:
https://github.com/701-T4/platform/wiki/React-Code-Conventions
Ideally, we would like to have a basic schedules page that could show some information such as move in and move out schedules.
WIP - we will need to have a meeting to spec this task out.
Potential requirements:
Is your feature request related to a problem? Please describe.
We currently only have 2,000 minutes of github actions. With our current average runtime of PR check this translates to 66 commits a day. This will be further reduced if we add in a deployment workflow.
Describe the solution you'd like
Restrict the PR check action to only running if the PR is open and not draft.
Describe alternatives you've considered
We could attempt optimisation to try drive down the execution time but I don't think we will be able to reduce down from a minute very much. Not an efficient use of time or energy.
Is your feature request related to a problem? Please describe.
External documentation, decisions and meeting minutes should be moved to GitHub wiki as per assignment requirements
Describe the solution you'd like
Pages should be created for each
Is your feature request related to a problem? Please describe.
We need a boilerplate react app in order to begin large scale development.
Describe the solution you'd like
A create-react-app boilerplate, with a basic guide on how to contribute, a scaffolded directory layout, routing, a data fetching method, CSS framework (i.e. tailwind) for our own designs and layouts, a component library for rapid development (NextUI)
Other alternatives
NextJS - won't use as it is slightly more complex and hosting may be more complicated.
Is your feature request related to a problem? Please describe.
currently we do not have a way to get all of the users in a house
Describe the solution you'd like
update endpoint GET /house
so it also return users
which is an array of UserResponseDTO
update endpoint PUT /house
so it assigns the user to another house
Is your feature request related to a problem? Please describe.
Loading screens help indicate to the user that the app is doing something, improving responsiveness (as opposed to just rendering nothing)
Describe the solution you'd like
Loading components
Wifi password sharing (and other passwords such as router logins) commonly want to be shared by flatmates.
Describe the bug
The typings on useAuth are incorrect.
To Reproduce
Expected behavior
Allow the user to be null.
Is your feature request related to a problem? Please describe.
As a developer I would like an easy way to manage all the individual packages in this repo.
Describe the solution you'd like
A Lerna monorepo will improve the developer experience by simplifying project setup.
We could have two packages:
/backend
/app
Furthermore, the root level monorpeo should contain any pre-commit hooks, such as for linting.
Describe alternatives you've considered
Is your feature request related to a problem? Please describe.
code should be heavily tested to ensure stability and correctness
Describe the solution you'd like
Investigate test runners that would be best for this project and implement it.
Please coordinate with @701-T4/front-end as they may use the same test runner.
Is your feature request related to a problem? Please describe.
Right now the login page is just blank with a sign in button. We should try to make it look nicer.
Describe the solution you'd like
Implement an actual login page.
Additional context
Potential design ideas:
Is your feature request related to a problem? Please describe.
We need to develop a base for our back-end infrastructure.
Describe the solution you'd like
A ping endpoint lets us get the initial development done so we can expand later. It will also be used by front-end to verify setup.
It should simply respond with the current time (JSON format).
Describe alternatives you've considered
I cannot think of any endpoints that would be constructive to the final product at this point in time.
Describe the bug
FindByCode query built from user-controlled sources allowing query injection attacks
To Reproduce
By entering a query injection string such as {$ne: '23424423'}
it is possible to join any room or modify the database
Expected behavior
It should instead search for a room with the code "{$ne: \'23424423\'}"
which will not exist and thus return 404.
Additional context
https://github.com/701-T4/platform/security/code-scanning/1?query=ref%3Arefs%2Fpull%2F61%2Fmerge
https://mongoosejs.com/docs/migrating_to_6.html#sanitizefilter-and-trusted
https://mongoosejs.com/docs/api.html#mongoose_Mongoose-sanitizeFilter
https://masteringjs.io/tutorials/mongoose/query-string
Is your feature request related to a problem? Please describe.
Its important to give contributors context and information about how to contribute to the project. This thread will discuss root-level files that we would want in our project.
Describe the solution you'd like
I propose the following configs and documents:
I'm defaulting to MIT but if anyone has a preference (i.e. gpl family) then please discuss.
A summary guide on how the project should be contributed to, such as git conventions, code review conventions etc.
A file introducing the project, and usage for end users.
Repo related files to be ignored and gitattributes to enforce things like line endings and treating files as binary. Going to suggest that if you haven't already, I suggest placing your IDE and OS files in a global gitignore since these aren't really relevant to the repo.
Outlines the rules for contributing. I suggest we just use one like this
Gives us the ability to assign ownership over certain parts of the code. This means contributors know who to ask for reviews when modifying files or directories (and can even be set as a branch protection requirement). Keen to hear others thoughts on this.
Apply some global styling rules (although may be unneeded if we are going with the monorepo structure).
If anything here seems unneeded, adjusting, or anything is missing, please discuss below.
Implemented in #5
We want new users to be able to see what our app is about before creating an account. There should be a button that can redirect users to the create account page.
Example landing pages:
https://discord.com/
https://www.sushi.com/
Obviously they are not needed to be near as professional as those, that would be more stretch goals. For now, something extremely basic with a title and a navbar up the top with a signup/login button would be acceptable for this to be complete.
Is your feature request related to a problem? Please describe.
We need to check the bearer tokens that are provided by front-end to verify the user is valid.
Describe the solution you'd like
Uses the firebase auth token to check that user is valid and exists in our database.
If it doesn't exist in our database create a new user in our database using the provided ID
As part of this issue please create a method in the user service that returns the currently logged in User
Is your feature request related to a problem? Please describe.
We need to check all the licenses of our dependencies to ensure they are compatible with our project
Describe the solution you'd like
We need to go through each dependency and check if we are able to use it, and if so are there any conditions to use?
We may have to add an attribution section to our app. Potentially could also attribute in the wiki but unsure
Also should add a check in the PR checklist to add any attribution required
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.