Welcome to MarsAI
This guide will help you get from installation to your first meaningful action on the MarsAI film festival platform. You’ll learn how to create accounts, submit films, vote as a jury member, and manage users as an administrator.Make sure you’ve completed the Installation guide before proceeding. You should have both backend and frontend servers running.
Overview
The MarsAI platform supports three user roles:- PRODUCER - Submit films to the festival
- JURY - Review and vote on assigned films
- ADMIN - Manage users, films, categories, and awards
Create Your First Admin Account
Login to get your token
Save the token - you’ll need it for authenticated requests. The token is valid for 1 hour by default.
Producer Workflow: Submit Your First Film
Let’s walk through submitting a film as a producer.Create a producer account
Register a producer account:Or use the registration form at
src/api/auth.js
http://localhost:5173/auth/registerJury Workflow: Vote on Films
Jury members review assigned films and vote on them.Admin assigns films to jury
The admin assigns specific films to jury members:This assigns film with
id_movie=1 to jury members with IDs 2, 3, and 4.Jury views assigned films
Login as jury member at Or with curl:
http://localhost:5173/auth/login and navigate to /jury.Fetch assigned films via API:Submit a vote
Jury members can vote on assigned films:Or via API:
src/api/votes.js
Setting
is_candidate: true promotes the film to candidate status. Each jury member can vote only once per film, but can update their vote.Admin Workflow: Manage Users and Films
Administrators have full control over the platform.Managing Users
Managing Films
Update film status
Change film status from PENDING to VALIDATED:Available statuses:
PENDING- Initial submissionVALIDATED- Approved by adminCANDIDATE- Shortlisted by juryREJECTED- Not accepted
Assign jury members to film
Understanding Authentication
All authenticated requests require a JWT token in the Authorization header.Getting a Token
src/api/auth.js
Using the Token
The Axios instance automatically adds the token to requests:src/api/config.js
Token Expiration
Tokens expire after 1 hour by default. When a token expires:API Endpoints Reference
Authentication Routes
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /auth/register | Create new account | No |
| POST | /auth/login | Login and get token | No |
| POST | /auth/register-film | Register producer + submit film | No |
User Routes
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /users/me | Get current user profile | Yes (All roles) |
| PUT | /users/me | Update current user | Yes (All roles) |
| GET | /users | Get all users | Yes (ADMIN) |
| GET | /users/:id | Get user by ID | Yes (ADMIN) |
| POST | /users | Create new user | No* |
| PUT | /users/:id | Update user | Yes (ADMIN) |
| DELETE | /users/:id | Delete user | Yes (ADMIN) |
Movie Routes
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /movies | Get all films (public) | No |
| GET | /movies/:id | Get film by ID | No |
| GET | /movies/mine | Get my films | Yes (PRODUCER) |
| POST | /movies/upload | Submit new film | Yes (PRODUCER) |
| GET | /movies/assigned | Get assigned films | Yes (JURY) |
| PUT | /movies/:id | Update film | Yes (ADMIN) |
| PUT | /movies/:id/status | Update film status | Yes (ADMIN) |
| PUT | /movies/:id/categories | Assign categories | Yes (ADMIN) |
| PUT | /movies/:id/juries | Assign jury members | Yes (ADMIN) |
| PUT | /movies/:id/collaborators | Update collaborators | Yes (PRODUCER, ADMIN) |
| DELETE | /movies/:id | Delete film | Yes (ADMIN) |
Vote Routes
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /votes/mine | Get my votes | Yes (JURY, ADMIN) |
| GET | /votes/mine/:id_movie | Get my vote for film | Yes (JURY, ADMIN) |
| POST | /votes/mine/:id_movie | Create/update my vote | Yes (JURY, ADMIN) |
| GET | /votes | Get all votes | Yes (ADMIN) |
| DELETE | /votes/movie/:id_movie | Delete all votes for film | Yes (ADMIN) |
| DELETE | /votes/:id | Delete vote by ID | Yes (ADMIN) |
Next Steps
Now that you understand the basics:API Reference
Explore detailed API documentation
User Guides
Learn advanced user management
Film Submission
Learn about film submission and categories
Voting System
Understand the jury voting workflow
Common Use Cases
Register a producer and submit their film in one request
Register a producer and submit their film in one request
Use the combined registration endpoint:This creates both the user account and the film submission in a single transaction.
Promote a film to candidate status as a jury member
Promote a film to candidate status as a jury member
Get current user info from token
Get current user info from token
Troubleshooting
401 Unauthorized errors
401 Unauthorized errors
File upload fails
File upload fails
Common issues:
- File too large (check server limits)
- Wrong file type (must be MP4 for films)
Content-Typeheader must bemultipart/form-data- Ensure
uploads/directory exists and is writable
Cannot access admin/jury/producer routes
Cannot access admin/jury/producer routes
Check your role:Routes are protected by role:
/admin/*requires ADMIN role/jury/*requires JURY role/producer/*requires PRODUCER role