-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up #1074
base: main
Are you sure you want to change the base?
Clean up #1074
Conversation
✅ Deploy Preview for activist-org canceled.
|
Thank you for the pull request!The activist team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :) If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and Development rooms once you're in. Also consider joining our bi-weekly Saturday dev syncs. It'd be great to have you! Maintainer checklist
|
Are the i18n checks still failing for you, @to-sta? Just checking if your last commit used the ignore pre-commit functionality and the checks are still problematic... |
There are no problems. I started working on this branch before we fixed the i18n check, so I initially commented out the pre-commit hook but have now reverted that change. |
Contributor checklist
Description
I worked on cleaning up the backend to make it leaner
Overview
1. Renamed backend/backend to backend/core
The inner backend folder was renamed to core to provide more clarity and better reflect its purpose as the directory holding core Django settings.
2. Script to analyze API calls in the frontend
To better understand which API calls are actively used, I wrote a script that scans the frontend codebase for API patterns. Currently, it looks for three different base URLs: `localhost:8000`, `127.0.0.1:8000`, and `${BASE_BACKEND_URL}`.
Results:
3. Streamline BASE_BACKEND_URL
The use of `127.0.0.1`, `localhost`, and `${BASE_BACKEND_URL}`in the frontend was inconsistent. To simplify and prepare for production, all references now use the environment variable BASE_BACKEND_URL, which can be dynamically set (e.g.,` backend.activist.org` or `api.activist.org`).
Updated Results:
4. Remove unused API's that are just boilerplate anyways
Here are the API that are currently exposed:
Compared to the APIs currently in use, a significantly larger number are exposed, many of which are boilerplate
viewsets
.Updated:
5. Improving DB field names
Model field names within django add `_id` automatically to the column name, therefore if we are naming fields:
The SQL query would be:
What is a bit odd right? This change will needs to be adopted by the frontend.
Open
@andrewtavis my assumption would be that the pinia stores might need to be updated to refelect the changes (e.g.
groupId
->group
)Related issue