This Project is an Ecommerce Store built with Sveltekit for my final submission to my Full Stack Dev class. Sveltekit was chosen as the JS framework due to the ease of development and due to my personal preferences towards svelte over React and Vue. The application currently uses Postgresql for the database and Prisma as the ORM.
Here is a link to the Demo.
The application has the following features as per the requirements of the project.
- User Authentication: Registration, Login, Logout, Session management.
- Product Catalog: Browse products by categories, view product details.
- Shopping Cart: Add, update quantities, remove items, clear cart.
- Checkout Process: Secure order placement, shipping/billing address input, simulated payment.
- Order Management (Customer): View personal order history and individual order details.
- Admin Panel (Role-based access):
- Dashboard overview.
- Manage Products (CRUD, pagination, search, filter, sort).
- Manage Categories (CRUD).
- Manage Orders (view all, filter by status, search, update order status).
- Manage Users (view, edit user details and admin status).
With in the ./src folder is the code for back the API and the frontend client.
src
├── lib
│ ├── common.ts
│ ├── enums.ts
│ ├── index.ts
│ ├── interfaces.ts
│ ├── layout
│ ├── server
│ └── types.ts
└── routes
├── +error.svelte
├── +layout.server.ts
├── +layout.svelte
├── +page.server.ts
├── +page.svelte
├── account
├── admin
├── api // API endpoints
├── auth
├── cart
├── category
├── checkout
├── orders
└── product
Technologies used.
- Frontend:
- SvelteKit (Web Framework)
- Svelte 5 (UI Library - if you used Svelte 5 features like
$state/$props) - TypeScript (Type-safe JavaScript)
- Tailwind CSS (Utility-first CSS framework)
- Backend / ORM:
- Database:
- PostgreSQL (Relational Database)
- Neon (Serverless PostgreSQL Database)
- Deployment:
- Vercel (Cloud Platform for Serverless Deployments)
- Node.js: (Specify compatible versions, e.g.,
v18.x,v20.x,v22.x- important for Vercel adapter). You might recommendnvmfor easy switching. - npm (or pnpm / yarn)
- Git
To run this project locally just follow the following commands
```bash
git clone https://github.com/rexbrandy/EcomStore.git
cd EcomStore
npm install
# DB Setup
touch .env
echo 'DATABASE_URL="[POSTGRES_CONN_STRING]"' > .env
npx prisma migrate deploy
npx prisma generate
npm run seed # If you want to generate dummy data
# Run dev
npm run dev
```
URL: /admin
Credentials: You need a user account in your database with the isAdmin flag set to true. If you seeded your database, there might be a default admin user. Otherwise, you can manually update a user's isAdmin status in your Neon database using the SQL editor
Seed data Admin Credentials: Email: [email protected] Pass:password123