Prerequisites
Before you begin, ensure you have the following installed on your system:- Node.js 24+ (LTS version recommended)
- MySQL 8+
- npm (comes with Node.js)
- Git (for cloning the repository)
We recommend using
nvm (Node Version Manager) to manage Node.js versions. This ensures compatibility across different projects.Installing Node.js with nvm
Project Structure
The MarsAI platform consists of two main components:- Backend (
back/) - Express.js REST API with MySQL database - Frontend (
front/) - React application built with Vite
Backend Setup
Install dependencies
express- Web frameworksequelize- ORM for MySQLjsonwebtoken- Authenticationbcrypt- Password hashingmulter- File uploads@aws-sdk/client-s3- S3 storage integration
Configure environment variables
Copy the example environment file:Edit
.env with your configuration:.env
Create MySQL database
Connect to your MySQL server and create the database:
The database configuration is defined in
back/config/config.json. Update this file if you use different credentials.Run database migrations
Sequelize CLI will create all necessary tables:This creates the following tables:
Users- User accounts (ADMIN, JURY, PRODUCER)Categories- Film categoriesMovies- Film submissionsCollaborators- Film crew membersEvents- Festival eventsVotes- Jury voting recordsAwards- Award definitionsSponsors- Festival sponsorsReservations- Event reservationsNewsletterSubscribers- Newsletter subscriptions
Migration troubleshooting
Migration troubleshooting
If migrations fail:
Frontend Setup
Install dependencies
react&react-dom- React frameworkvite- Build tool and dev serverreact-router- Client-side routing@tanstack/react-query- Data fetching and cachingaxios- HTTP clienttailwindcss- CSS framework@vidstack/react- Video playerreact-i18next- Internationalizationzod&react-hook-form- Form validation
Configure API endpoint
The frontend connects to the backend via the Axios instance in
src/api/config.js:src/api/config.js
For production, update the
baseURL to point to your deployed backend API endpoint.Running Both Servers
For convenience, you can run both servers simultaneously from the root directory:Verifying Installation
Check frontend
Open
http://localhost:5173 in your browser. You should see the MarsAI Festival homepage.Production Deployment
Backend Deployment
Frontend Deployment
Optional Configuration
YouTube Integration
The platform includes YouTube integration for film trailer management. To enable:Set up Google OAuth credentials
- Go to Google Cloud Console
- Create a new project or select existing
- Enable YouTube Data API v3
- Create OAuth 2.0 credentials
- Add credentials to
.env:
Email Notifications
Configure SMTP settings in.env to enable email notifications:
- Film submission confirmations
- Newsletter subscriptions
- Jury assignment notifications
Troubleshooting
Port already in use
Port already in use
Change the port in
.env (backend) or vite.config.js (frontend):vite.config.js
Database connection failed
Database connection failed
Verify your MySQL service is running:
CORS errors in frontend
CORS errors in frontend
The backend has CORS configured for
http://localhost:5173. If you use a different port, update back/index.js:back/index.js
File upload errors
File upload errors
Ensure the
uploads/ directory exists and has write permissions:Next Steps
Now that your platform is installed, check out the Quickstart Guide to:- Create your first admin account
- Submit a film as a producer
- Vote on films as a jury member
- Manage users and content as an administrator