
- Overview
- SaturnV's Features
- Tech Stack
- Setup and Installation
- Running the Application
- Frontend Documentation
- API Documentation
- Known Issues
- Credits
SaturnV is a geospatial task manager application that takes the advantage of the power of Google Maps API & UI. SaturnV is powered by Vite on the front-end and Python on the back-end.
- Google Maps feature integration: Street View, Satellite view, Layering, and more.
- Task-panning by clicking "See Task".
- Create, Read, Update, and Soft-delete Tasks using the front-end GUI.
- Tasks that are detected to be overdue (deadline date > datenow) will automatically be rendered in the "Overdue" Tab.
- React Google Autocomplete that can input the task coordinates even on the lowest level like street names.
- Zoom in the task location by clicking on the marker in the Google Maps.
- Role-based Access Control: "Admin" role can see all tasks, meanwhile "Staff" role can only see tasks that they are assigned to.
- Task assignment is done by using the valid email.
- Vite
- Tailwind CSS
- Material Tailwind
- @react-google-maps/api
- Google Map API key
- Yup
- Formik
- react-toastify
- Fontawesome
- Python 3.10/3.11
- Flask
- Flask-JWT-Extended
- PyMongo
- Bcrypt
- Marshmallow
- An active MongoDB instance
-
Clone the Repository:
git clone this repository
-
Install Dependencies: Navigate to the project directory and install the required Python packages:
Frontend: 1. npm install
Backend: 1. pipenv install 2. pipenv shell 3. pipenv run flask run --debug
-
Environment Variables: Set up the required environment variables, including
JWT_SECRET_KEY
, Google Maps API and MongoDB connection details -
Database Configuration: Ensure MongoDB is running and accessible as per your configuration.
Execute the following command in the project root directory:
Backend:
1. pipenv shell
2. pipenv run flask run
Then, run the Frontend:
1. npm run dev
During the development, I found out that you have to check for and initialize the Google Maps API Key on a page component that can wrap a parent components that require google maps API to function.
For instance,
[page - init here] ---> GoogleMapsLoader.jsx
|
[parent] ---> AddTaskContainer.jsx
|
----------------------------
| |
V V
[children] ---> MainMapComponent Taskform
.jsx .jsx
Initially, I tried to just render MainMap
and TaskForm
inside the TaskContainer
, but that raised a problem. Both the MainMap
and TaskForm
each conducted API calls which breaks the application because in a single page, there cannot be two application calling the API at once.
- Context APIs that manages data across components.
MapCenterProvider
-> wrapper provider that enables the map to pan to a task location by transferring the coordinates between components
- Self explanatory, these are also where GoogleAPI are checked and initialized to be used in the children components
- Containers that wraps renders the Google Map and task CRUD containers
- CRUD containers for task management
- Smallest bits of components that constitutes the CRUD containers
- Checker function to ensure that user is logged in. Else, they are kicked to the login page.
-
Create Task -
POST /tasks/
- Creates a new task.
- Requires JWT authentication.
- Request body should contain task details.
-
Get Task -
GET /tasks/<task_id>
- Retrieves a specific task by its ID.
- Requires JWT authentication.
-
Update Task -
PUT /tasks/<task_id>
- Updates an existing task.
- Requires JWT authentication.
-
Soft Delete Task -
PUT /tasks/softdelete/<task_id>
- Soft-deletes a task by setting its
isDeleted
flag. - Requires JWT authentication.
- Soft-deletes a task by setting its
-
Change Task Status -
PUT /tasks/<task_id>/change_status
- Changes the status of a task.
- Requires JWT authentication.
-
Get All Tasks -
GET /tasks/
- Retrieves all tasks.
- Requires JWT authentication.
-
Register User -
POST /users/register
- Registers a new user.
-
Login User -
POST /users/login
- Authenticates a user and returns a JWT token.
-
Update User Password -
PUT /users/update_password
- Updates a user's password.
-
Get Current User -
GET /users/me
- Retrieves the currently logged-in user's details.
- Requires JWT authentication.
-
Get All Users -
GET /users
- Retrieves a list of all users.
- Requires JWT authentication.
- Performance optimization is needed to ensure far more efficient API call from the front-end.
- Jittery map dragging. Sometimes when dragging the Google Maps component, the task labels on the map, for a split second, are rendered in the wrong position. However, task zoom-in and panning still works fine
- Checker functions
Looking forward to see forks that can assist with those problems!
- Big thanks to my mentor/team leader in RevoU Fullstack Software Engineering bootcamp, Mas Dion M.W.