ZhiXue Lite banner

ZhiXue Lite

14 devlogs
24h 26m 16s

Lightweight Web App for Integrating with zhixue.com's Official API, built using the frontend stack Vite + React + Tailwind CSS and the backend stack Python Flask + PostgreSQL.

[I apologize for any language problems. You can use your browser's …

Lightweight Web App for Integrating with zhixue.com’s Official API, built using the frontend stack Vite + React + Tailwind CSS and the backend stack Python Flask + PostgreSQL.

[I apologize for any language problems. You can use your browser’s built-in translation feature to view the demo site. I have tried my best to use English in areas not visible to users such as commit messages :(]

Demo Repository

Loading README...

Makerlife

Shipped this project!

Hours: 4.3
Cookies: 🍪 33
Multiplier: 7.75 cookies/hr

This update is to release the features mentioned in the previous devlog.

Since zhixue.com only serves Chinese users, I haven’t had the chance to provide an English translation for my website yet. I sincerely apologize for this.

To help you better understand how the project works, I’ve recorded a demo video. Here’s the link: https://www.awesomescreenshot.com/video/50450199?key=e47a6c5b4ab6911f5e3bbe207fbbafbd

Makerlife

With this backend update, I completed a key task: fixing string scores in exam data by converting them to numeric types for accurate sorting and processing.
Initially, I considered broader changes to data ingestion, but for consistency, I added a try_numeric() function in the exam routes to handle conversions directly in sorting and export logic, avoiding database modifications.
I also improved teacher route error handling with specific login error catching and Loguru logging, providing clearer user feedback and better debugging. These updates enhanced data integrity and maintainability without migrations.

Attachment
0
Makerlife

Shipped this project!

Hours: 21.93
Cookies: 🍪 204
Multiplier: 18.24 cookies/hr

I’m reship to announce this new feature, and hope it will lead to a fairer payout as discussed in Slack.

Adding this new third-party interaction is a real headache because I find both the code and the request/response formats hard to grasp. I can only send packets and test bit by bit.

Makerlife

I added a new feature to the user account binding function, enabling users to now bind parent accounts.
This completes our support for all three account types on zhixue.com.

During implementation, I encountered some challenges. The authentication mechanism on zhixue.com proved quite confusing. One API endpoint persistently reported that the token had expired. Ultimately, I resorted to using the re library to parse HTML and retrieve the data.

Attachment
Attachment
0
Makerlife

Shipped this project!

Hours: 9.0
Cookies: 🍪 47
Multiplier: 5.18 cookies/hr

A major reship!

This reship primarily updates the project’s backend.

I added ranking total user counts to the score API, implemented pagination using SQL’s OFFSET/LIMIT, added regular expression validation for user-submitted email addresses, automatically selected appropriate login methods for teacher and student accounts, encrypted storage for all Zhixue account sensitive information, and more.

There were also some updates on the frontend, which I won’t list individually.

This taught me how to use regular expressions, Python’s most widely used AES encryption library, etc.

I consider it a highly rewarding experience!

Makerlife

I made a security update.

My backend now uses AES symmetric encryption to store users’ Zhixue (third-party) passwords. This significantly enhances user data security while boosting the project’s credibility.

Unfortunately, since this is a low-level update, I can only demonstrate the new changes by taking screenshots of the development environment database.

Attachment
0
Makerlife

With this backend update, I completed one task from my to-do list: automatically selecting the appropriate login method for teacher and student accounts.

Initially, I planned to add a new database entry. However, for consistency and maintainability, I opted to directly add a login_method field to the stored cookie. I then maintained this cookie value within relevant methods and functions like update_login_status(). This approach eliminated the need for database migration operations, making the program easier to maintain.

Attachment
1

Comments

omarhany0510
omarhany0510 26 days ago

not bad

need some work

Makerlife

For this update, I started with the frontend:

I added clearer disclaimers when users bind/unbind third-party accounts, helping them better understand how the system works.

For the grade list from the last update, I tweaked the frontend to automatically hide grades for subjects the user hasn’t taken and added a button to restore their display.

I tweaked the column widths for some tables in the admin panel to make them more visually consistent.

When it came to the backend, I mostly worked on making improvements to security and performance. I replaced in-memory pagination with SQL LIMIT/OFFSET to improve processing efficiency. I also made sure that user-submitted email formats were valid by using regular expressions.

I’ve come to think that Golang is a better fit for this backend, and I’m planning to rewrite it in Go at some point.

Attachment
Attachment
0
Makerlife

I’ve finished my final exams, and I’m so excited to see what the future holds!

This time, I added a feature displaying the total number of students for both the overall score and subject rankings, allowing users to better gauge their standing.

I’m thrilled to share that I’ve revamped the frontend pages, making them more modern and easy to read than ever before!

This update opened my eyes to the unique regular expression usage (~) specific to PostgreSQL databases.

Unit tests saved my life during testing when they flagged a backend bug I hadn’t noticed.

Attachment
Attachment
Attachment
Attachment
0
Makerlife

Shipped this project!

Hours: 2.57
Cookies: 🍪 19
Multiplier: 7.46 cookies/hr

I spent a weekend’s worth of spare time outside my studies updating the user management features in the admin panel, and it was so much fun!
This fantastic feature provides administrators with an unparalleled user experience and significantly boosts debugging efficiency.
I’m thrilled to say that I’ve gained a deeper understanding of component nesting structures on the frontend side. I’m excited to put this knowledge to use and avoid repeating previous minor errors.

Makerlife

While helping a user with an issue, I suddenly realized I couldn’t view or set the email verification status for a particular user. I added a badge display for the email verification status in the admin panel. I also added a button that lets you change the email verification status in the user edit dialog.
Also, for logging, I turned on enqueue logging for the main app, which makes sure the threads are safe and prevents fragmented log files.
I also fixed a minor bug in the UI. When you clicked save in a dialog, it would immediately disappear and reappear. I figured out that I had the dialog inside a component.

Attachment
Attachment
0
Makerlife

Shipped this project!

Hours: 2.69
Cookies: 🍪 53
Multiplier: 19.6 cookies/hr

A reship!

I’ve been working on beefing up the backend security features lately. I’ve been doing things like setting up CDN rules, changing up the way to name logs, and putting in limiters.

Then, I’ll work on the items on my to-do list one by one and make sure the updates are in sync on both the frontend and backend. But right now, my main focus is on studying for my final exams.

Makerlife

It’s a major update!

I finally added Redis support for the long-dormant rate limiting feature on the backend, making it truly functional!

I also turned on the option to disable the limiter or use in-memory storage in the development environment, since my Windows doesn’t support Redis.

Just a few minor tweaks: I went ahead and formatted all the actual code in the project and got rid of the deprecated version parameter from the Docker Compose file.

Attachment
Attachment
0
Makerlife

The old log naming scheme was a bit of a mess, and I often found myself struggling to quickly find log files when users reported an issue.

So, I submitted a commit to make log naming more consistent and readable (maybe), while also getting rid of the automatic retention feature.

I also changed the storage method for flask-session in tests from filesystem to cachelib, which enabled in-memory session storage. The tests showed that this cut the average test execution time by about 3 seconds and significantly reduced disk I/O operations.

Attachment
Attachment
Attachment
0
Makerlife

Made minor adjustments to the backend API’s authentication and regional restrictions.
Now everyone can enjoy a better browsing experience!

I learned how to configure caching and access rules within the CDN and adjust them as needed to deliver the best user experience and fastest speeds.

Attachment
Attachment
0
Makerlife

Shipped this project!

Hours: 4.66
Cookies: 🍪 77
Multiplier: 16.63 cookies/hr

By building this website, I’ve helped many classmates better access their grades!

I’ve been studying Tailwind CSS and shadcn/ui.

Through conversations with classmates, I gained insights into real user needs and questions, which helped guide my project’s direction.

Makerlife

Add browser checker banner
Add close button to answer sheet dialog components
Add current school id toggle in exam fetch dialog
Remove duplicate scrollbars in dialog components

Attachment
Attachment
0
Makerlife

Update footer to include ICP link.
Clean up commit hash display.

Attachment
0
Makerlife

Fix two tests in backend.
Add a prompt in login page to prevent potential confusion

Attachment
0
Makerlife

Initial build.
Update corresponding backend files.
Refactor minor portions of code for improved readability.

Attachment
0