mapper-influence's People
mapper-influence's Issues
Use workspace dependencies
https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table
Since we use multiple crates for the project, workspace dependencies would make it easier for us to manage all of the dependencies.
Bad landing page performance with hardware acceleration turned off
less than 10 fps when the videos are visible 🤔
Login on production does not set session state, redirects to landing page.
Steps to reproduce:
- Login
Cookies are not being set after auth redirect
Redirect does not provide anything to use on frontend to represent auth state.
Use mock data to test database queries and API's
Currently, there are no tests to cover new database queries and API endpoints. It's good idea to use mockall package.
get_full_user has missing data
missing fields:
pending_count: number
follower_count: number
flag: { code: "TR", name: "Türkiye" }
#65
remove rust ci requirement from prs when rust code is not changed
get_user endpoint needs to return different data
get_user
function should return:
- user id
- user name
- avatar url
- background url
- user title
- number of users influenced
- user group array:
- group color
hexcode
- group short name
ex: NAT
- group long name
ex: Nomination Assesment Team
- group color
Store timestamps of influences
We want to store the timestamp of creation and the last modification of the influence.
API should return both properties
Basic Authentication
A /login
and /logout
endpoint is required.
Login endpoint
// Request
POST API_URL/login
body: {
code: "xxx",
}
// Response 201
{
token: "xxx",
user: { // This is the bare minimum info to populate the header. {id} will be used as a link
id: number,
username: string,
avatarUrl: string,
groups?: Group[] // This might not be needed, maybe can be used to color the avatar border
}
}
Logout endpoint
// Request
DELETE API_URL/logout
body: {
token: "xxx"
}
// Response 204
no content
Create endpoints to return user data
Two endpoints are needed:
1 - Base user info
Returns basic user information such as user id, name and avatar url.
This is just a proxy for the osu api, there is probably a function that implements the api request already.
2 - Extended user info
Returns the information needed to populate the profile page.
This includes their bio, influences and mentions on top of the base user info.
Up to you if you want to include the base info in the extended info endpoint.
If you want a more specific return type, tag me.
Add count of the user added as influence and the influences added as the user in the user endpoint
Currently the user endpoint is missing the total number of times that other users added the user as influencer and the list of influences that the user has added themselves.
extends #136
Check for session expire time when logging in from previous session cookie
Currently the api request fails because auth function does not check for expired sessions.
Add refresh token logic and force to re-authenticate if both are expired.
Need public leaderboard api
The leaderboard is shown in the homepage, so it shouldnt have authorization requirement
Number of users returned could be a dynamic number from the query, with max and min values of course.
Returned array of values:
- user data
same as get_user
- influence count
number of users who added this person
array should be ordered by influence count
Handle expired cookies
Backend should control and handle expired cookies
- Delete cookie when user session is expired
Fix broken `init_user` test
Our init_user
test on mi-db
is broken. It should be fixed.
Add custom error type for Osu! Auth requests
Success or Fail are way too vague, we want to know why auth request is failed
route user to /dashboard from landing page if they are logged in
when opening the site while logged in, the landing page is shown until the user is fetched.
we can redirect the user to /dashboard before getting the user info from the backend
we can redirect the user to /dashboard after logging in as well, easy to change in env vars
Confirm users granted the correct permissions
It is possible to manipulate the scopes when redirected to Osu! OAuth page. For example, if a user removes public
from the query parameter scope
and we try to make an Osu! Request that depends on that scope with that user's token, API fails because of insufficient permissions.
We want to know if the user granted us the correct permissions before letting them use the site.
Update `opentelemetry` and `opentelemetry-otlp`
Currently, the latest version fails to compile. I did not spend too much time debugging so it might be a very simple fix.
Change log namespaces
Current logs are under HTTP namespace, this needs to be changed
Refactor dynamic CSS variables to be more local in files
Currently all of the colors used in the site is in one file. For example: Colors used in the user card component could be defined in that folder.
Use an environment variable to redirect after the authentication
Add an endpoint for profile page data
Current endpoints arent enough to construct the profile page.
Connected to this issue: #65
Needed fields:
- boolean for if the user has already added this person
can use the cookie to get the requesting user,
can be a separate endpoint - influence data
- influence array of:
- influenced user -> same with get_user data - influence strength - influence description - example maps -> should have the function to pull map info
- mentions array of:
- connected user -> same with get_user data - boolean if the user entered a description
- influence array of:
- map count info
graved, pending, ranked etc. maps
- user bio
moved from get_user to this endpoint
- featured maps
area under bio in which the user can showcase their maps, this can either be just the map id or map information such as song metadata and difficulty name
This is the information needed to fill the profile page. Reference design:
Newly created user is missing map data
Check if user exists before inserting authed user to database
User leaderboard return data has irrelevant data
Currently, we use the user id to generate their cards. Those ids are fetching their user data individually.
The current return is this:
type LeaderboardResponse = {
id: number;
user_name: string;
profile_picture: string;
ranked_map_count: number;
influence_count?: number;
};
We only need the id and probably influence count. We could access the influence count from the user data so it is not mandatory. Would be nice to have though.
An alternative is to have all of the base user data to immediately render the users.
Proposed return type:
type LeaderboardResponse = {
id: number;
influence_count: number;
};
Fixing `cargo-deny` warnings
cargo-deny
CI check has warnings, therefore it fails even on main branch.
Text fit function has terrible performance with window resize
Need to eliminate the need for it in the card username displays. There is a new card design which has enough space:
connected issue: #65
Need a leaderboard api
either need pagination or dynamic size query, can be hardcoded for now
would be nice to have map leaderboards alongside user leaderboards
returns array of:
{
user: // base user data for card
count: // influence count for scoring
}
or for maps
{
map: // base map data for card
count: // influence count for scoring
}
Refactor SQLx tests to reduce connection errors
SQLx creates a separate database for each test annotated with #[sqlx::test]
, and sometimes our test suite fails because SQLx can't connect to the database. Ideally, we want as few tests as possible so we won't get database connection errors when running the tests.
One way to solve this would be merging similar tests into one test. Such as:
#[sqlx::test]
async fn test_insert_user(db: PgPool) { /* ... */ }
#[sqlx::test]
async fn test_insert_no_bio(db: PgPool) { /* ... */ }
#[sqlx::test]
async fn test_insert_same_id(db: PgPool) { /* ... */ }
// These three tests can be merged into one test
#[sqlx::test]
async fn test_insert_user(db: PgPool) { /* We test all of the insert scenarios here */ }
Handle oauth reject on `/auth`
Update CI
Currently, our CI workflow is very redundant and it makes it harder for us to edit/update/add jobs. Ideally, we want to use a matrix to set up the redundant CI commands.
In addition to that our tests are dependent on various services so it might be better to use our build commands instead of cargo actions. (not really sure about this)
get_influences id parameter should be in the url
there should be no body in a get request according to https://www.rfc-editor.org/rfc/rfc2616#section-4.3
no need to have an optional id
need a user search endpoint
the endpoint should return the base user data (see #65)
with that, a boolean for whether the user has already registered to the site or not would be nice.
could use path parameters for request because there is a 13 char limit to usernames:
GET .../search/:string
[
{
"user": { ... },
"registered": true
}
]
`/v1/user/get/:user_id` not working
2 problems:
- Empty user_id request not working. Should be returning user connected to the cookie sent
- Both valid and invalid user_id throws
Unsupported type `core::option::Option<i64>
Add `justfile` to project
Currently, we use Make
to simplify the development workflow. Make
is great and enough, but I personally would like to have a justfile
in the project.
just
: (https://github.com/casey/just)
Need a function to pull map metadata from osu api with set id
Currently we have a function to lookup beatmaps with their difficulty id, we cannot find maps with just a setid
v2/beatmapsets/[id]
Add CORS rule, from env if possible
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.