Skip to content

Ramer8/Mobility-API-Frontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Mobility App


Mobile device ExperienceπŸ“±


Desktop Experience πŸ’»


GITHUBDOCKERNPMExpressMYSQLREACTJAVASCRIPTJWT

Thank you very much for your interest in my work. It's the last project, a complete full stack project with Geekshubs Academy of the Full Stack Development Bootcamp πŸš€. This is design of Mobility-API-Backend repository ( the ninth and last project of the course ).


Description

The users hire a service to transport people from one place to another paying a price for it. The Users can register for the application, log in and access it. The next step is to create the mobility application for car drivers, to complete all the functions of the application. Relationships and migrations already exist in this database. The registered user can search for a destination, choose between different types of cars and make the trip. A driver responds to the request and picks up the passenger, once the trip is completed, they can rate the driver. Users must complete their profile and choose the method of payment. They can also access their travel history.


Link to App Deployed βš™οΈ

    https://mobilityapp.zeabur.app/login


Flow Chart

The rectangle with black font inside represent the moment after loggin / register The rectangle with red frame and shadow letter in red belong to Minimum Viable Product (MVP) At least the flow chart was completed totally. Several data were hard coded because the driver's side application is not yet ready.


Develop

To start writing code, several problems had to be solved. The design of the database, its relationships. The connection with the external api and how to get the necessary data to show in frontend. The frontend and backend stack.

Start from scrach

The backend was built with Node, Express, TypeScript and MySQL database on a Docker container. In the frontend I had doubts whether to start with TypeScript or Javascript, but then I decided for Javascript always in React. React router dom to organize routes and Redux for global state management.


First Data Base Structure


  • Users
  • Drivers
  • Trips

  • Cars
  • Brands

  • User
  • Drivers
  • Roles

Thats tables have relation between us.

Data Base Diagram


Drafts

Develop

REST API design for FRONTEND

Create three main tables, User, Driver and Trip. They are related to each other. The fields of the Trip table are: id, user id, car id, driver id, start location, destination, trip date, trip date start and trip date finish. The User table fields are: user name, email, password, role, phone, payment, address, work address, saved address, documents, message and location. The Driver table fields are: driver name, email, password, role, phone, score, car id, documents, driver message and location.


Views

Computer Device πŸ’»

Register page

http://localhost:5174/register


Login page

http://localhost:5174/login


Home page

http://localhost:5174


Editable User profile

http://localhost:5174/profile


Start a Trip

http://localhost:5174


Super Admin Dashboard


http://localhost:5174/managment


Delete one or more Trips & delete one or more Users (SuperAdmin)

http://localhost:5174/managment


Search Users by name or email (superAdmin)


http://localhost:5174/managment


Mobil device πŸ“±

Register page

http://localhost:5174/register


Login page & check inputs errors

http://localhost:5174/login


Payment Design



Design



The whole project is designed with CSS without external libraries except the error managment external library. It is responsive on mobile, tablet or desktop and is very easy to configure in Dark 🌘 and Light β˜€οΈ mode.


App Deployed βš™οΈ

  1. Clone Repo

    npm install

  2. Launch the project in your local device:

    npm run dev

    Enviroment variables πŸ”‘

    The app need google maps api key to work. Attach file .env.example

    VITE_API_URL = http://localhost:XXXX/

    VITE_GOOGLE_MAPS_API_KEY=XXXX

  • Then in localhost:PORT, will be launched the application, and you will be on the landing page (Home).

  • Libraries used

    I decided to use google maps plataform libraries to get localization and routes.

    Google APIs Node.js Client

    https://www.npmjs.com/package/googleapis


    I choose React-Toasty to show error messages

    React-Toastify

    https://www.npmjs.com/package/react-toastify


    Next steps ⎘

    Create Driver mobility app to pick up a trip from a user, edit driver profile, send a message to the passenger and monitor the benefits obtained from work. Continue to build components, buttons and inputs from the respective endpoints created in the backend and think about future functionality. Refactoring and testing. Add users & drivers image to database.


    Contact

    About

    No description, website, or topics provided.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published