This is a fully-featured E-Commerce Application built with TypeScript, Express.js, PostgreSQL, and Prisma. The project aims to provide a robust and scalable solution for managing online store operations, including product listings, user management, and order processing.
- User authentication and authorization
- Product listing and management
- Shopping cart functionality
- Order processing and management
- Backend:
- TypeScript
- Express.js
- PostgreSQL
- Prisma
- Tools and Libraries:
- Nodemon
- Jest (for testing)
- ESLint (for code linting)
- Prettier (for code formatting)
- Node.js (version v19.6.0)
- PostgreSQL (version 16)
-
Clone the repository:
git clone https://github.com/theeeep/ecommerce-app-backend.git cd ecommerce-app-backend
-
Install dependencies:
npm install
-
Set up the database:
-
Create a PostgreSQL database
-
Update the
.env
file with your database connection details:DATABASE_URL=postgresql://user:password@localhost:5432/ecommerce-backend?schema=public"
-
-
Run the Prisma migrations to set up the database schema:
npx prisma migrate dev
-
Start the development server:
npm run dev
npm start:dev
: Starts the development servernpm run start:prod
: Builds the project for productionnpm run build
: Starts the built projectnpm test
: Runs tests using Jest
- POST /api/auth/signup: Register a new user
- POST /api/auth/login: Login a user
- GET /api/products: Get all products
- GET /api/products/:id: Get a product by ID
- POST /api/products: Create a new product
- PUT /api/products/:id: Update a product by ID
- DELETE /api/products/:id: Delete a product by ID
- GET /api/orders: Get all orders
- GET /api/orders/:id: Get an order by ID
- POST /api/orders: Create a new order
- PUT /api/orders/:id: Update an order by ID
- DELETE /api/orders/:id: Delete an order by ID
├── README.md
├── dist
│ └── index.js
├── eslint.config.mjs
├── jest.config.ts
├── nodemon.json
├── package-lock.json
├── package.json
├── prisma
│ ├── migrations
│ └── schema.prisma
├── src
│ ├── config
│ ├── controllers
│ ├── error-handler.ts
│ ├── exceptions
│ ├── index.ts
│ ├── middlewares
│ ├── routes
│ ├── schema
│ └── types
├── tsconfig.build.json
└── tsconfig.json
12 directories, 12 files
Contributions are welcome! Please fork the repository and create a pull request with your changes. Make sure to follow the coding style and include relevant tests.
This project is licensed under the MIT License. See the LICENSE file for details.
For any inquiries or support, feel free to contact me at [itz.deeepak@gmail.com] or open an issue on GitHub.