Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/khaledomar77/store-front-backend
A backend project for building backend for store and creating RESTful APIs for an online store with Node.js,express.js and PostgreSQL.This project is the second project for advanced full stack web development udacity nanodegree
https://github.com/khaledomar77/store-front-backend
expressjs jasmine javascript nodejs postgresql prettier typescript
Last synced: 5 days ago
JSON representation
A backend project for building backend for store and creating RESTful APIs for an online store with Node.js,express.js and PostgreSQL.This project is the second project for advanced full stack web development udacity nanodegree
- Host: GitHub
- URL: https://github.com/khaledomar77/store-front-backend
- Owner: khaledomar77
- Created: 2023-01-10T19:33:19.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-12T19:47:43.000Z (9 months ago)
- Last Synced: 2024-10-16T13:04:11.342Z (20 days ago)
- Topics: expressjs, jasmine, javascript, nodejs, postgresql, prettier, typescript
- Language: JavaScript
- Homepage:
- Size: 64.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# store-front-backend
## About the project
Stackholders want to build an online store for some products available to be purchased. My role is to design a database schema, then build RESTful APIs for retrieving and providing information to the front end develpers.
## Libraries used in this project
* Runtime environment: Node.js.
* Back end framework: Express.js.
* Programming Language: Typescript.
* Database: PostgreSQL.
* Unit testing: Jasmine & Supertest.## How to install project & dependencies
To install the project and its dependencies, run `npm install`
To run the application in the development environment run, `npm run dev`
To run the application, run `npm start`
To compile typescript, run `npx tsc`
To run API tests, run `npm test`
To run formatting, run `npm run prettier`
To run linting and correcting code errors, run `npm run lint`## How to connect to database
1. Create the main database with name `store_dev`, then create another database for testing with name `store_test`.
2. Connect to the database using the command `psql -U postgres`.
3. Run the command `db-migrate up` for up-migrations and `db-migrate down` for down-migrations.
## Environmental variablesThere is list of environment variables located in `.env` for local configuration
```
ENV=dev
POSTGRES_HOST=127.0.0.1
POSTGRES_DB=store_dev
POSTGRES_TEST_DB=store_test
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
BCRYPT_PASSWORD=your-secret-password
SALT_ROUNDS=10
TOKEN_SECRET=my-token-secret
```## Running Ports
After start up, the server will start on port `3000` and the database on port `5432`, The application will run at the URL: [http://localhost:3000/](http://127.0.0.1:3000/)
## Endpoint Access
All endpoints are described in the [REQUIREMENTS.md](REQUIREMENTS.md) file.
## Database schema
Full database schema is defined in the [REQUIREMENTS.md](REQUIREMENTS.md) file.