Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
deepsingh132 committed Dec 21, 2023
2 parents af7c792 + 81df4ab commit 29d8162
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 19 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend/

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: './backend/package-lock.json'
- run: npm ci
working-directory: './backend'
- run: npm run build --if-present
working-directory: './backend'
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<div
align="center"><img src="./frontend/src/icon/appicon.svg" width="300"></div>
<div align="center">
<!-- <img src="./frontend/src/icon/appicon.svg" width="300"> -->
<img src="./Screenshots/desktophome.png" alt="desktop-home" height="200"/>
</div>



<br>

# BooksBy - A MERN Full Stack E-commerce Project
# BooksBy - A MERN Full Stack E-commerce Platform

![example workflow](https://github.com/deepsingh132/booksby/actions/workflows/node.js.yml/badge.svg)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/facebook/react/blob/main/LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://reactjs.org/docs/how-to-contribute.html#your-first-pull-request)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/facebook/react/blob/main/LICENSE) ![downloads](https://img.shields.io/github/downloads/deepsingh132/booksby/total)


Welcome to the readme for the MERN (MongoDB, Express, React, Node.js) full-stack e-commerce project named BooksBy (stemmed from BooksBuy pronounced Books-Bee). This project is focused on developing an e-commerce website that specializes in selling books based on students' schools, colleges, and other institutions. The website provides a comprehensive search functionality that allows users to find books by their titles, and also displays relevant school information and the books used in the school's curriculum, if applicable.

Expand Down Expand Up @@ -334,4 +340,4 @@ This MERN full-stack e-commerce project is licensed under the [MIT License](http

If you have any questions or suggestions regarding the project, please feel free to reach out to me at [[email protected]](mailto:[email protected]).

Thank you for your interest in the MERN full stack e-commerce project - **BooksBy**! I hope this platform proves to be a valuable resource for students and educational institutions alike.
Thank you for your interest in the MERN full stack e-commerce project - **BooksBy**! I hope this platform proves to be a valuable resource for students and educational institutions alike.
4 changes: 2 additions & 2 deletions backend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const PORT = process.env.PORT || 5000;

app.use(
cors({
origin: ["https://booksby.up.railway.app"],
origin: ["https://booksby.onrender.com"],
})
);

Expand Down Expand Up @@ -52,4 +52,4 @@ routes(app);

app.listen(PORT, () => {
console.log("Backend server is running at: " + PORT);
});
});
20 changes: 8 additions & 12 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { removeAllProducts } from "./redux/cartRedux";
import "./components/Styles/app.css";
import LoadingOverlay from "./components/SpinnerOverlay";
import { loginFailure } from "./redux/userRedux";
import Login from "./pages/Login";
import Register from "./pages/Register";
import Home from "./pages/Home";

const Home = lazy(() => import("./pages/Home"));
const Product = lazy(() => import("./pages/Product"));
const ProductList = lazy(() => import("./pages/ProductList"));
const Register = lazy(() => import("./pages/Register"));
const Login = lazy(() => import("./pages/Login"));
const Cart = lazy(() => import("./pages/Cart"));
const Success = lazy(() => import("./pages/Success"));
const OrderDetails = lazy(() => import("./pages/OrderDetails"));
Expand Down Expand Up @@ -99,12 +99,10 @@ const App = () => {
</Suspense>
}
/>
<Route
path="/login"
element={
<Suspense fallback={<LoadingOverlay />}>
{user ? <Navigate to="/" /> : <Login />}
</Suspense>
<Route
path="/login"
element={
user ? <Navigate to = "/" /> : <Login />
}
/>
<Route
Expand All @@ -118,9 +116,7 @@ const App = () => {
<Route
path="/register"
element={
<Suspense fallback={<LoadingOverlay />}>
{user ? <Navigate to="/" /> : <Register />}
</Suspense>
user ? <Navigate to = "/" /> : <Register />
}
/>
<Route
Expand Down

0 comments on commit 29d8162

Please sign in to comment.