Welcome to the Freight Forwarder App! This application serves as a logistics solution for shipping packages worldwide. It includes a user-friendly interface for managing shipments and an authentication system for shipping companies and end-users. You can implement an app inbox in Next.js application by checking out this guide
Check out the live demo of the application here.
- Authentication: Login form with fields for company name, end-user name, company email, and end-user email.
- Shipment Management: Add and list shipments, with details like tracking ID, company, destination, weight, and status.
- Copy to Clipboard: Easily copy tracking IDs to clipboard.
- Responsive Design: Optimized for both desktop and mobile views.
To get a local copy up and running, follow these steps:
- Node.js
- MongoDB
-
Clone the repository:
git clone https://github.com/SuprSend-NotificationAPI/b2b2c-freight_company.git cd b2b2c-freight_company
-
Install the dependencies:
npm install
-
Create a
.env.local
file in the root of your project and add your MongoDB connection string:MONGODB_URI=your-mongodb-connection-string
-
Run the development server:
npm run dev
-
Open http://localhost:3000 with your browser to see the result.
- Go to the home page.
- Fill in the login form with the required details and click "Login".
- On successful login, you will be redirected to the dashboard.
- On the dashboard page, fill in the form to add a new shipment.
- The shipment details will be displayed in the table on the right side.
src/app/page.tsx
: Home page with the login form.src/app/dashboard/page.tsx
: Dashboard page with shipment management functionality.src/app/api/login/route.ts
: API route for handling login requests.src/app/api/shipments/route.ts
: API route for managing shipments.src/lib/dbConnect.ts
: MongoDB connection utility.
-
POST
/api/login
Request Body:
{ "companyName": "string", "endUserName": "string", "companyEmail": "string", "endUserEmail": "string" }
Response:
- 200: Login successful
- 400: All fields are required
- 500: Internal server error
-
POST
/api/shipments
Request Body:
{ "company": "string", "destination": "string", "weight": "number" }
Response:
- 200: Shipment added successfully
- 400: Validation error
- 500: Internal server error
-
GET
/api/shipments
Response:
- 200: List of shipments
- 500: Internal server error
- Framework: Next.js
- Styling: Tailwind CSS
- Icons: Font Awesome
- Database: MongoDB
- Deployment: Vercel
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.