This is a Next.js project that started with create-next-app, which was created as a challenge post to BSale. The challenge consisted in creating a BSale store (test) that displays products, filtered products and grouped by category to which they belong from a database.
To clone and run this application, you'll need Git, Node.js (which comes with npm) installed on your computer and Yarn. From your command line:
# Clone this repository
$ git clone https://github.com/jcarlos0511/bsale-store.git
# Enter the created folder
$ cd bsale-store
# Install dependencies
$ yarn install
Set up a MySQL server either locally or any cloud provider.
Copy the env.local.example file in this directory to .env.local (which will be ignored by Git):
cp .env.local.example .env.local
Set each variable on .env.local:
MYSQL_HOST- Your MySQL host URL.MYSQL_DATABASE- The name of the MySQL database you want to use.MYSQL_USERNAME- The name of the MySQL user with access to database.MYSQL_PASSWORD- The passowrd of the MySQL user.
# Run the app
$ yarn dev
# Visit http://localhost:3000/
Open http://localhost:3000 with your browser to see the result.
- How to Prevent SQL Injection in Node.js
- Serverless mysql - NPM
- MySQLTutorial
- Next.js examples - GitHub
- React TypeScript Cheatsheets
- Marked - a markdown parser
- GitHub @jcarlos0511
- Twitter @jncarloschara