News website for an e-sports update
- React JS
- Express JS
- Tailwind CSS
- SignUp
- Login
- Create Post
- Update Post
- Delete Post
There are two folders provided for back-end and front-end website.
First, clone this repository
git clone https://github.com/faqihmadani/esports-news.git my-project
cd my-project
- Go to back-end folder
cd /back-end
- Install package using npm
npm install
- Create MySql database with two table, users and posts.
- Users has id, username, email, password, img columns
- Posts has id, title, description, category, img, date, uid (FK to users id)
- Go to db.js and set the connection to MySql
// db.js
import mysql from "mysql"
export const db = mysql.createConnection({
host: "",
user: "",
password: "",
database: ""
})
- Run server
npm start
- Go to front-end folder
cd /front-end
- Install package using npm
npm install
-
Create supabase storage for store images. The storage must be named
post-images
-
Create .env file Add the following environment variables to your .env file
VITE_BASE_URL = your_backend_base_url
VITE_SUPABASE_URL = your_supabase_url
VITE_SUPABASE_KEY = your_supabase_key
- Run development server
npm run dev