Skip to content

HarshalBhalerao/Sun-Mart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sun (Farm Mart)

Website for farmers to buy farming equipment

Tech Stack: Next.js (React.js framework), Tailwind CSS, and shadcn UI.

⚠️ Internal company version: Has mock information of clients and their payments. Can mock add clients to company database

Installation

To install, clone this repo using the command below:

git clone https://github.com/HarshalBhalerao/probable-octo-chainsaw.git

Backend

Install Docker and run the command below.

⚠️ Ensure you are in the directory with docker-compose.yml file

docker-compose up -d

Now the server would be up and running at port 3030. For more info, visit https://github.com/dotronglong/faker/wiki/Getting-Started-%5BDocker%5D

Frontend

Navigate to directory called front-end. And, run command:

npm i
npm run dev

This will launch the website on localhost:3000. Currently the website is in dev mode.

You can also launch the app by running the command below:

npm run build
npm run start

The following commands above would build and start the app in prod mode.

Folder Structure

In front-end directory, there are 3 main folders:

  • app: Contains pages and routes (We don't have any dynamic routes in this project).
    • (home): This is not a part of Next.js route, the page.tsx file inside is the default homepage.
    • __tests__: Contains tests for APIs.
    • clients: Part of our Next.js route. Can be searched by going to localhost:3000/clients. Contains our table with pagination, filtering and search functionality.
      • add: Part of our Next.js route. Can be searched by going to localhost:3000/clients/add. This contains the form for adding user (mock POST don't actually add user, would be possible if we had a real DB).
    • products: Part of our Next.js route. Can be searched by going to localhost:3000/products. Contains carousel which automatically changes cards and these cards have info about our farming equipments.
  • components: Contains a mixture of reusable and custom made components.
  • lib: Utility files.

Testing APIs

We have 3 APIs:

  • GET Client
  • POST Client
  • GET Product

Mock files are available in mocks folder. To run tests

npm run test

Philosophy

Built the app keeping these things in mind:

  • Build for performance: By default Next.js allows Server-Side Rendering(SSR), helps with Search Engine Optimization (SEO). I have used this to my advantage and rendered pages dynamically. I have practised code-splitting ensuring peak-performance.
  • User friendly: Simple design with consistency and user-friendly interface. Have system, dark and light modes for users.
  • Handled errors where things could go wrong.
  • Responsive design for all browser viewports.

Detailed Information about each page

Other components

  • Navbar
  • Sidebar

Landing Page (Simple Landing Page with Spline 3D moving Earth)

Dark Mode

Screen Shot 2024-01-22 at 12 06 14 AM

Light Mode

Screen Shot 2024-01-22 at 12 06 04 AM

Product Page (Carousel)

Dark Mode

Screen Shot 2024-01-22 at 12 10 34 AM

Light Mode

Screen Shot 2024-01-22 at 12 10 44 AM

Client Page (Table)

Dark Mode

Screen Shot 2024-01-22 at 12 12 34 AM

Light Mode

Screen Shot 2024-01-22 at 12 12 22 AM

Client Page (Form: Add new client)

Dark Mode

Screen Shot 2024-01-22 at 12 13 41 AM

Light Mode

Screen Shot 2024-01-22 at 12 13 47 AM

For Mobile devices

Landing Page

Screen Shot 2024-01-22 at 12 17 52 AM

Products Page

Screen Shot 2024-01-22 at 12 18 02 AM

Client Page (Table, set fixed min-width for better view)

Screen Shot 2024-01-22 at 12 18 29 AM

Client Page (Form to add client)

Screen Shot 2024-01-22 at 12 17 23 AM

Sidebar

Screen Shot 2024-01-22 at 12 17 42 AM

About

Full-Stack Next.js Application with Mocked Backend API Integration

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published