Skip to content

aelyakoubi/website-frontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

64 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ง Development & Production-Based Approach

๐ŸŒ Live Demo

Visit the App

โš ๏ธ Note: It may take 50 to 160 seconds for the events to be loaded due to the cold start delay on a free Render account.

๐Ÿ” Test Credentials

To test the application, log in using:

  • Username: Wimpie Blok
  • Password: Wimpie1234

โš ๏ธ Important: Do NOT click the โ€œDeleteโ€ button on the user account page. If you do, youโ€™ll need a new test account.

  • You can find alternative credentials in this GitHub file:
    /website-backend/src/data/users.json
  • Or simply create a new account via the signup page.

๐Ÿ› ๏ธ Local Setup Instructions

Step 1: Frontend (Terminal 1)

npm install
npm audit fix       # Optional, if needed
npm run start       # Starts on port 5173

Step 2: Backend (Terminal 2)

npm install
npm audit fix       # Optional, if needed
npm run start       # Starts on port 3000

Step 3: MySQL Database (Terminal 3)

npx prisma studio

๐ŸŒ API Routing Note

To simplify development and deployment, absolute URLs are used when making API requests:

fetch(`${import.meta.env.VITE_API_URL}/events/${eventId}`)

๐Ÿ“Œ Why this approach?

Using a full base URL via import.meta.env.VITE_API_URL avoids the need to switch between relative paths (like /api/...) in development vs. production. This ensures consistency and reduces manual adjustments across environments.

  • โœ… Works seamlessly with environment variables (e.g., .env.local, .env.production)
  • โœ… Prevents CORS issues when frontend and backend are hosted on different domains
  • โœ… Suitable for both local development and split deployment (e.g., Render)

โ„น๏ธ VITE_API_URL is defined in your .env file and points to the backendโ€™s base URL (e.g., http://localhost:3000 for local or your Render backend URL in production).


๐Ÿ”— Project Context: Render-Based Split Deployment

This project was originally developed as a monorepo fullstack application (frontend + backend in one).

โš ๏ธ However, due to Renderโ€™s free-tier limitations, the project has been split into two public repositories for deployment:

  • website-frontend
  • website-backend

Although hosted separately, both are part of the same project and communicate via API endpoints. The frontend uses the backend through a base URL defined in environment variables.

๐Ÿงฉ In a professional setup (like Vercel, AWS, or Docker), the app can run as a single fullstack application again.


๐Ÿงช Testing Notes

  • The .env file is included for testing purposes.
  • Integration and unit tests are still being updated due to recent project changes.

๐Ÿš€ Project Status: Onward & Upward

๐Ÿ”ง Current Phase (In Progress):

  • Testing suite (Unit, API & Integration)
  • Auth flow (Forgot Password, Secure Token Handling)
  • Technical documentation (Setup Guide, API References)

Screenshot 2024-10-13 164227 Screenshot 2024-10-11 142737 Screenshot 2024-10-10 203209 Screenshot 2024-10-10 203329 Screenshot 2024-10-11 142435 Screenshot 2024-10-11 142143 Screenshot 2024-10-11 142038 Screenshot 2024-10-10 203233 Screenshot 2024-10-10 203244 Screenshot 2024-10-10 203306 Screenshot 2024-10-11 143335 Screenshot 2024-10-11 143404 Screenshot 2024-10-11 143421

About

1 of 2 for the render server

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published