Key Features • How To Use • Installation • API Endpoints • Related • License
This project is an assignment to create a webshop where users can place orders and make payments integrated with Stripe. Users should be able to register and log in. The user will be created as a customer in Stripe, and their username/email and encrypted password will be stored in a JSON file on the server. User login will be managed using cookies. All products will be managed through Stripe.
- Custom login using cookie-session for user authentication.
- Integration with Stripe API for product management and payments.
- Utilization of PostNord API to provide service points for delivery.
- Backend built with Express and TypeScript.
- Client built with React and Tailwind.
- Product Listing: Implemented a page to list products.
- Stripe Integration: Products displayed and purchased are fetched from Stripe.
- Shopping Cart: Users can add products to a shopping cart.
- Order Placement: Users can place orders through Stripe based on the shopping cart.
- User Registration: Users can register as a user in the webshop. This creates a "Customer" in Stripe and saves the user data in a JSON file.
- User Login: Implemented user login functionality. The logged-in customer (also saved in Stripe) is used when placing an order.
- Authentication: Users cannot place an order without logging in.
- Order Logging: All placed orders are saved to a list in a JSON file.
- Payment Validation: Orders are not saved without completed payment.
- Discount Code: Users can enter a discount code to receive a discount on their purchase (handled through Stripe).
- Order History: Logged-in users can see their placed orders.
- Address Selection: Users need to fill in their address and select a pickup location for the package before payment (PostNord API).
- Email Confirmation: Upon successful order, an email is sent to the customer (Resend Email API).
- Clone the repository from GitHub.
- Navigate to the project directory.
- Follow instructions to set up client and server.
- Run
npm run start
in theserver
directory. - Open a new terminal and run
npm run dev
in theclient
directory. - Navigate to http://localhost:5173 in your favorite browser to use the app.
- Use the promo code
BANANZA
during checkout.
-
Clone the repository:
git clone https://github.com/thejoltjoker/FSU23D-checkout-session.git cd FSU23D-checkout-session/client
-
Install dependencies:
npm install
-
Start the development server with the following command:
npm run dev
-
Clone the repository:
git clone https://github.com/thejoltjoker/FSU23D-checkout-session.git cd FSU23D-checkout-session/server
-
Install dependencies:
npm install
-
Create a
.env
file in the project root and add the following:PORT=3000 SESSION_SECRET=my-session-secret STRIPE_API_KEY=sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX POSTNORD_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx RESEND_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-
Start the server with the following command:
npm run start
- FSU23D-the-restaurant - Second group assignment in the full stack course at Medieinstitutet.
- Picterest - Full-stack app integrating Google Custom Search and Auth0 for user login, image search, and saving favorites. First assignment of FSU23D Integration course.
- SnapCat - Mock Social Media for Cats, Powered by React, TypeScript, React Router, Vite, and Tailwind CSS.
This project is licensed under the MIT License.