This project is a Pico y Placa Predictor that helps users determine whether their vehicle is allowed on the road based on the Pico y Placa regulation in Quito, Ecuador. Users can input their vehicle's license plate, date, and time to check if they are permitted to drive on the specified date and time.
Frontend: Built using React for a responsive and interactive user interface. Backend: Developed with Express to handle requests and apply the Pico y Placa logic efficiently.
The Pico y Placa Predictor uses input from users such as the vehicle's license plate, date, and time to check if the vehicle is restricted from driving. The application is divided into two parts:
- Backend: Handles the validation of the Pico y Placa rules based on the last digit of the license plate.
- Frontend: A simple form for users to input their details and view the result in a modal popup.
- Validate both Car and Motorcycle license plates.
- Check if a vehicle can drive based on Pico y Placa regulations.
- Displays results in a modal with a clear message.
- Validation for incorrect or incomplete inputs.
Before you start, make sure you have the following installed on your machine:
- Node.js (v14.x or later)
- npm (comes with Node.js)
- Docker (optional, for running the backend in a container)
git clone https://github.com/your-username/Pico-y-Placa-Predictor.git
cd Pico-y-Placa-PredictorNavigate to the backend/ directory and install the dependencies:
cd backend/
npm installNavigate to the frontend/ directory and install the dependencies:
cd ../frontend/
npm installYou can run the backend server locally or with Docker.
To start the backend server, run the following command from the backend/ directory:
cd backend/
node app.jsThis will start the server at http://localhost:3000.
To run the backend in a Docker container, use the following commands:
cd backend/
docker build -t pico-placa-backend .
docker run -p 3000:3000 pico-placa-backendThe backend will be available at http://localhost:3000.
Once the backend is running, you can start the frontend.
Navigate to the frontend/ directory and run:
cd frontend/
npm run devThis will start the React development server at http://localhost:5173.
You can run backend tests with Jest. Navigate to the backend/ directory and run:
npm test