WorkwiseWeb is the backend API for a professional networking and job-seeking application. Built with FastAPI, it provides a comprehensive set of features for user management, profile customization, job searching, and union membership tracking. The API is designed to be robust and scalable, utilizing a SQLite database for data persistence and Argon2 for secure password hashing.
π± It is the backend for Workwise, the native Android client. That app talks to every endpoint below.
Eighteen endpoints across auth, profiles, CVs, qualifications, stats, saved jobs, unions and chat,
all documented automatically at /docs:
- π Secure Authentication: User registration, login, and password reset functionality using email verification codes. Passwords are securely hashed with Argon2.
- π€ User Profile Management: Full CRUD capabilities for user profiles, including personal details, bio, contact information, and location.
- π File Uploads: Supports uploading and managing user profile images and CVs (PDF, DOC, DOCX). Files are stored on the server's filesystem.
- π CV & Qualification Management: Users can upload multiple CVs, set a primary one, and manage their educational and professional qualifications.
- πΌ Job & Application Tracking: View job listings, save interesting jobs, and track statistics like the number of saved jobs and applications.
- π€ Union & Membership Management: Functionality to create and list trade unions, as well as manage worker memberships within those unions.
- π Token-Based API Security: Endpoints are protected using a static token-based authentication via the
X-Endpoint-Tokenheader.
- Backend: Python, FastAPI
- Web Server: Uvicorn
- Database: SQLite
- Password Hashing: Argon2 (
passlib) - Data Validation: Pydantic
- Dependencies:
python-multipart,jinja2
Follow these instructions to get a local copy up and running for development and testing purposes.
- Python 3.8+
- A virtual environment tool (e.g.,
venv)
-
Clone the repository:
git clone https://github.com/nevvyboi/workwiseweb.git cd workwiseweb/Src -
Create and activate a virtual environment:
- On macOS/Linux:
python3 -m venv venv source venv/bin/activate - On Windows:
python -m venv venv .\venv\Scripts\activate
- On macOS/Linux:
-
Install the required dependencies:
pip install -r requirements.txt
-
Set the endpoint token: Every protected route is guarded by one shared secret, read from the environment. Generate one and export it:
export WORKWISE_ENDPOINT_TOKEN="$(python -c 'import secrets; print(secrets.token_urlsafe(24))')"
Leave it unset and the app generates a throwaway token at startup and prints it, so a fresh clone runs immediately. That value changes on every restart, so set it properly for anything beyond local poking. No token is stored in this repository.
-
Run the application:
uvicorn main:app --reload
The API will be available at
http://127.0.0.1:8000. You can access the interactive API documentation athttp://127.0.0.1:8000/docs.
All API endpoints are protected and require an X-Endpoint-Token header carrying the value of
WORKWISE_ENDPOINT_TOKEN.
curl -X POST "http://127.0.0.1:8000/v1/workwise/account" \
-H "Content-Type: application/json" \
-H "X-Endpoint-Token: $WORKWISE_ENDPOINT_TOKEN" \
-d '{
"username": "newuser",
"email": "newuser@example.com",
"password": "a-strong-password"
}'
β οΈ One shared token is a gate, not authentication. It ships inside the Android client, so treat it as a way to keep casual traffic off the API rather than as per user security.
The API is organized into the following categories, visible in the /docs:
- π auth: User registration, login, and password management.
- π€ profile: CRUD for user profiles and image uploads.
- π cv: CV listing, uploading, and management.
- π qualifications: CRUD for user qualifications.
- π stats: User activity statistics.
- πΌ saved_jobs: Saving and managing jobs.
- π jobs: Public endpoints for listing and viewing jobs.
- π€ unions: Creating and listing trade unions.
- π₯ union_members: Managing memberships in unions.
The application uses SQLite as its database. The database file, databaseWorkwise.db, is automatically created in the Src/ directory upon the first run of the application. The necessary tables are also created and initialized by Database/db.py.
The database schema includes tables for:
usersπ₯cvsπqualificationsπjob_applicationsπsaved_jobsπΌjobsπunionsπ€union_membersπ₯password_reset_tokensπ
This project is released into the public domain under The Unlicense. See the LICENSE file for more details.
