This repository contains a React frontend and an Express backend for the Teclia Academia project.
Follow these steps to run both frontend and backend locally.
- Open a terminal and navigate to the backend folder:
cd Backend- Install backend dependencies:
npm install- Start the backend server:
npm run devThis will start the backend on port 3001 by default.
npm start- Open a second terminal and navigate to the project root:
cd ..- Install frontend dependencies:
npm install- Start the Vite development server:
npm run devThe frontend will start on the default Vite port, usually 5173.
The frontend currently points to a deployed backend URL in src/services/api.js.
To use your local backend instead, update BACKEND_BASE_URL in src/services/api.js:
export const BACKEND_BASE_URL = 'http://localhost:3001';Then restart the frontend.
- The backend uses
dotenvand can support environment variables likePORT,DATABASE_URL,DATABASE_PATH, andJWT_SECRET. - If
JWT_SECRETis not set, the backend uses a development fallback secret. - The frontend runs independently from the backend, so make sure both are running before testing functionality.
This project supports both SQLite and PostgreSQL.
Use this script if you want the default local SQLite database setup.
File: Backend/sqlite_setup.sql
Run:
cd Backend
sqlite3 teclia.db < sqlite_setup.sqlUse this script if you want to initialize a Postgres database.
File: Backend/postgres_setup.sql
Example with psql:
cd Backend
psql "$DATABASE_URL" -f postgres_setup.sqlTo run the script in Supabase:a
- Create a new Supabase project.
- Open the SQL editor in Supabase.
- Paste the contents of
Backend/postgres_setup.sqland execute it. - Set the Supabase database URL in the backend environment as
DATABASE_URL.
If you do not have psql, install the PostgreSQL client or use your preferred Postgres tool.
The SQL scripts create these tables:
userscontentsite_stats
The scripts also insert a local admin user and a sample content row.
Admin credentials:
- email:
austinrmz2007@gmail.com - password:
Mondaisa2007*
From the repository root:
# Start the backend
cd Backend && npm install && npm run dev
# In a separate terminal, start the frontend
cd .. && npm install && npm run dev